diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 91828cb561..c03bf7c629 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -84,6 +84,12 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { logger.warn("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); throw new RenException(EpmetErrorCode.ERR10003.getCode()); } + //未禁用enable,已禁用disabled + if ("disabled".equals(result.getData().getEnableFlag())) { + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), + String.format("当前账号已被禁用staffId:%s", result.getData().getUserId()), + EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } GovWebOperLoginResultDTO resultDTO = result.getData(); //4.密码是否正确 diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 29283f6b01..1d8cbf8b4f 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -478,7 +478,7 @@ public class SsoServiceImpl implements SsoService { customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 18a5294b28..933d936d81 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -10,9 +10,9 @@ import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; 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.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -22,7 +22,6 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.CustomerDingDingRedis; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; @@ -198,6 +197,20 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode()); } StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); + //2022.11.24校验下用户是否被禁用 + //2.1根据手机号查询到用户信息 前端不跳转,暂时先注释吧 + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId()); + dto.setMobile(staffLatestAgencyResultDTO.getMobile()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); + if (!customerStaffResult.success()) { + logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", staffLatestAgencyResultDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + // 8008 前端会提示:登录失效,请重新登录 跳转到登录界面。所以这里写死返回8008. + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.PLEASE_LOGIN.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3.记录staff_wechat this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId()); @@ -407,7 +420,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); @@ -544,7 +557,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } - + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); for (CustomerStaffDTO customerStaffDTO : customerStaffResult.getData()) { @@ -577,12 +592,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol dto.setCustomerId(customer.getId()); dto.setMobile(formDTO.getMobile()); Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); - if (!customerStaffResult.success()) { + if (!customerStaffResult.success()||CollectionUtils.isEmpty(customerStaffResult.getData())) { logger.warn(String.format("手机密码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } //2、密码是否正确 List customerStaffList=customerStaffResult.getData(); + // 禁用的给予提示 + if("disabled".equals(customerStaffList.get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); //是否设置过密码 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 0463d290a2..499d4131b8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -32,7 +32,8 @@ public enum EpmetErrorCode { CANNOT_CREATE_GROUP(8002, "只有党员和热心居民才能创建小组,请选择您的身份"), GROUP_ALREADY_EXISTED(8003,"组名已存在"), GOV_STAFF_NOT_EXISTS(8004,"手机号未注册,请联系贵单位管理员,确认其录入手机与您所持手机号相同"), - GOV_STAFF_DISABLED(8005,"您好,您的账户已被冻结,请联系管理员。"), + //您好,您的账户已被冻结,请联系管理员。=>您好,服务到期,账户暂时冻结,请联系管理员。 + GOV_STAFF_DISABLED(8005,"您好,服务到期,账户暂时冻结,请联系管理员。"), LOSE_EFFICACY(8006,"此邀请链接已过期"), ERROR_PHONE(8007,"请输入正确的手机号"), PLEASE_LOGIN(8008,"请重新登录"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java index 6d2e509797..ba53ab8c66 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java @@ -8,6 +8,7 @@ package com.epmet.commons.tools.utils; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; @@ -64,6 +65,21 @@ public class ConvertUtils { return targetList; } + public static List batchMapToEntity(List> maps, Class entity){ + if (CollectionUtils.isEmpty(maps)){ + return new ArrayList<>(); + } + List targetList = new ArrayList<>(maps.size()); + try { + for (Map map : maps) { + targetList.add(mapToEntity(map, entity)); + } + }catch (Exception e){ + logger.error("batchMapToEntity convert error ", e); + } + return targetList; + } + public static T mapToEntity(Map map, Class entity) { if (null == map){ return null; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 2c0fc380e6..8ddbea5066 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -1077,4 +1077,39 @@ public class DateUtils { calendar.add(Calendar.DAY_OF_MONTH, day); return calendar.getTime(); } + + + /** + * @Description 获取自定义周几对应的日期 + * 例:num=7,str="1,2" 表示获取未来周天周一出现的日期,两个总共出现七次, + * 比如今天1号是周一则得到的值是1号7号8号14号15号21号22号7次的日期 + */ + public static List getCustomDay(Date startDate, int num, String str) { + List result = new ArrayList<>(); + Calendar rightNow = Calendar.getInstance(); + rightNow.setTime(startDate); + rightNow.add(Calendar.DATE,-1); + startDate = rightNow.getTime(); + Date tomorrow; + Integer tag = 1; + while (tag <= num){ + tomorrow = getTomorrow(startDate); + // 返回周末 + if (isContain(tomorrow, str)) { + result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow)); + tag++; + } + startDate = tomorrow; + } + return result; + } + /** + * @Description 判断日期对应的周几在字符串是否包含 + * 例:当前时间为22.11.28为周一对应是一周的第二天,判断2在str字符串是否包含 + */ + private static boolean isContain(Date date, String str) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + return str.contains(String.valueOf(cal.get(Calendar.DAY_OF_WEEK))); + } } 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-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/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 7d98a40c7a..617718c6ac 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -391,6 +391,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + root + root + @@ -529,6 +535,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + @@ -668,6 +680,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_cloud_viewer + EpmEtclOUdvIEwEr@w + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index bbf8011130..67fd1c711d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -189,7 +189,7 @@ public class GovOrgController { /** * 组织下的工作人员 下拉框 - * + * 2022.11.23调整:已经禁用的人,不展示 * @param tokenDto * @param agencyId * @return 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 39f67d2af1..2319248c83 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 @@ -75,6 +75,7 @@ public interface CustomerStaffDao extends BaseDao { /** * 根据staffId查询姓名、手机号 + * 禁用的不展示 * @param staffIds * @return */ 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/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..e605d5e291 --- /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_READ) +@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..f8c5a28397 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())&&"".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/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index fd72caafbf..28dd494f7c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -174,6 +174,11 @@ dynamic: url: @datasource.druid.partymember.url@ username: @datasource.druid.partymember.username@ password: @datasource.druid.partymember.password@ + evaluationIndexRead: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex1.url@ + username: @datasource.druid.evaluationIndex1.username@ + password: @datasource.druid.evaluationIndex1.password@ feign: hystrix: enabled: true 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 9ac36b2509..2ee923a736 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 @@ -140,6 +140,7 @@ AND USER_ID = #{staffId} + + + 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-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..b8e0cf7132 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/ScreenPyHistoryScoreDetailDTO.java @@ -0,0 +1,126 @@ +/** + * 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 xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 能力得分 + */ + 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..f5e26d5101 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreFormDTO.java @@ -0,0 +1,106 @@ +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; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 能力得分 + */ + private BigDecimal nldf; + } + +} 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..0e61017efe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HistoryScoreListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + private String startTime; + + /** + * 截止时间 + */ + //@JsonFormat(pattern = "yyyy-MM-dd") + 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..546ac9c4e6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java @@ -0,0 +1,120 @@ +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; + + /** + * 事件赋分 + */ + private BigDecimal sjff; + + /** + * 雪亮工程 + */ + private BigDecimal xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 能力得分 + */ + private BigDecimal nldf; + } + +} 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..8efdff7216 --- /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; + /** + * 例行工作总得分 + */ + private Integer projectScore; + /** + * 网格员总数 + */ + private Integer gridStaffNum; + +} 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 54b10fbbb1..9140f9f099 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -155,6 +155,12 @@ 2.0.0 compile + + com.epmet + data-aggregator-client + 2.0.0 + compile + 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..8c3e16bae9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java @@ -0,0 +1,154 @@ +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)); + } + +} 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..97d9cdc287 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java @@ -0,0 +1,44 @@ +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.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); +} 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..9d5b7b9851 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/ScreenPyHistoryScoreDetailEntity.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 xlgc; + + /** + * 日核周调 + */ + private BigDecimal rhzt; + + /** + * 亮点工作 + */ + private BigDecimal ldgz; + + /** + * 其他工作 + */ + private BigDecimal qtgz; + + /** + * 能力得分 + */ + 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..c92ba2cfaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java @@ -0,0 +1,30 @@ +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 com.epmet.dto.result.IcMoveInListResultDTO; + +/** + * 平阴历史得分主表 + * + * @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); +} 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..cb41b6905b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java @@ -0,0 +1,203 @@ +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.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.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 java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 平阴历史得分主表 + * + * @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); + 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.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); + }); + 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.updateById(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("统计街道下网格活跃度数据失败"); + } + GridLivelyResultDTO gridLively = result.getData().get(NumConstant.ZERO); + String score = (gridLively.getGridSumNum() <= 0) ? "0" : numberFormat.format(((float) gridLively.getGridLivelyNum() / (float) gridLively.getGridSumNum()) * 100 + (gridLively.getGridOrdinaryNum() / 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()) + (dto2.getProjectScore() / dto3.getGridStaffNum())); + resultDTO.setScore(score); + } + return resultDTO; + } + + +} 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..7616671c45 --- /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.updateById(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..91374a561a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + 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/result/ServiceRecordV2DetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java index f77d349ccb..8f7ccafd45 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java @@ -21,6 +21,11 @@ public class ServiceRecordV2DetailResultDTO implements Serializable { private String serviceName; private String policyId; + /** + * 政策标题 + * 详情接口返回 + */ + private String policyTitle; /** * 服务组织类型 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java index 7738a3f38e..fe3200df2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java @@ -31,4 +31,6 @@ public interface IcPolicyDao extends BaseDao { @Param("title")String title, @Param("content")String content, @Param("expiredFlag")String expiredFlag); + + String selectTitle(String policyId); } \ No newline at end of file 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 2367f0bbb1..4d89c1bef8 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 @@ -102,14 +102,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { - if (null == formDTO.getStartTime()) { + /*if (null == formDTO.getStartTime()) { Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setStartTime(startDate); } if (null == formDTO.getEndTime()) { Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setEndTime(endDate); - } + }*/ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = baseDao.selectActivityList(formDTO); PageInfo pageInfo = new PageInfo<>(list); @@ -159,14 +159,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl list(PartyActivityFormDTO formDTO) { - if (null == formDTO.getStartTime()) { + /*if (null == formDTO.getStartTime()) { Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setStartTime(startDate); } if (null == formDTO.getEndTime()) { Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); formDTO.setEndTime(endDate); - } + }*/ List list = baseDao.selectActivityList(formDTO); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java index 8eca6b07e9..c261588910 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; 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.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -16,10 +17,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.SmsTemplateConstant; -import com.epmet.dao.IcServiceFeedbackV2Dao; -import com.epmet.dao.IcServiceRecordV2Dao; -import com.epmet.dao.IcServiceScopeDao; -import com.epmet.dao.IcServiceScopeV2Dao; +import com.epmet.dao.*; import com.epmet.dto.IcServiceFeedbackV2DTO; import com.epmet.dto.IcServiceRecordV2DTO; import com.epmet.dto.IcServiceScopeV2DTO; @@ -72,6 +70,9 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl page(Map params) { @@ -271,6 +272,7 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl - AND (ur.AGENCY_ID = #{agencyId} or ur.PIDS like concat('%',#{agencyId},'%')) - - - AND ur.UNIT_ID = #{unitId} - - GROUP BY - ur.ACTIVITY_ID - ) b ON a.ID = b.ACTIVITY_ID - INNER JOIN ( - SELECT - sr.ACTIVITY_ID, - GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter - FROM - ic_activity_service_relation sr - WHERE - sr.DEL_FLAG = '0' - - AND (sr.AGENCY_ID = #{agencyId} or sr.PIDS like concat('%',#{agencyId},'%')) - - - AND sr.SERVICE_MATTER = #{serviceMatter} - - GROUP BY - sr.ACTIVITY_ID - ) c ON a.ID = c.ACTIVITY_ID + left join ic_activity_unit_relation ur + on (ur.ACTIVITY_ID=a.id + and ur.del_flag='0') + left JOIN ic_activity_service_relation sr + on(a.ID = sr.ACTIVITY_ID + and sr.del_flag='0') WHERE a.DEL_FLAG = '0' @@ -109,11 +81,19 @@ AND a.GRID_ID = #{gridId} - AND TITLE LIKE concat('%', #{title}, '%') + AND a.TITLE LIKE concat('%', #{title}, '%') - AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} - ORDER BY ACTIVITY_TIME DESC - + + AND ur.UNIT_ID = #{unitId} + + + AND sr.SERVICE_MATTER = #{serviceMatter} + + + AND a.ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} + + GROUP BY a.id + ORDER BY a.ACTIVITY_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcNatClearTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcNatClearTask.java new file mode 100644 index 0000000000..761c1a3d0a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcNatClearTask.java @@ -0,0 +1,39 @@ +package com.epmet.task.ic; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.task.ITask; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName IcNatClearTask + * @Description 核酸检测定时清理 + * @Author wangxianzhang + * @Date 2022/11/29 13:41 + */ +@Slf4j +@Component("icNatClearTask") +public class IcNatClearTask implements ITask { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Override + public void run(String jsonParams) { + Map paramMap; + if (StringUtils.isNotBlank(jsonParams)) { + paramMap = JSON.parseObject(jsonParams, new TypeReference>(){}); + } else { + paramMap = new HashMap<>(); + } + epmetUserOpenFeignClient.clearNatRecords(paramMap); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 287ff51e80..e49322cfe6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -120,7 +120,7 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService log.error("未查询到根组织:"+organizationId); return true; } - rootOrg.setPid(""); + rootOrg.setPid(NumConstant.ZERO_STR); rootOrg.setPids(""); rootOrg.setNameOfOrganization(""); needInsert.add(rootOrg); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java index dcb9febc59..351b92e707 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java @@ -50,10 +50,15 @@ public class IcPartyServiceCenterMatterDTO implements Serializable { private String matterName; /** - * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend 自定义:custom */ private String appointmentType; + /** + * 类型为自定义时选择的周一~周末的时间(1-7逗号分割) + */ + private String customDay; + /** * 可预约开始时间 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java index d3497bacd1..d7c397c374 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java @@ -40,6 +40,8 @@ public class MatterListDTO implements Serializable { private String matterImg; + private String customDay; + public MatterListDTO() { this.sort = NumConstant.ZERO; this.matterName = ""; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java index f229cc1d37..a1eea7289d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java @@ -52,6 +52,11 @@ public class AllMattersResultDTO implements Serializable { */ private String appointmentType; + /** + * 类型为自定义时选择的周一~周末的时间(1-7逗号分割) + */ + private String customDay; + public AllMattersResultDTO() { this.matterName = ""; this.allowTime = ""; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java index f7189534a4..373bff906c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java @@ -45,6 +45,11 @@ public class AppointmentRecordResultDTO implements Serializable { */ private String matterImg; + /** + * 类型为自定义时选择的周一~周末的时间(1-7逗号分割) + */ + private String customDay; + /** * 是否能取消预约 true:能,false:不能 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CurrentUserCommunityInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CurrentUserCommunityInfoResultDTO.java new file mode 100644 index 0000000000..3b82e5b77c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CurrentUserCommunityInfoResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 当前登陆人的所属社区 + * @Author wgf + * @Date 2020/11/30 22:35 + */ +@Data +public class CurrentUserCommunityInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4360690752084258055L; + + /** + * 组织ID + */ + private String orgId; + + /** + * 名称 + */ + private String orgName; + + +} + 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/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java index 50f6baed7e..67e25ee3f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java @@ -16,5 +16,6 @@ public interface PartyServiceCenterConstant { String APPOINTMENT_TYPE_EVERY_DAY = "everyDay"; String APPOINTMENT_TYPE_WORK_DAY = "workDay"; String APPOINTMENT_TYPE_WEEKEND = "weekend"; + String APPOINTMENT_TYPE_CUSTOM = "custom"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index e9fb4e56ef..ba94cc12ab 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -505,5 +505,17 @@ public class CustomerAgencyController { return customerAgencyService.getCommunityInfoByUserId(userId); } + /** + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 获取当前登录人的所属社区 + * @Date 2022/11/30 22:41 + **/ + @PostMapping("getCurrentUserCommunityInfo") + public Result> getCurrentUserCommunityInfo(@LoginUser TokenDto tokenDTO) { + return customerAgencyService.getCurrentUserCommunityInfo(tokenDTO); + } + } 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..f462449ec9 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 @@ -293,6 +293,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/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/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index fb1fc77855..e2fbd3162a 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 @@ -398,5 +398,9 @@ public interface CustomerAgencyDao extends BaseDao { List getUsingCommunityList(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("agencyOrgIdPath") String agencyOrgIdPath, @Param("endDate") Date endDate); List getCommunitysByOrgIdPath(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgIdPath") String orgIdPath); + + List getCurrentUserCommunityInfo(@Param("customerId") String customerId,@Param("staffAgencyId")String staffAgencyId); + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java index 9248d827f2..07360e4bca 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java @@ -46,10 +46,15 @@ public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity { private String matterName; /** - * 预约类型,每天:everyDay,工作日:workDay,周末:weekend + * 预约类型,每天:everyDay,工作日:workDay,周末:weekend 自定义:custom */ private String appointmentType; + /** + * 类型为自定义时选择的周一~周末的时间(1-7逗号分割) + */ + private String customDay; + /** * 可预约开始时间 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index e71189e0ad..f9ac7182e7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -18,7 +18,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +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.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; @@ -344,4 +346,13 @@ public interface CustomerAgencyService extends BaseService * @Date 2022/6/21 22:41 **/ Result getCommunityInfoByUserId(String userId); + + /** + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author wgf + * @Description 获取当前登录人的所属社区 + * @Date 2022/11/30 22:41 + **/ + Result> getCurrentUserCommunityInfo(TokenDto tokenDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 3ee1bc565e..05be03a65c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.commons.tools.redis.RedisUtils; 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.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; @@ -1611,4 +1612,16 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl().ok(communityInfoResultDTO); } + @Override + public Result> getCurrentUserCommunityInfo(TokenDto tokenDTO) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(tokenDTO.getCustomerId(), tokenDTO.getUserId()); + if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) { + log.warn("com.epmet.service.impl.CustomerAgencyServiceImpl.getMySubAgencyList,没有找到工作人员所属的机关信息,用户Id:{}", tokenDTO.getUserId()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取用户组织信息异常","获取用户组织信息异常"); + } + List list = baseDao.getCurrentUserCommunityInfo(tokenDTO.getCustomerId(),staffInfoCacheResult.getAgencyId()); + + return new Result>().ok(list); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 7ddbadf0f9..c37f13d8ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -22,6 +22,8 @@ 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.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; @@ -140,6 +142,12 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); + if(!staffInfo.success()||null==staffInfo.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"userId:"+userId+"customer_staff is null","获取用户信息异常"); + } + if("disabled".equals(staffInfo.getData().getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); resultDTO.setGender(staffInfo.getData().getGender()); //获取客户名称 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 943d6f9eee..93322c7ed6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -3,8 +3,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.rocketmq.constants.TopicConstants; -import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; @@ -12,14 +10,10 @@ 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.redis.common.CustomerIcHouseRedis; -import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; -import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.NeighborhoodConstant; import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcHouseDao; @@ -29,9 +23,7 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; -import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcBuildingUnitEntity; @@ -51,11 +43,8 @@ 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 org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -97,7 +86,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl dateList = getDateList(entity.getAppointmentType()); + List dateList = getDateList(entity.getAppointmentType(), entity.getCustomDay()); Boolean s = false; for (String d : dateList) { if (d.equals(formDTO.getAppointmentDate())){ @@ -388,7 +388,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl dateList = getDateList(entity.getAppointmentType()); + List dateList = getDateList(entity.getAppointmentType(), entity.getCustomDay()); Boolean s = false; for (String d : dateList) { if (d.equals(formDTO.getAppointmentDate())){ @@ -499,7 +499,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl l = new LambdaQueryWrapper<>(); l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate()) @@ -564,14 +564,16 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl getDateList(String type) { + public List getDateList(String type, String customDay) { List result = new ArrayList<>(); if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_EVERY_DAY)){ result = DateUtils.getEveryDayList(new Date(),NumConstant.SEVEN); }else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_WORK_DAY)){ result = DateUtils.getWorkDayList(new Date(),NumConstant.SEVEN); - }else { + }else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_WEEKEND)){ result = DateUtils.getWeekendDayList(new Date(),NumConstant.SEVEN); + }else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_CUSTOM)){ + result = DateUtils.getCustomDay(new Date(),NumConstant.SEVEN, customDay); } return result; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.47__alter_ic_party_service_center_matter.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.47__alter_ic_party_service_center_matter.sql new file mode 100644 index 0000000000..778637134c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.47__alter_ic_party_service_center_matter.sql @@ -0,0 +1,7 @@ + +ALTER TABLE `ic_party_service_center_matter` +MODIFY COLUMN `APPOINTMENT_TYPE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '预约类型,每天:everyDay,工作日:workDay,周末:weekend , 自定义:custom' AFTER `MATTER_NAME`, +ADD COLUMN `CUSTOM_DAY` varchar(32) NULL COMMENT '类型为自定义时选择的周一~周末的时间(1-7逗号分割)周日:1;周一2;周二3;周三4;周四5;周五6;周六7' AFTER `APPOINTMENT_TYPE`; + + + 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 d221f07b12..482eac4596 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 @@ -1040,4 +1040,19 @@ having community_count > 0 order by created_time desc) t + 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 7c03f1a94d..9febecf227 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 @@ -384,7 +384,7 @@ WHERE del_flag = '0' and ABANDON_FLAG='0' AND pid = #{agencyId} - ORDER BY created_time DESC + ORDER BY sort asc,created_time asc \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml index f4898cea8a..6ea3c2a74f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml @@ -61,10 +61,12 @@ prd.* from ic_party_member_pay_record_detail prd where prd.DEL_FLAG = 0 - AND CONCAT(prd.YEAR,'-',prd.MONTH) IN - - #{month} - + + AND CONCAT(prd.YEAR,'-',prd.MONTH) IN + + #{month} + + and prd.PARTY_MEMBER_ID = #{partyMemberId} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java index 9f697c584e..cd042877ab 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java @@ -126,6 +126,7 @@ public class CustomerStaffDTO implements Serializable { /** * 未禁用enable,已禁用diabled + * disabled */ private String enableFlag; 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/IcTripReportRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java index 60491f0b17..0a236903bf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java @@ -375,4 +375,238 @@ public class IcTripReportRecordDTO implements Serializable { */ @ExcelIgnore private String createdByName; + + /** + * 核酸检测报告异常 是/否【烟台】 + */ + @ExcelIgnore + private String detectionAbnormal; + /** + * 两码一报告状态 (正常 异常)【烟台】 + */ + @ExcelIgnore + private String twoCodeOneReportStatus; + /** + * 申报状态( 0未审核 1审核通过 2无效数据)【烟台】 + */ + @ExcelIgnore + private String declarationStatus; + /** + * 是否有外地旅居史 是/否【烟台】 + */ + @ExcelIgnore + private String nonlocalResidenceHistory; + /** + * 途经省【烟台】 + */ + @ExcelIgnore + private String viaProvince; + /** + * 途经市【烟台】 + */ + @ExcelIgnore + private String viaCity; + /** + * 途经县区【烟台】 + */ + @ExcelIgnore + private String viaCounty; + /** + * 编码【烟台】 + */ + @ExcelIgnore + private String viaCode; + /** + * 编码全路径【烟台】 + */ + @ExcelIgnore + private String viaPathCode; + /** + * 途经地区全拼 + */ + @ExcelIgnore + private String via; + /** + * 同行人员【烟台】 + */ + @ExcelIgnore + private String travelPersonnel; + /** + * 户籍地【烟台】 + */ + @ExcelIgnore + private String registeredResidenceCity; + /** + * 户籍地详细【烟台】 + */ + @ExcelIgnore + private String registeredResidenceAddress; + /** + * 编码【烟台】 + */ + private String registeredResidenceCode; + /** + * 编码全路径【烟台】 + */ + private String registeredResidencePathCode; + /** + * 是否带车 是/否 【烟台】 + */ + @ExcelIgnore + private String carryVehicle; + /** + * 带车车牌号【烟台】 + */ + @ExcelIgnore + private String carryVehicleNumber; + /** + * 车牌颜色【烟台】 + */ + @ExcelIgnore + private String carryVehicleNumberColor; + /** + * 目的地交通场站【烟台】 + */ + @ExcelIgnore + private String destinationStation; + /** + * 入鲁时间【烟台】 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String arriveLuTime; + /** + * 行程码【烟台】 + */ + @ExcelIgnore + private String travelCodeImg; + /** + * 无效时间【烟台】 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String invalidTime; + /** + * 证件类型【烟台】 + */ + @ExcelIgnore + private String cardType; + /** + * 区域【烟台】 + */ + @ExcelIgnore + private String area; + /** + * 年龄【烟台】 + */ + @ExcelIgnore + private int age; + /** + * 性别【烟台】 + */ + @ExcelIgnore + private String sex; + /** + * 是否有新冠肺炎病史 是/否 【烟台】 + */ + @ExcelIgnore + private String covidFlag; + /** + * 来烟方式【烟台】 + */ + @ExcelIgnore + private String comeMode; + /** + * 班次【烟台】 + */ + @ExcelIgnore + private String shift; + /** + * 抵烟时间【烟台】 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String arriveTime; + /** + * 上报街道【烟台】 + */ + @ExcelIgnore + private String reportStreet; + /** + * 来源地区全【烟台】 + */ + @ExcelIgnore + private String comeAreaFull; + /** + * 离开风险区域的时间【烟台】 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String leaveTheRiskAreaTime; + /** + * 是否携带48小时核算证明 是/否【烟台】 + */ + @ExcelIgnore + private String carryHesuanProof; + /** + * 省【烟台】 + */ + @ExcelIgnore + private String provinceName; + /** + * 市【烟台】 + */ + @ExcelIgnore + private String cityName; + /** + * 县【烟台】 + */ + @ExcelIgnore + private String countyName; + /** + * 详细地址【烟台】 + */ + @ExcelIgnore + private String twonName; + /** + * 健康码异常 是/否【烟台】 + */ + @ExcelIgnore + private String healthCodeAbnormal; + /** + * 行程码异常 是/否【烟台】 + */ + @ExcelIgnore + private String travelCodeAbnormal; + /** + * 【烟台】 + */ + @ExcelIgnore + private String iId; + /** + * 【烟台】 + */ + @ExcelIgnore + private String iDate; + /** + * 【烟台】 + */ + @ExcelIgnore + private String iType; + /** + * 【烟台】 + */ + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private String iTime; + /** + * 【烟台】 + */ + @ExcelIgnore + private String iFlag; + /** + * 烟台数据主键【烟台】 + */ + private String ytId; + } 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/YTTripReportListDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/YTTripReportListDTO.java new file mode 100644 index 0000000000..5d0f034489 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/YTTripReportListDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/11/11 15:05 + */ +@Data +public class YTTripReportListDTO implements Serializable { + private static final long serialVersionUID = -5583350209850076659L; + + private String cardno; + + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java index e2212b7608..52cda8c2a0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java @@ -18,5 +18,8 @@ public class EnableStaffFormDTO implements Serializable { * 被解禁用户Id */ private String staffId; - + /** + * token中获取 + */ + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInAddEditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInAddEditFormDTO.java index 083658ffda..906302c37e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInAddEditFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInAddEditFormDTO.java @@ -111,7 +111,7 @@ public class IcMoveInAddEditFormDTO implements Serializable { /** * 详细地址 */ - @NotBlank(message = "详细地址不能为空", groups = {AddGroup.class}) + //@NotBlank(message = "详细地址不能为空", groups = {AddGroup.class}) private String address; /** * 迁移证号码 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcYtTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcYtTripReportFormDTO.java new file mode 100644 index 0000000000..f6c8307e4e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcYtTripReportFormDTO.java @@ -0,0 +1,339 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 行程上报烟台入参 + */ +@Data +public class IcYtTripReportFormDTO implements Serializable { + + public interface YtAdd extends CustomerClientShowGroup { + } + public interface YtEdit extends CustomerClientShowGroup { + } + + @NotBlank(message = "主键不能为空", groups = {YtEdit.class}) + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空", groups = {YtAdd.class}) + private String name; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {YtAdd.class}) + private String mobile; + + /** + * 身份证号 + */ + @NotBlank(message = "证件号能为空", groups = {YtAdd.class}) + private String idCard; + + /** + * 是否添加到核算检测关注名单,true加入;默认false不加入 + */ + @NotNull(message = "是否添加到核算检测关注名单", groups = {YtAdd.class}) + private Boolean heSuanCheck; + /** + * 现居地编码 + */ + private String presentAddressCode; + + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + private String presentAddressPathCode; + + /** + * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 + */ + @NotBlank(message = "现居地不能为空", groups = {YtAdd.class}) + private String presentAddress; + + /** + * 详细地址 + */ + @NotBlank(message = "现居地详细地址不能为空", groups = {YtAdd.class}) + private String detailAddress; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + @NotBlank(message = "来自地区不能为空", groups = {YtAdd.class}) + private String sourceAddress; + + /** + * 到达日期 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date arriveDate; + + /** + * 备注信息 + */ + @Length(max = 500, message = "备注最多可输入500字", groups = {YtAdd.class}) + private String remark; + + /** + * userType=icresi时,必填,取值居民所属的网格ID; + * 居民端小程序上报前端赋值当前用户所在的网格id + */ + private String gridId; + + /** + * 用户id + * 居民端上报时后端自己赋值 + * pc录入如果是从居民信息选择,此列有值 + */ + private String userId; + + /** + * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import + * 居民端上报是后端赋值;导入后端赋值 + * pc录入是前端赋值 + */ + private String userType; + + /** + * userType=icresi时,必填。 + * 居民所属的组织id + */ + @NotBlank(message = "agencyId不能为空", groups = {YtAdd.class}) + private String agencyId; + + /** + * pc录入时用 + */ + private String currentStaffId; + + /** + * pc录入时用 + * 通知渠道 0小程序通知,1短信通知 + */ + private List channel = new ArrayList<>(); + /** + * pc录入时用 + * 通知内容 + */ + private String content = ""; + /** + * 核酸检测报告异常 是/否【烟台】 + */ + private String detectionAbnormal; + /** + * 两码一报告状态 (正常 异常)【烟台】 + */ + private String twoCodeOneReportStatus; + /** + * 申报状态( 0未审核 1审核通过 2无效数据)【烟台】 + */ + private String declarationStatus; + /** + * 是否有外地旅居史 是/否【烟台】 + */ + private String nonlocalResidenceHistory; + /** + * 途经省【烟台】 + */ + private String viaProvince; + /** + * 途经市【烟台】 + */ + private String viaCity; + /** + * 途经县区【烟台】 + */ + private String viaCounty; + /** + * 编码【烟台】 + */ + private String viaCode; + /** + * 编码全路径【烟台】 + */ + private String viaPathCode; + /** + * 同行人员【烟台】 + */ + private String travelPersonnel; + /** + * 户籍地【烟台】 + */ + private String registeredResidenceCity; + /** + * 户籍地详细【烟台】 + */ + private String registeredResidenceAddress; + /** + * 编码【烟台】 + */ + private String registeredResidenceCode; + /** + * 编码全路径【烟台】 + */ + private String registeredResidencePathCode; + /** + * 是否带车 是/否 【烟台】 + */ + private String carryVehicle; + /** + * 带车车牌号【烟台】 + */ + private String carryVehicleNumber; + /** + * 车牌颜色【烟台】 + */ + private String carryVehicleNumberColor; + /** + * 目的地交通场站【烟台】 + */ + private String destinationStation; + /** + * 入鲁时间【烟台】 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date arriveLuTime; + /** + * 行程码【烟台】 + */ + private String travelCodeImg; + /** + * 无效时间【烟台】 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date invalidTime; + /** + * 证件类型【烟台】 + */ + private String cardType; + /** + * 区域【烟台】 + */ + private String area; + /** + * 年龄【烟台】 + */ + private int age; + /** + * 性别【烟台】 + */ + private String sex; + /** + * 是否有新冠肺炎病史 是/否 【烟台】 + */ + private String covidFlag; + /** + * 来烟方式【烟台】 + */ + @NotBlank(message = "返回方式不能为空", groups = {YtAdd.class}) + private String comeMode; + /** + * 班次【烟台】 + */ + private String shift; + /** + * 抵烟时间【烟台】 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date arriveTime; + /** + * 上报街道【烟台】 + */ + private String reportStreet; + /** + * 来源地区全【烟台】 + */ + private String comeAreaFull; + /** + * 离开风险区域的时间【烟台】 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date leaveTheRiskAreaTime; + /** + * 是否携带48小时核算证明 是/否【烟台】 + */ + private String carryHesuanProof; + /** + * 省【烟台】 + */ + private String provinceName; + /** + * 市【烟台】 + */ + private String cityName; + /** + * 县【烟台】 + */ + private String countyName; + /** + * 详细地址【烟台】 + */ + private String twonName; + /** + * 健康码异常 是/否【烟台】 + */ + private String healthCodeAbnormal; + /** + * 行程码异常 是/否【烟台】 + */ + private String travelCodeAbnormal; + /** + * 【烟台】 + */ + private String iId; + /** + * 【烟台】 + */ + private String iDate; + /** + * 【烟台】 + */ + private String iType; + /** + * 【烟台】 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date iTime; + /** + * 【烟台】 + */ + private String iFlag; + +} 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 039b433416..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 @@ -42,4 +42,14 @@ public class RentTenantFormDTO implements Serializable { */ private IcResiUserDTO user; + // 合同相关 + /** + * 合同开始日期 + */ + private String startDate; + + /** + * 合同结束日期 + */ + private String endDate; } 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/GovWebOperLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java index dc08614749..427f75cba5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java @@ -13,4 +13,8 @@ public class GovWebOperLoginResultDTO implements Serializable { private static final long serialVersionUID = -5353521601282463394L; private String userId; private String passWord; + /** + * 未禁用enable,已禁用diabled + */ + private String enableFlag; } 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/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 7478f35723..24113d19ec 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 @@ -898,10 +951,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(); @@ -955,7 +1014,22 @@ 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); + /** + * 清楚核酸检测记录(只保留近n天) + * @author wxz + * @date 2022/11/28 下午5:36 + * * @param map 接受json反序列化,简单传递参数,避免定义过多dto + * k:retentionDays v:保留最近多少天(Integer) + * * @return Result + */ + @PostMapping("/epmetuser/icNat/clearNatRecords") + Result clearNatRecords(@RequestBody Map map); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index f025cede1b..7bf03f5969 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -751,4 +751,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> renHuCondition(RHZKStatisticsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "renHuCondition", formDTO); } + + @Override + public Result clearNatRecords(Map map) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "clearNatRecords", map); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/EpidemicConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/EpidemicConstant.java index 3b843838e4..49da3ee0b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/EpidemicConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/EpidemicConstant.java @@ -18,9 +18,11 @@ public interface EpidemicConstant { * ic_sync_job 任务类型 * 核酸检测 * 疫苗接种 + * 行程上报 */ String JOB_TYPE_NAT = "nat"; String JOB_TYPE_VACCINE = "vaccine"; + String JOB_TYPE_TRIP_REPORT = "trip_report"; // 居民信息对比 String JOB_TYPE_COMPARISON_RESI = "comparison_resi"; 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 c1cac171ec..671c4c8681 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 @@ -1,8 +1,13 @@ package com.epmet.controller; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; +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.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -10,14 +15,23 @@ 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.constants.ImportTaskConstants; import com.epmet.dto.ChangeWelfareDTO; import com.epmet.dto.CheckWelfareByIdCardDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.ChangeWelfareExcel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.ChangeWelfareService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FilenameUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,11 +44,15 @@ import java.util.Map; */ @RestController @RequestMapping("changeWelfare") +@Slf4j public class ChangeWelfareController { @Autowired private ChangeWelfareService changeWelfareService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @RequestMapping("page") @MaskResponse(fieldNames = {"mobile", "idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) public Result> page(@RequestParam Map params){ @@ -109,4 +127,56 @@ public class ChangeWelfareController { return changeWelfareService.checkWelfareByIdCard(dto); } + /** + * Desc: 【福利人员】导入 + * @param + * @author wgf + * @date 2022/11/28 13:40 + */ + @PostMapping("pointImport") + public Result pointImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){ + if (file.isEmpty()) { + throw new EpmetException("请上传文件"); + } + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new EpmetException("文件类型不匹配"); + } + + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOriginFileName(file.getOriginalFilename()); + importTaskForm.setOperatorId(tokenDto.getUserId()); + importTaskForm.setBizType(ImportTaskConstants.IC_POINT_NUCLEIC_MONITORING); + Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm); + if (!result.success()) { + throw new EpmetException(9999,"存在进行中的导入"); + } + InputStream inputStream = null; + try { + inputStream = file.getInputStream(); + }catch (Exception e){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(tokenDto.getUserId()); + input.setTaskId(result.getData().getTaskId()); + input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + commonServiceOpenFeignClient.finishImportTask(input); + log.error("读取文件失败"); + } + changeWelfareService.importFile(tokenDto,inputStream,result.getData().getTaskId()); + return new Result(); + } + + + /** + * 导出模板 + * @param response + * @throws Exception + */ + @PostMapping("exporttemplate") + public void exportTemplate( HttpServletResponse response) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams("excel/pli_change_welfare.xlsx"); + ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"福利人员模板",response); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 8bea2e4fbf..45e9b098e7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -19,8 +19,6 @@ package com.epmet.controller; import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -564,8 +562,9 @@ public class CustomerStaffController { * @author sun */ @PostMapping("enablestaff") - @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) + // @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) public Result enableStaff(@LoginUser TokenDto tokenDto, @RequestBody EnableStaffFormDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { throw new RenException("工作人员自己不能解禁自己"); } 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 2ea3ea881b..512a43f7e9 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 @@ -45,6 +45,7 @@ import java.io.InputStream; import java.net.URLEncoder; import java.nio.file.Path; import java.util.List; +import java.util.Map; import java.util.UUID; @@ -329,4 +330,25 @@ public class IcNatController implements ResultDataResolver { return new Result(); } + /** + * 清楚核酸检测记录(只保留近n天) + * @author wxz + * @date 2022/11/28 下午5:36 + * * @param map 接受json反序列化,简单传递参数,避免定义过多dto + * k:retentionDays v:保留最近多少天(Integer) + * * @return Result + */ + @PostMapping("clearNatRecords") + public Result clearNatRecords(@RequestBody Map map) { + // 保留天数 + Integer retentionDays = (Integer) map.get("retentionDays"); + + // 如果是非正数直接不做任何操作 + if (retentionDays != null && retentionDays > 0) { + icNucleinService.clearNatRecords(retentionDays); + } + + return new Result(); + } + } 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 0e149ed9df..83b232bec7 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 @@ -30,6 +30,7 @@ import com.epmet.dto.result.EmphasisTripPieDetailResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcPsTripReportRecordExportExcel; import com.epmet.excel.IcTripReportRecordExportExcel; +import com.epmet.excel.IcYtTripReportRecordExportExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcTripReportRecordService; import lombok.extern.slf4j.Slf4j; @@ -494,4 +495,96 @@ public class IcTripReportRecordController implements ResultDataResolver { return new Result>().ok(icTripReportRecordService.emphasisTripPieDetail(formDTO)); } + /** + * pc: 行程上报-列表--烟台 + */ + @PostMapping("yt-page") + @MaskResponse(fieldNames = {"mobile", "idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) + public Result> ytPage(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(PageFormDTO.AddUserInternalGroup.class); + PageData page = icTripReportRecordService.ytPage(formDTO); + return new Result>().ok(page); + } + + /** + * 查看详情--烟台 + */ + @MaskResponse(fieldNames = {"showMobile", "showIdCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD}) + @PostMapping("yt-detail") + public Result ytDetail(@LoginUser TokenDto tokenDto, @RequestBody IcTripReportRecordDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcTripReportRecordDTO.DetailViewGroup.class); + PageTripReportFormDTO pageTripReportFormDTO = new PageTripReportFormDTO(); + pageTripReportFormDTO.setCustomerId(tokenDto.getCustomerId()); + pageTripReportFormDTO.setUserId(tokenDto.getUserId()); + pageTripReportFormDTO.setId(formDTO.getId()); + return new Result().ok(icTripReportRecordService.ytDetail(pageTripReportFormDTO)); + } + + /** + * pc: 行程上报-新增--烟台 + * + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("yt-save") + public Result ytSave(@LoginUser TokenDto tokenDto, @RequestBody IcYtTripReportFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + String id = icTripReportRecordService.ytSave(formDTO); + return new Result().ok(id); + } + + /** + * pc: 行程上报-修改--烟台 + * + * @param formDTO + * @return + */ + @NoRepeatSubmit + @PostMapping("yt-update") + public Result ytUpdate(@LoginUser TokenDto tokenDto, @RequestBody IcYtTripReportFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentStaffId(tokenDto.getUserId()); + return new Result().ok(icTripReportRecordService.ytUpdate(formDTO)); + } + + /** + * pc:行程上报-导出--烟台 + */ + @NoRepeatSubmit + @PostMapping("yt-export") + public void ytEexport(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + 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), IcYtTripReportRecordExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = icTripReportRecordService.ytPage(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcYtTripReportRecordExportExcel.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 { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java index c7f64d3231..14cc96ce66 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ChangeWelfareDao.java @@ -45,4 +45,6 @@ public interface ChangeWelfareDao extends BaseDao { * @return com.epmet.commons.tools.utils.Result */ void removeWelfare(ChangeWelfareDTO dto); + + List getAllWelfareIdCard(@Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 7b8b0a0ab7..ba20fdcc8b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -12,6 +12,7 @@ import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; /** @@ -86,4 +87,6 @@ public interface IcNatDao extends BaseDao { * @Date 2022/10/25 11:13 */ void updateRelationOther(); + + void deleteNatRecordsBeforeRetentionDays(Date criticleTime); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java index 0b37f87121..aa9395f9cc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java @@ -5,6 +5,8 @@ import com.epmet.entity.IcNatRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.Date; + /** * 核酸记录关系表 * @@ -19,4 +21,6 @@ public interface IcNatRelationDao extends BaseDao { * @Description 关系数据删除--物理删除 **/ int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId); + + void deleteBeforeRetentionDays(Date criticleTime); } \ No newline at end of file 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 new file mode 100644 index 0000000000..0d4b03fe38 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java @@ -0,0 +1,19 @@ +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; + +/** + * 居民租房信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-25 + */ +@Mapper +public interface IcResiRentContractInfoDao extends BaseDao { + + IcResiRentContractInfoEntity selectDetailByUserId(@Param("userId") String userId); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 23830a2e4c..e6845fefd3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -444,4 +444,7 @@ public interface IcResiUserDao extends BaseDao { List getResiUserList(ComparisonFormDTO formDTO); List getUserByRenHu(RHZKStatisticsFormDTO formDTO); + + List getImportUserList(@Param("customerId")String customerId,@Param("agencyId")String agencyId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java index a8dfd6bee2..403ea9d1a8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java @@ -16,6 +16,8 @@ import java.util.List; @Mapper public interface IcSyncJobDao extends BaseDao { - List selectExecutableJobList(@Param("jobType") String jobType, - @Param("itemCount") int itemCount); + List selectJobListByStatus(@Param("status") String status, + @Param("jobType") String jobType, + @Param("processorIp") String processorIp, + @Param("itemCount") Integer itemCount); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java index fc7a3ce96e..d22249c42f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java @@ -63,4 +63,20 @@ public interface IcTripReportRecordDao extends BaseDao */ List emphasisTripPieDetail(EmphasisTripPieDetailFormDTO formDTO); + /** + * @Description 根据身份证查询存在的行程上报记录ID + * @param idCards + * @Author zxc + * @Date 2022/11/22 16:16 + */ + List getExistsTripReport(@Param("idCards")List idCards); + + /** + * @Description 批量更新行程上报 + * @param list + * @Author zxc + * @Date 2022/11/22 16:54 + */ + void updateTripReportList(@Param("list")List list); + } \ No newline at end of file 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..a479866fea 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 @@ -87,4 +87,8 @@ 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); + } 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/entity/IcResiRentContractInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiRentContractInfoEntity.java new file mode 100644 index 0000000000..fa0b52fd48 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiRentContractInfoEntity.java @@ -0,0 +1,41 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民租房信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-11-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_rent_contract_info") +public class IcResiRentContractInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 主表Id + */ + private String icResiUser; + + /** + * 合同开始日期 + */ + private String contractStartDate; + + /** + * 合同结束日期 + */ + private String contractEndDate; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java index 0a83b7aa56..e162ceeb4b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java @@ -56,4 +56,13 @@ public class IcSyncJobEntity extends BaseEpmetEntity { */ private String operationStatus; + /** + * 处理实例的ip + * @author wxz + * @date 2022/11/19 下午11:02 + * * @param null + * + */ + private String processorIp; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java index 3ab91a19b5..d7eb3e7e9a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java @@ -180,4 +180,185 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity { */ private String tripDataType; + /** + * 核酸检测报告异常 是/否【烟台】 + */ + private String detectionAbnormal; + /** + * 两码一报告状态 (正常 异常)【烟台】 + */ + private String twoCodeOneReportStatus; + /** + * 申报状态( 0未审核 1审核通过 2无效数据)【烟台】 + */ + private String declarationStatus; + /** + * 是否有外地旅居史 是/否【烟台】 + */ + private String nonlocalResidenceHistory; + /** + * 途经省【烟台】 + */ + private String viaProvince; + /** + * 途经市【烟台】 + */ + private String viaCity; + /** + * 途经县区【烟台】 + */ + private String viaCounty; + /** + * 编码【烟台】 + */ + private String viaCode; + /** + * 编码全路径【烟台】 + */ + private String viaPathCode; + /** + * 同行人员【烟台】 + */ + private String travelPersonnel; + /** + * 户籍地【烟台】 + */ + private String registeredResidenceCity; + /** + * 户籍地详细【烟台】 + */ + private String registeredResidenceAddress; + /** + * 编码【烟台】 + */ + private String registeredResidenceCode; + /** + * 编码全路径【烟台】 + */ + private String registeredResidencePathCode; + /** + * 是否带车 是/否 【烟台】 + */ + private String carryVehicle; + /** + * 带车车牌号【烟台】 + */ + private String carryVehicleNumber; + /** + * 车牌颜色【烟台】 + */ + private String carryVehicleNumberColor; + /** + * 目的地交通场站【烟台】 + */ + private String destinationStation; + /** + * 入鲁时间【烟台】 + */ + private Date arriveLuTime; + /** + * 行程码【烟台】 + */ + private String travelCodeImg; + /** + * 无效时间【烟台】 + */ + private Date invalidTime; + /** + * 证件类型【烟台】 + */ + private String cardType; + /** + * 区域【烟台】 + */ + private String area; + /** + * 年龄【烟台】 + */ + private int age; + /** + * 性别【烟台】 + */ + private String sex; + /** + * 是否有新冠肺炎病史 是/否 【烟台】 + */ + private String covidFlag; + /** + * 来烟方式【烟台】 + */ + private String comeMode; + /** + * 班次【烟台】 + */ + private String shift; + /** + * 抵烟时间【烟台】 + */ + private Date arriveTime; + /** + * 上报街道【烟台】 + */ + private String reportStreet; + /** + * 来源地区 全【烟台】 + */ + private String comeAreaFull; + /** + * 离开风险区域的时间【烟台】 + */ + private Date leaveTheRiskAreaTime; + /** + * 是否携带48小时核算证明 是/否【烟台】 + */ + private String carryHesuanProof; + /** + * 省【烟台】 + */ + private String provinceName; + /** + * 市【烟台】 + */ + private String cityName; + /** + * 县【烟台】 + */ + private String countyName; + /** + * 详细地址【烟台】 + */ + private String twonName; + /** + * 健康码异常 是/否【烟台】 + */ + private String healthCodeAbnormal; + /** + * 行程码异常 是/否【烟台】 + */ + private String travelCodeAbnormal; + /** + * 【烟台】 + */ + private String iId; + /** + * 【烟台】 + */ + private String iDate; + /** + * 【烟台】 + */ + private String iType; + /** + * 【烟台】 + */ + private Date iTime; + /** + * 【烟台】 + */ + private String iFlag; + /** + * 烟台数据主键【烟台】 + */ + private String ytId; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java index c921136c00..bfd81f56b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/enums/IcResiUserTableEnum.java @@ -22,6 +22,8 @@ public enum IcResiUserTableEnum { IC_VOLUNTEER("ic_volunteer","志愿者信息录入表", 6, 3, "IS_VOLUNTEER", true), IC_OLD_PEOPLE("ic_old_people","老年人信息录入表", 7, 2, "IS_OLD_PEOPLE", true), IC_SPECIAL("ic_special","特殊人群信息录入表", 8, 3, "IS_SPECIAL", true), + IC_TENANT("ic_resi_rent_contract_info","租户信息录入表", null, 2, "IS_TENANT", true), + // 下面的是:没有实际数据库表,在ic_resi_user中有一个标记,但是导入的时候是有单独的sheet的 IC_DBH("virtual_dbh","低保人员信息录入表", null, 2, "IS_DBH", false), @@ -34,7 +36,6 @@ public enum IcResiUserTableEnum { IC_CJ("virtual_cj","残疾人员信息录入表", null, 2, "IS_CJ", false), IC_DB("virtual_db","大病人员信息录入表", null, 2, "IS_DB", false), IC_MB("virtual_mb","慢病人员信息录入表", null, 2, "IS_MB", false), - IC_TENANT("virtual_tenant","租户信息录入表", null, 2, "IS_TENANT", false), IC_FLOATING("virtual_floating","流动人口信息录入表", null, 2, "IS_FLOATING", false), IC_XJC("virtual_xjc","新阶层人士信息录入表", null, 2, "IS_XJC", false); 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 new file mode 100644 index 0000000000..992be96b4a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ChangeWelfareImportExcel.java @@ -0,0 +1,63 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; +import lombok.Data; + +/** + * 福利表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Data +public class ChangeWelfareImportExcel { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "证件号") + private String idCard; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别",replace = { "男_1", "女_0", " _null"} ) + private String gender; + +// @Excel(name = "类型") +// private String type; + + @Excel(name = "福利原因") + private String joinReason; + +// @Excel(name = "客户ID") +// private String customerId; + + @ExcelIgnore + private Boolean addStatus = false; + + @ExcelIgnore + private Integer num; + + + /** + * 加入时间 + */ + @ExcelIgnore + private String joinDate; + + /** + * epmet用户主键 + */ + @ExcelIgnore + private String userId; + + /** + * epmet网格ID + */ + @ExcelIgnore + private String gridId; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcYtTripReportRecordExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcYtTripReportRecordExportExcel.java new file mode 100644 index 0000000000..5cd24b489d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcYtTripReportRecordExportExcel.java @@ -0,0 +1,196 @@ +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.HeadStyle; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + + +/** + * 烟台-行程上报信息-导出 + * + */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) +@Data +public class IcYtTripReportRecordExportExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + @ColumnWidth(12) + @ExcelProperty(value = "姓名") + private String name; + /** + * 证件号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "证件号") + private String idCard; + /** + * 手机号 + */ + @ColumnWidth(15) + @ExcelProperty(value = "手机号") + private String mobile; + /** + * 现居地 + */ + @ColumnWidth(20) + @ExcelProperty(value = "现居地") + private String presentAddress; + /** + * 现居地详细地址 + */ + @ColumnWidth(30) + @ExcelProperty(value = "现居地详细地址") + private String detailAddress; + /** + * 来自地区 + */ + @ColumnWidth(30) + @ExcelProperty(value = "来自地区") + private String sourceAddress; + /** + * 来自地区详细地址 + */ + @ColumnWidth(30) + @ExcelProperty(value = "来自地区详细地址") + private String comeAreaFull; + /** + * 来到本地时间 + */ + @ColumnWidth(20) + @ExcelProperty(value = "来到本地时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private String arriveTime; + + /** + * 返回方式 + */ + @ColumnWidth(15) + @ExcelProperty(value = "返回方式") + private String comeMode; + /** + * 班次 + */ + @ColumnWidth(15) + @ExcelProperty(value = "班次") + private String shift; + /** + * 48小时核酸检测 + */ + @ColumnWidth(20) + @ExcelProperty(value = "48小时核酸检测") + private String carryHesuanProof; + /** + * 健康码异常 + */ + @ColumnWidth(15) + @ExcelProperty(value = "健康码异常") + private String healthCodeAbnormal; + /** + * 行程码异常 + */ + @ColumnWidth(15) + @ExcelProperty(value = "行程码异常") + private String travelCodeAbnormal; + /** + * 核酸检测报告异常 + */ + @ColumnWidth(20) + @ExcelProperty(value = "核酸检测报告异常") + private String detectionAbnormal; + /** + * 两码一报告状态 + */ + @ColumnWidth(20) + @ExcelProperty(value = "两码一报告状态") + private String twoCodeOneReportStatus; + /** + * 是否有外地旅居史 + */ + @ColumnWidth(20) + @ExcelProperty(value = "是否有外地旅居史") + private String nonlocalResidenceHistory; + /** + * 途径地区 + */ + @ColumnWidth(30) + @ExcelProperty(value = "途径地区") + private String via; + /** + * 同行人 + */ + @ColumnWidth(15) + @ExcelProperty(value = "同行人") + private String travelPersonnel; + /** + * 户籍地 + */ + @ColumnWidth(20) + @ExcelProperty(value = "户籍地") + private String registeredResidenceCity; + /** + * 户籍详细地址 + */ + @ColumnWidth(30) + @ExcelProperty(value = "户籍详细地址") + private String registeredResidenceAddress; + /** + * 是否带车 + */ + @ColumnWidth(15) + @ExcelProperty(value = "是否带车") + private String carryVehicle; + /** + * 带车车牌号 + */ + @ColumnWidth(20) + @ExcelProperty(value = "带车车牌号") + private String carryVehicleNumber; + /** + * 车辆颜色 + */ + @ColumnWidth(15) + @ExcelProperty(value = "车辆颜色") + private String carryVehicleNumberColor; + /** + * 目的地交通场站 + */ + @ColumnWidth(25) + @ExcelProperty(value = "目的地交通场站") + private String destinationStation; + /** + * 入鲁时间 + */ + @ColumnWidth(20) + @ExcelProperty(value = "入鲁时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private String arriveLuTime; + /** + * 行程码 + */ + @ColumnWidth(30) + @ExcelProperty(value = "行程码") + private String travelCodeImg; + /** + * 离开本地时间 + */ + @ColumnWidth(20) + @ExcelProperty(value = "离开本地时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private String leaveTheRiskAreaTime; + /** + * 备注 + */ + @ColumnWidth(30) + @ExcelProperty(value = "备注") + private String remark; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatCompareRecordExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatCompareRecordExcelData.java index 0a1e02cbf7..3c0826f90c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatCompareRecordExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatCompareRecordExcelData.java @@ -3,6 +3,7 @@ package com.epmet.excel.data; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; @@ -22,6 +23,7 @@ public class IcNatCompareRecordExcelData { private String idCard; @NotBlank(message = "联系方式为必填项") + @Length(max = 32, message = "联系方式格式错误") @ExcelProperty("联系方式") private String mobile; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/ChangeWelfareErrorExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/ChangeWelfareErrorExcel.java new file mode 100644 index 0000000000..edadf94704 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/ChangeWelfareErrorExcel.java @@ -0,0 +1,35 @@ +package com.epmet.excel.error; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; +import lombok.Data; + +/** + * 福利表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Data +public class ChangeWelfareErrorExcel { + + @Excel(name = "行号",width = 10) + private Integer num; + + @Excel(name = "姓名",width = 30) + private String name; + + @Excel(name = "证件号",width = 30) + private String idCard; + + @Excel(name = "手机号",width = 20) + private String mobile; + + @Excel(name = "福利原因",width = 40) + private String joinReason; + + @Excel(name = "错误信息", width = 200) + private String errorMsg; + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java new file mode 100644 index 0000000000..2f3062448b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java @@ -0,0 +1,215 @@ +package com.epmet.processor; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.constant.EpidemicConstant; +import com.epmet.dao.IcSyncJobDao; +import com.epmet.entity.IcSyncJobEntity; +import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RLock; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @ClassName BaseSyncProcessor + * @Description 抽象数据同步处理器基类。所有基于该模式的同步器都应当继承该类。自定义Scheduler之后,调用基类的scanAndExeJobs()方法。 + * 实现需要实现的方法(定义分布式锁的key,定义同步数据的类型)。有特殊逻辑的可以重写相关方法 + * @Author wangxianzhang + * @Date 2022/11/19 下午11:16 + */ +@Slf4j +public abstract class AbstractDataSyncJobProcessor { + + @Autowired + private ExecutorService executorService; + + @Autowired + private IcSyncJobDao icSyncJobDao; + + @Autowired + private DistributedLock distributedLock; + + /** + * 最多能运行几条线程。如果有特殊情况,可以通过抽象方法每个子类单独定义 + */ + private int MAX_EXECUTING_NUMBER = 3; + + /** + * 本机ip + */ + private String localIp; + + { + try { + // 获取本机ip + InetAddress localHost = Inet4Address.getLocalHost(); + localIp = localHost.getHostAddress(); + log.info("【抽象定时数据同步器】获取本机ip为:{}", localIp); + } catch (UnknownHostException e) { + log.error("【抽象定时数据同步器】获取本机ip失败"); + } + + } + + /** + * 扫描并执行 + * @author wxz + * @date 2022/11/20 上午12:10 + * + * + */ + void scanAndExecWaitingJobs() { + + int executingTaskNumber = getExecutingTaskNumber(); + if (executingTaskNumber >= MAX_EXECUTING_NUMBER) { + // 单个实例下,最多只允许同时3条线程运行 + return; + } + + // 还可以运行几条线程 + int leftCount = MAX_EXECUTING_NUMBER - executingTaskNumber; + RLock lock = null; + try { + lock = distributedLock.getLock(getDistributeLockKey(), getDistributeLockLeaseTime(), getDistributeLockWaitTime(), TimeUnit.SECONDS); + if (lock == null) { + log.warn("【异步数据更新】{}获取锁为空", getJobType()); + return; + } + // 查询可执行的任务列表,并且异步执行 + List icSyncJobToExec = icSyncJobDao.selectJobListByStatus("waiting", getJobType(), null, leftCount); + if (!CollectionUtils.isEmpty(icSyncJobToExec)) { + // 异步提交任务 + submitAsyncJob(icSyncJobToExec); + } + } catch (Exception e) { + log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } finally { + distributedLock.unLock(lock); + } + } + + /** + * 扫描并且执行被中断的任务 + * @author wxz + * @date 2022/11/20 下午10:29 + * + * + */ + @PostConstruct + void scanAndContinueInteruptedJobs() { + // 此处不需要加锁,因为已经按照ip查询了,查到的一定是本机之前执行过的,其他机器查不到该条 + List interuptedJobs = icSyncJobDao.selectJobListByStatus("processing", getJobType(), localIp,null); + if (!CollectionUtils.isEmpty(interuptedJobs)) { + submitAsyncJob(interuptedJobs); + } + } + + /** + * 提交异步任务 + * @author wxz + * @date 2022/11/20 下午10:37 + * * @param icSyncJobToExec + * + */ + void submitAsyncJob(List icSyncJobToExec) { + for (IcSyncJobEntity jobEntity : icSyncJobToExec) { + // 将此任务状态修改为执行中 + updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING, localIp); + executorService.submit(() -> { + try { + execJobTask(jobEntity); + } finally { + // 更新任务状态为结束 + updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH, null); + } + }); + } + } + + /** + * 先检查一下,有几个任务需要执行 + * @author wxz + * @date 2022/11/19 下午10:57 + * @return int + */ + private int getExecutingTaskNumber() { + // 查询本机正在处理中的任务列表 + LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); + executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); + executingListQuery.eq(IcSyncJobEntity::getProcessorIp, localIp); + return icSyncJobDao.selectCount(executingListQuery); + } + + /** + * 更新任务状态 + * @author wxz + * @date 2022/11/8 下午8:25 + * @param id + * @param status + + */ + private void updateJobStatus(String id, String status, String processorIp) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcSyncJobEntity::getId, id); + + IcSyncJobEntity updateEntity = new IcSyncJobEntity(); + updateEntity.setOperationStatus(status); + updateEntity.setProcessorIp(processorIp); + icSyncJobDao.update(updateEntity, query); + } + + /** + * 执行任务 + * @author wxz + * @date 2022/11/20 上午12:06 + * + * + */ + protected abstract void execJobTask(IcSyncJobEntity jobEntity); + + /** + * 获取分布式锁的key + * @author wxz + * @date 2022/11/20 上午12:21 + * + * + */ + protected abstract String getDistributeLockKey(); + + /** + * 任务类型 + * @author wxz + * @date 2022/11/20 上午12:25 + * + * * @return String + */ + protected abstract String getJobType(); + + /** + * 分布式锁的续期时间 + * @author wxz + * @date 2022/11/20 下午10:52 + * + * * @return long + */ + protected abstract long getDistributeLockLeaseTime(); + + /** + * 分布式锁的等待时间 + * @author wxz + * @date 2022/11/20 下午10:52 + * + * * @return long + */ + protected abstract long getDistributeLockWaitTime(); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java index 1fbfb6a69f..e7069da1eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java @@ -1,49 +1,27 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.DataSyncConfigService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; import static com.epmet.constant.EpidemicConstant.JOB_TYPE_NAT; -// 烟台核酸检测数据同步处理器 -@Component +/** + * @Description 烟台核酸检测数据同步处理器 + * @Author wxz + * @Date 2022/11/20 上午11:43 + */ +//@Component @Slf4j -public class YanTaiNatSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiNatSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private DataSyncConfigService dataSyncConfigService; - @Autowired - private DistributedLock distributedLock; - - @Autowired - RedisUtils redisUtils; - /** * 定时扫描和执行同步任务 * 10s扫一次库 @@ -53,76 +31,31 @@ public class YanTaiNatSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - //log.info("【异步数据更新】开始同步任务"); - - //String dataSyncEnable = redisUtils.getString("data:sync:enable"); - //if (StringUtils.isEmpty(dataSyncEnable)) { - // return; - //} - - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:" + JOB_TYPE_NAT, 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_NAT, - leftCount); - - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - - try { - dataSyncConfigService.execSyncByJobProcessor(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } + scanAndExecWaitingJobs(); + } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + dataSyncConfigService.execSyncByJobProcessor(jobEntity); } - /** - * 更新任务状态 - * @author wxz - * @date 2022/11/8 下午8:25 - * @param id - * @param status + @Override + protected String getDistributeLockKey() { + return "data:sync:" + JOB_TYPE_NAT; + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_NAT; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 5; } + @Override + protected long getDistributeLockWaitTime() { + return 6; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java index 8e57474606..abdc0d3f35 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java @@ -1,47 +1,26 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.IcResiComparisonRecordService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; /** * @Description 居民一致性对比任务处理器 * @Author wxz * @Date 2022/11/15 下午5:54 */ -@Component +//@Component @Slf4j -public class YanTaiResiComparisonSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiResiComparisonSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private IcResiComparisonRecordService icResiComparisonRecordService; - @Autowired - private DistributedLock distributedLock; - @Autowired RedisUtils redisUtils; @@ -51,69 +30,31 @@ public class YanTaiResiComparisonSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - //log.info("【异步数据更新】开始同步任务"); - - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:comparison:resi", 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_COMPARISON_RESI, - leftCount); - - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - - try { - icResiComparisonRecordService.comparisonUserData(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } + scanAndExecWaitingJobs(); + } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + icResiComparisonRecordService.comparisonUserData(jobEntity); } - /** - * 更新任务状态 - * @param id - * @param status + @Override + protected String getDistributeLockKey() { + return "data:sync:comparison:resi"; + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_COMPARISON_RESI; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 5; } + @Override + protected long getDistributeLockWaitTime() { + return 6; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java new file mode 100644 index 0000000000..6b1d4a028d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java @@ -0,0 +1,60 @@ +package com.epmet.processor; + +import com.epmet.constant.EpidemicConstant; +import com.epmet.entity.IcSyncJobEntity; +import com.epmet.service.DataSyncConfigService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import static com.epmet.constant.EpidemicConstant.JOB_TYPE_TRIP_REPORT; +import static com.epmet.constant.EpidemicConstant.JOB_TYPE_VACCINE; + +/** + * @Description 烟台行程上报数据同步处理器 + * @Author zxc + * @Date 2022/11/22 14:08 + */ +@Component +@Slf4j +public class YanTaiTripReportSyncProcessor extends AbstractDataSyncJobProcessor { + + @Autowired + private DataSyncConfigService dataSyncConfigService; + + /** + * @Description 定时扫描和执行同步任务【行程上报】 + * @Author zxc + * @Date 2022/11/11 10:32 + */ + @Scheduled(cron = "0/10 * * * * ? ") + public void scanJobs() { + scanAndExecWaitingJobs(); + } + + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + dataSyncConfigService.execSyncByJobProcessor(jobEntity); + } + + @Override + protected String getDistributeLockKey() { + return "data:sync:" + JOB_TYPE_TRIP_REPORT; + } + + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_TRIP_REPORT; + } + + @Override + protected long getDistributeLockLeaseTime() { + return 5; + } + + @Override + protected long getDistributeLockWaitTime() { + return 6; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java index e53a279a46..77fadd9149 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java @@ -1,49 +1,27 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.DataSyncConfigService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; - -import static com.epmet.constant.EpidemicConstant.JOB_TYPE_NAT; import static com.epmet.constant.EpidemicConstant.JOB_TYPE_VACCINE; -// 烟台核酸检测数据同步处理器 -@Component +/** + * @Description 烟台核酸检测数据同步处理器 + * @Author wxz + * @Date 2022/11/20 上午11:55 + */ +//@Component @Slf4j -public class YanTaiVaccineSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiVaccineSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private DataSyncConfigService dataSyncConfigService; - @Autowired - private DistributedLock distributedLock; - - @Autowired - RedisUtils redisUtils; - /** * @Description 定时扫描和执行同步任务【疫苗接种】 * @Author zxc @@ -51,62 +29,31 @@ public class YanTaiVaccineSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:" + JOB_TYPE_VACCINE, 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_VACCINE, - leftCount); - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - try { - dataSyncConfigService.execSyncByJobProcessor(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + scanAndExecWaitingJobs(); } - /** - * 更新任务状态 - * @author wxz - * @date 2022/11/8 下午8:25 - * @param id - * @param status + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + dataSyncConfigService.execSyncByJobProcessor(jobEntity); + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getDistributeLockKey() { + return "data:sync:" + JOB_TYPE_VACCINE; + } + + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_VACCINE; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 5; } + @Override + protected long getDistributeLockWaitTime() { + return 6; + } } 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 ab13abb470..184cfd9c9a 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 @@ -2,11 +2,13 @@ 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.commons.tools.utils.Result; import com.epmet.dto.ChangeWelfareDTO; import com.epmet.dto.CheckWelfareByIdCardDTO; import com.epmet.entity.ChangeWelfareEntity; +import java.io.InputStream; import java.util.List; import java.util.Map; @@ -104,4 +106,13 @@ public interface ChangeWelfareService extends BaseService { * @return com.epmet.commons.tools.utils.Result */ Result saveWelfareInfo(ChangeWelfareDTO dto); + + /** + * Desc: 【福利人员】导入 + * @param tokenDto + * @param inputStream + * @author wgf + * @date 2022/11/28 15:35 + */ + void importFile(TokenDto tokenDto, InputStream inputStream, String taskId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index b9f89d921e..72c0ab6a82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -97,4 +97,12 @@ public interface IcNatService extends BaseService { void initNatLocal(); + /** + * 清理nat记录,目前不区分客户,后期需要区分可以再加 + * @author wxz + * @date 2022/11/28 下午5:39 + * * @param retentionDays 保留的天数(最近) + * + */ + void clearNatRecords(Integer retentionDays); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java index d90f8907f7..7a1d1fc607 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java @@ -10,8 +10,6 @@ import com.epmet.dto.result.EmphasisTripPieDetailResultDTO; import com.epmet.dto.result.TripListDTO; import com.epmet.entity.IcTripReportRecordEntity; -import javax.servlet.http.HttpServletResponse; -import java.io.InputStream; import java.nio.file.Path; import java.util.List; import java.util.Map; @@ -131,4 +129,12 @@ public interface IcTripReportRecordService extends BaseService emphasisTripPieDetail(EmphasisTripPieDetailFormDTO formDTO); + + PageData ytPage(PageTripReportFormDTO formDTO); + + IcTripReportRecordDTO ytDetail(PageTripReportFormDTO pageTripReportFormDTO); + + String ytSave(IcYtTripReportFormDTO formDTO); + + String ytUpdate(IcYtTripReportFormDTO formDTO); } \ No newline at end of file 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 87cf889ab7..f5808bdf3b 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 @@ -1,32 +1,67 @@ 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; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; 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.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.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.ChangeWelfareDao; +import com.epmet.dao.IcResiUserDao; import com.epmet.dto.ChangeWelfareDTO; import com.epmet.dto.CheckWelfareByIdCardDTO; +import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.IcResiUserPageFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.result.RentTenantDataResultDTO; +import com.epmet.dto.result.UploadImgResultDTO; 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 lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.fileupload.FileItem; +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.commons.CommonsMultipartFile; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 福利表 @@ -35,6 +70,7 @@ import java.util.*; * @since v1.0.0 2022-05-09 */ @Service +@Slf4j public class ChangeWelfareServiceImpl extends BaseServiceImpl implements ChangeWelfareService { @Autowired @@ -46,6 +82,18 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl page(Map params) { params.put("customerId", loginUserUtil.getLoginUserCustomerId()); @@ -163,4 +211,216 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl errorInfo = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + try { + List list = ExcelPoiUtils.importExcel(inputStream, 0,1,ChangeWelfareImportExcel.class); + if (CollectionUtils.isEmpty(list)){ + closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + return; + } + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息"+tokenDto.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到组织信息"+staffInfo.getAgencyId()); + } + // 获取所有居民信息 + IcResiUserPageFormDTO formDTO = new IcResiUserPageFormDTO(); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setListType("resi"); + formDTO.setConditions(new ArrayList<>()); + + + // 获取居民信息 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + List userList = icResiUserDao.getImportUserList(tokenDto.getCustomerId(),staffInfoCache.getAgencyId()); + // 获取证件号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")); + } + } + + + // 获取已存在福利人员(排除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); + if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "证件号不能为空",i+1)); + list.get(i).setAddStatus(true); + list.get(i).setIdCard("10110"); // 后面有逻辑用到了证件号,10110代表证件号为空 + continue; + } + // 校验是否为居民 + if (!idCardList.contains(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "身份证号为【" + list.get(i).getIdCard() + "】的居民信息未找到,请确认该居民信息存在",i+1)); + list.get(i).setAddStatus(true); + continue; + }else if(idCardList.contains(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + // 组装居民数据 + for(IcResiUserDTO icResiUserDTO : userList){ + if(list.get(i).getIdCard().equalsIgnoreCase(icResiUserDTO.getIdCard())){ + list.get(i).setGender(icResiUserDTO.getGender()); + list.get(i).setMobile(icResiUserDTO.getMobile()); + list.get(i).setName(icResiUserDTO.getName()); + list.get(i).setUserId(icResiUserDTO.getId()); + list.get(i).setGridId(icResiUserDTO.getGridId()); + break; + } + } + list.get(i).setJoinDate(sdf.format(new Date())); + } + // 校验数据库是否存在该福利人员 + if (welfareList.contains(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "该福利人员已存在",i+1)); + list.get(i).setAddStatus(true); + continue; + } + + } + if (list.size() > errorInfo.size()){ + Map groupByIdCard = list.stream().collect(Collectors.groupingBy(ChangeWelfareImportExcel::getIdCard, Collectors.counting())); + groupByIdCard.forEach((idCard,count) -> { + if (!"10110".equals(idCard) && Integer.valueOf(count.toString()).compareTo(1) != 0){ + for (ChangeWelfareImportExcel i : list) { + if (idCard.equalsIgnoreCase(i.getIdCard()) && !i.getAddStatus()){ + errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); + i.setAddStatus(true); + } + } + } + }); + } + Map> groupByStatus = list.stream().collect(Collectors.groupingBy(ChangeWelfareImportExcel::getAddStatus)); + List needInsert = groupByStatus.get(false); + if (CollectionUtils.isNotEmpty(needInsert)){ + List entities = ConvertUtils.sourceToTarget(needInsert, ChangeWelfareEntity.class); + entities.forEach(e -> { + // 设置客户ID + e.setCustomerId(tokenDto.getCustomerId()); + }); + insertBatch(entities); + } + if (CollectionUtils.isNotEmpty(errorInfo)){ + String url = importOssUpload(errorInfo, ChangeWelfareErrorExcel.class); + closeTask(taskId,tokenDto.getUserId(), ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,url); + }else { + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS,""); + } + }catch (Exception e){ + log.error(e.getMessage()); + closeTask(taskId,tokenDto.getUserId(),ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL,""); + } + } + + /** + * Desc: 关闭任务 + * @param taskId + * @param userId + * @param status + * @param url + * @author wgf + * @date 2022/11/28 09:05 + */ + public void closeTask(String taskId,String userId,String status,String url){ + ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO(); + input.setOperatorId(userId); + input.setTaskId(taskId); + input.setProcessStatus(status); + input.setResultDescFilePath(url); + commonServiceOpenFeignClient.finishImportTask(input); + } + + /** + * Desc: 构造错误信息 + * @param dto + * @param info + * @param num + * @author wgf + * @date 2022/11/28 17:17 + */ + public ChangeWelfareErrorExcel getErrorInfo(ChangeWelfareImportExcel dto, String info, Integer num){ + ChangeWelfareErrorExcel result = ConvertUtils.sourceToTarget(dto, ChangeWelfareErrorExcel.class); + result.setErrorMsg(info); + result.setNum(num); + return result; + } + + /** + * Desc: 文件上传并返回url + * @param errorRows + * @param tClass + * @author wgf + * @date 2022/11/28 17:17 + */ + public String importOssUpload(Collection errorRows, Class tClass) throws IOException { + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"), + tClass, errorRows); + + // 文件名 + String resultDescFileName = UUID.randomUUID().toString().concat(".xls"); + + 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上传结果描述文件失败"); + return null; + } + return uploadResult.getData().getUrl(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 0bcb0b5eee..1ff4560c99 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -1055,6 +1055,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl resiInfos, String customerId, String isSync){ + public void yanTaiTripReportByDbViewPartition(List resiInfos, String customerId, String isSync){ // 将居民信息转化为的map Map idCardAndResiInfoMap = resiInfos.stream().collect(Collectors.toMap(resi -> resi.getIdCard(), Function.identity())); List idCards = new ArrayList<>(idCardAndResiInfoMap.keySet()); - // 1.获取核酸采样信息 Map args = new HashMap<>(); args.put("idcards", idCards); - // todo 疫苗接种视图 String json = "[\n" + - " {\n" + - " \"id\": \"751956862490071040\",\n" + - " \"cardno\": \"370785195001012558\",\n" + - " \"name\": \"李国玺\",\n" + - " \"data\":\n" + - " {\n" + - " \"vaccineList\":\n" + - " [\n" + - " {\n" + - " \"vaccineCount\": \"1\",\n" + - " \"inoculateDate\": \"2021-04-24 16:02:46\",\n" + - " \"lastStationName\": \"烟台市只楚医院临时接种点\"\n" + - " },\n" + - " {\n" + - " \"vaccineCount\": \"2\",\n" + - " \"inoculateDate\": \"2021-06-10 16:20:30\",\n" + - " \"lastStationName\": \"烟台市芝罘岛医院临时接种点\"\n" + - " },\n" + - " {\n" + - " \"vaccineCount\": \"3\",\n" + - " \"inoculateDate\": \"2021-12-10 15:12:24\",\n" + - " \"lastStationName\": \"烟台市芝罘岛医院临时接种点\"\n" + - " }\n" + - " ],\n" + - " \"flag\": 1\n" + - " },\n" + - " \"vaccineCount\": 3\n" + + " {\"ytId\": \"10100101010\",\"travelCodeAbnormal\": \"否\",\"healthCodeAbnormal\": \"否\",\"twonName\": \"山东路\",\"countyName\": \"市北区\",\"cityName\": \"青岛市\",\"provinceName\": \"山东省\",\"carryHesuanProof\": \"是\",\"leaveTheRiskAreaTime\": \"2022-11-11 10:20:02\",\"comeAreaFull\": \"山东省青岛市市北区辽宁路街道\",\"reportStreet\": \"山东路街道\",\"arriveTime\": \"2022-11-20 11:11:11\",\"shift\": \"D909\",\"comeMode\": \"动车\",\"covidFlag\": \"1\",\"sex\": \"1\",\"age\": \"50\",\"area\": \"哈哈哈\",\"cardType\": \"身份证\",\"invalidTime\": \"2022-12-01 00:00:00\",\"travelCodeImg\": \"/aaa/aaa\",\"arriveLuTime\": \"2022-11-21 11:11:11\",\"destinationStation\": \"青岛北站\",\"carryVehicleNumberColor\": \"蓝\",\"carryVehicleNumber\": \"11111\",\"carryVehicle\": \"是\",\"registeredResidenceAddress\": \"山东青岛市北镇江路街道\",\"registeredResidenceCity\": \"山东青岛\",\"travelPersonnel\": \"无\",\"viaCounty\": \"市北区\",\"viaCity\": \"青岛市\",\"viaProvince\": \"山东省\",\"nonlocalResidenceHistory\": \"否\",\"declarationStatus\": \"1\",\"twoCodeOneReportStatus\": \"正常\",\"detectionAbnormal\": \"否\",\"detailAddress\": \"山东路163号\",\"idCard\": \"370785195001012558\"\n" + + " },\n" + + " {\"ytId\": \"02020191919\",\"travelCodeAbnormal\": \"否\",\"healthCodeAbnormal\": \"否\",\"twonName\": \"山东路\",\"countyName\": \"市北区\",\"cityName\": \"青岛市\",\"provinceName\": \"山东省\",\"carryHesuanProof\": \"是\",\"leaveTheRiskAreaTime\": \"2022-11-11 10:20:02\",\"comeAreaFull\": \"山东省青岛市市北区辽宁路街道\",\"reportStreet\": \"山东路街道\",\"arriveTime\": \"2022-11-20 11:11:11\",\"shift\": \"D909\",\"comeMode\": \"动车\",\"covidFlag\": \"1\",\"sex\": \"1\",\"age\": \"50\",\"area\": \"哈哈哈\",\"cardType\": \"身份证\",\"invalidTime\": \"2022-12-01 00:00:00\",\"travelCodeImg\": \"/aaa/aaa\",\"arriveLuTime\": \"2022-11-21 11:11:11\",\"destinationStation\": \"青岛北站\",\"carryVehicleNumberColor\": \"蓝\",\"carryVehicleNumber\": \"11111\",\"carryVehicle\": \"是\",\"registeredResidenceAddress\": \"山东青岛市北镇江路街道\",\"registeredResidenceCity\": \"山东青岛\",\"travelPersonnel\": \"无\",\"viaCounty\": \"市北区\",\"viaCity\": \"青岛市\",\"viaProvince\": \"山东省\",\"nonlocalResidenceHistory\": \"否\",\"declarationStatus\": \"1\",\"twoCodeOneReportStatus\": \"正常\",\"detectionAbnormal\": \"否\",\"detailAddress\": \"山东路163号\",\"idCard\": \"370785195101012558\"\n" + " }\n" + "]"; -// List vaccineList = JSON.parseArray(json,Map.class); - List> vaccineList = yantaiNamedParamLantuJdbcTemplate.queryForList( - "select data, name, cardno, vaccineCount from t_ymjz_info where cardno in (:idcards)", args); - List ytVaccineListFromApi = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(vaccineList)) { - vaccineList.forEach(v -> { - if (v.containsKey("data")){ - JSONObject jo = JSON.parseObject((String) v.get("data")); - if (jo.containsKey("vaccineList")) { - JSONArray vaccineListJA = jo.getJSONArray("vaccineList"); - List vaccineList1 = vaccineListJA.toJavaList(YTVaccineListDTO.class); - vaccineList1.forEach(v1 -> { - v1.setCardno(v.get("cardno").toString()); - - // 秒转换成:00 - Matcher matcher = VACCINE_DATE_OF_API_PATTERN.matcher(v1.getInoculateDate()); - if (matcher.matches()) { - v1.setInoculateDate(matcher.group(1).concat(":00")); +// List> tripReportList = new ArrayList<>(); + List> tripReportList = yantaiNamedParamLantuJdbcTemplate.queryForList( + "select id as ytId, card_id as idCard, address as detailAddress, i_flag as iFlag, i_time as iTime, i_type as iType, i_date as iDate,i_id as iId, " + + "travel_code_abnormal travelCodeAbnormal, health_code_abnormal healthCodeAbnormal, twon_name twonName, county_name countyName, " + + "city_name cityName, province_name provinceName, carry_hesuan_proof carryHesuanProof, leave_the_risk_area_time leaveTheRiskAreaTime, come_area_full comeAreaFull, " + + "report_street reportStreet, arrive_time arriveTime, shift, come_mode comeMode, covid_flag covidFlag, sex, age,\n" + + "area, card_type cardType, invalid_time invalidTime, travel_code_img travelCodeImg, arrive_lu_time arriveLuTime, destination_station destinationStation, carry_vehicle_number_color carryVehicleNumberColor, carry_vehicle_number carryVehicleNumber,\n" + + "carry_vehicle carryVehicle, registered_residence_address registeredResidenceAddress, registered_residence_city registeredResidenceCity, travel_personnel travelPersonnel, via_county viaCounty, via_city viaCity, via_province viaProvince,\n" + + "nonlocal_residence_history nonlocalResidenceHistory, declaration_status declarationStatus, two_code_one_report_status twoCodeOneReportStatus, detection_abnormal detectionAbnormal from v_baobei where card_id in (:idcards)", args); + /*Map objectObjectHashMap = new HashMap<>(); + tripReportList.add(objectObjectHashMap);*/ + if (CollectionUtils.isNotEmpty(tripReportList)){ + List>> partition = ListUtils.partition(tripReportList, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + // 要更新的 + List needUpdate = new ArrayList<>(); + // 要新增的 + List entities = ConvertUtils.batchMapToEntity(p, IcTripReportRecordEntity.class); + p.forEach(pp -> entities.stream().filter(ee -> ee.getIdCard().equals(pp.get("idCard"))).forEach(ee -> { + ee.setYtId(pp.get("ytId").toString()); + ee.setIId(pp.get("IId").toString()); + })); +// List entities = JSON.parseArray(json,IcTripReportRecordEntity.class); + // 数据库存在的 + List existsTripReport = icTripReportRecordDao.getExistsTripReport(idCards); + if (CollectionUtils.isNotEmpty(existsTripReport)){ + // 要更新的 + existsTripReport.forEach(etr -> entities.stream().filter(e -> e.getYtId().equals(etr)).forEach(e -> { + needUpdate.add(e); + })); + // 要新增的 + existsTripReport.forEach(etr -> { + Iterator iterator = entities.iterator(); + while (iterator.hasNext()){ + IcTripReportRecordEntity next = iterator.next(); + if (next.getYtId().equals(etr)){ + iterator.remove(); } - }); - ytVaccineListFromApi.addAll(vaccineList1); - } - - //Map data = (Map) v.get("data"); - //if (data.containsKey("vaccineList")){ - // List vaccineList1 = JSON.parseArray(data.get("vaccineList").toString(), YTVaccineListDTO.class); - // vaccineList1.forEach(v1 -> { - // v1.setCardno(v.get("cardno").toString()); - // }); - // ytVaccineListDTOS.addAll(vaccineList1); - //} + } + }); + } + if (CollectionUtils.isNotEmpty(entities)){ + entities.forEach(e -> resiInfos.stream().filter(r ->r.getIdCard().equals(e.getIdCard())).forEach(r -> { + e.setGridId(r.getGridId()); + e.setCustomerId(r.getCustomerId()); + e.setAgencyId(r.getAgencyId()); + e.setPids(r.getPids()); + e.setName(r.getName()); + e.setMobile(r.getMobile()); + e.setUserId(r.getUserId()); + e.setUserType("ytPull"); + })); + icTripReportRecordService.insertBatch(entities); + } + if (CollectionUtils.isNotEmpty(needUpdate)){ + // 因为更新字段较多,所以分批操作 + List> needs = ListUtils.partition(needUpdate, NumConstant.TWENTY); + needs.forEach(n -> { + updateTripReportList(n); + }); } }); - List entities = new ArrayList<>(); + }else { + log.warn("未拉取到行程上报信息!"); + } + } - // 过滤已存在的记录 - List existVaccines = icVaccineDao.getExistVaccine(ytVaccineListFromApi); - if (CollectionUtils.isNotEmpty(existVaccines)){ - for (YTVaccineListDTO existVaccineItem : existVaccines) { - Iterator iterator = ytVaccineListFromApi.iterator(); - while (iterator.hasNext()) { - YTVaccineListDTO vaccineFromApi = iterator.next(); + @Transactional(rollbackFor = Exception.class) + public void updateTripReportList(List need){ + icTripReportRecordDao.updateTripReportList(need); + } - // 身份证号和接种时间都一致,移除 - if (vaccineFromApi.getCardno().equals(existVaccineItem.getCardno()) - && vaccineFromApi.getInoculateDate().equals(existVaccineItem.getInoculateDate())) { + /** + * @Description 疫苗接种信息处理 + * @param resiInfos + * @param customerId + * @param isSync + * @Author zxc + * @Date 2022/11/11 11:07 + */ + public void yanTaiVaccineByDbViewPartition(List resiInfos, String customerId, String isSync){ + // 将居民信息转化为的map + Map idCardAndResiInfoMap = resiInfos.stream().collect(Collectors.toMap(resi -> resi.getIdCard(), Function.identity())); + List idCards = new ArrayList<>(idCardAndResiInfoMap.keySet()); + // 1.获取核酸采样信息 + Map args = new HashMap<>(); + args.put("idcards", idCards); + List> vaccineListGetted = yantaiNamedParamLantuJdbcTemplate.queryForList( + "select data, name, cardno, vaccineCount from t_ymjz_info where cardno in (:idcards)", args); + if (CollectionUtils.isEmpty(vaccineListGetted)) { + return; + } - iterator.remove(); + // 将获取到的json数据进行日期格式转化,暂存到java对象 + List ytVaccineListFromApi = new ArrayList<>(); + vaccineListGetted.forEach(vGetted -> { + if (vGetted.containsKey("data")){ + JSONObject jo = JSON.parseObject((String) vGetted.get("data")); + if (jo.containsKey("vaccineList")) { + JSONArray vaccineListJA = jo.getJSONArray("vaccineList"); + List vaccineList1 = vaccineListJA.toJavaList(YTVaccineListDTO.class); + vaccineList1.forEach(v1 -> { + v1.setCardno(vGetted.get("cardno").toString()); + + // 秒转换成:00 + Matcher matcher = VACCINE_DATE_OF_API_PATTERN.matcher(v1.getInoculateDate()); + if (matcher.matches()) { + v1.setInoculateDate(matcher.group(1).concat(":00")); } + }); + ytVaccineListFromApi.addAll(vaccineList1); + } + } + }); + + if (CollectionUtils.isEmpty(ytVaccineListFromApi)) { + return; + } + + // 过滤已存在的记录 + List existVaccines = icVaccineDao.getExistVaccine(ytVaccineListFromApi); + if (CollectionUtils.isNotEmpty(existVaccines)){ + for (YTVaccineListDTO existVaccineItem : existVaccines) { + Iterator iterator = ytVaccineListFromApi.iterator(); + while (iterator.hasNext()) { + YTVaccineListDTO vaccineFromApi = iterator.next(); + + String inoculateDate = vaccineFromApi.getInoculateDate(); + if (StringUtils.isBlank(inoculateDate)) { + // 没有接种时间,移除 + log.warn("【疫苗接种同步】证件号为{}的记录,没有接种时间,移除。", vaccineFromApi.getCardno()); + iterator.remove(); } - //for (int i = 0; i < ytVaccineListFromApi.size(); i++) { - // String inoculateDateFromApi = ytVaccineListFromApi.get(i).getInoculateDate(); - // Matcher matcher = VACCINE_DATE_OF_API_PATTERN.matcher(inoculateDateFromApi); - // if (ytVaccineListFromApi.get(i).getCardno().equals(e.getCardno()) - // && matcher.matches() - // && matcher.group(1).equals(e.getInoculateDate())){ - // ytVaccineListFromApi.remove(i); - // } - //} + // 身份证号和接种时间都一致,移除 + if (vaccineFromApi.getCardno().equals(existVaccineItem.getCardno()) + && inoculateDate.equals(existVaccineItem.getInoculateDate())) { + + iterator.remove(); + } } } - if (CollectionUtils.isNotEmpty(ytVaccineListFromApi)){ - ytVaccineListFromApi.forEach(v -> { - resiInfos.forEach(u -> { - if (v.getCardno().equals(u.getIdCard())){ - IcVaccineEntity e = new IcVaccineEntity(); - e.setCustomerId(customerId); - e.setName(u.getName()); - e.setMobile(u.getMobile()); - e.setIdCard(u.getIdCard()); - e.setIsResiUser(StringUtils.isBlank(u.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); - e.setUserId(StringUtils.isBlank(u.getUserId()) ? "" : u.getUserId()); - e.setUserType("ytPull"); - e.setInoculateTime(DateUtils.parseDate(v.getInoculateDate(),DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); - e.setInoculateAddress(v.getLastStationName()); - e.setAgencyId(u.getAgencyId()); - e.setPids(u.getPids()); - entities.add(e); - } - }); - }); - icVaccineService.insertBatch(entities,NumConstant.ONE_HUNDRED); - List relationEntities = new ArrayList<>(); - entities.forEach(e -> { - IcVaccineRelationEntity re = new IcVaccineRelationEntity(); - re.setIcVaccineId(e.getId()); - re.setPids(e.getPids()); - re.setCustomerId(customerId); - re.setUserType("ytPull"); - re.setAgencyId(e.getAgencyId()); - // 拉取居民的疫苗接种信;因为查询的就是组织下的居民,所以都是本地居民。 - re.setIsLocalResiUser(NumConstant.ONE_STR); - relationEntities.add(re); - }); - icVaccineRelationService.insertBatch(relationEntities,NumConstant.ONE_HUNDRED); - } } + + + // 转化为entity,插入vaccine和vaccine_relation + List entities2Insert = new ArrayList<>(); + ytVaccineListFromApi.forEach(v -> { + resiInfos.forEach(u -> { + if (v.getCardno().equals(u.getIdCard())){ + IcVaccineEntity e = new IcVaccineEntity(); + e.setCustomerId(customerId); + e.setName(u.getName()); + e.setMobile(u.getMobile()); + e.setIdCard(u.getIdCard()); + e.setIsResiUser(StringUtils.isBlank(u.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); + e.setUserId(StringUtils.isBlank(u.getUserId()) ? "" : u.getUserId()); + e.setUserType("ytPull"); + e.setInoculateTime(DateUtils.parseDate(v.getInoculateDate(),DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + e.setInoculateAddress(v.getLastStationName()); + e.setAgencyId(u.getAgencyId()); + e.setPids(u.getPids()); + entities2Insert.add(e); + } + }); + }); + icVaccineService.insertBatch(entities2Insert,NumConstant.ONE_HUNDRED); + List relationEntities = new ArrayList<>(); + entities2Insert.forEach(e -> { + IcVaccineRelationEntity re = new IcVaccineRelationEntity(); + re.setIcVaccineId(e.getId()); + re.setPids(e.getPids()); + re.setCustomerId(customerId); + re.setUserType("ytPull"); + re.setAgencyId(e.getAgencyId()); + // 拉取居民的疫苗接种信;因为查询的就是组织下的居民,所以都是本地居民。 + re.setIsLocalResiUser(NumConstant.ONE_STR); + relationEntities.add(re); + }); + icVaccineRelationService.insertBatch(relationEntities,NumConstant.ONE_HUNDRED); } /** @@ -1238,6 +1299,11 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl imp icNatRelationDao.insert(relation); } + @Override + public void clearNatRecords(Integer retentionDays) { + Date criticleTime = DateUtils.addDateDays(new Date(), 0 - retentionDays); + + // 1。删除nat核酸检测信息。NatTime建索引 + baseDao.deleteNatRecordsBeforeRetentionDays(criticleTime); + + // 2.删除关系信息 + // 没有记录业务时间,只能暂且按照创建时间来了,大不了多些脏数据。createdTime建索引! + icNatRelationDao.deleteBeforeRetentionDays(criticleTime); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 2a57869b36..05e7b81853 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.hutool.core.bean.BeanUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.bean.ResiImportCategoryData; @@ -372,13 +373,25 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res c.setImportTag(importTag); newlyOrChangedResi.set(c); - List resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId), + // 查询居民类别的字段->中文的map + //List resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId), + // ServiceConstant.OPER_CUSTOMIZE_SERVER, + // EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + // String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId), + // "居民信息导入失败"); + // + //Map columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel())); + + IcResiCategoryStatsConfigDTO sfdto = new IcResiCategoryStatsConfigDTO(); + sfdto.setCustomerId(customerId); + + List categoryListResult = getResultDataOrThrowsException(operCustomizeOpenFeignClient.getCategoryList(sfdto), ServiceConstant.OPER_CUSTOMIZE_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), - String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId), + String.format("【居民信息导入】初始化居民类别items失败,customerId:%s", customerId), "居民信息导入失败"); - Map columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel())); + Map columnNameAndLabel = categoryListResult.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel())); resiCategoryColumnNameAndLabel.set(columnNameAndLabel); } @@ -452,6 +465,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String currUserAgencyPids, String currentUserId, String tableName) { String loginUserCustomerId = EpmetRequestHolder.getLoginUserCustomerId(); // 遍历每一行,将行内容转化为 + String idCard = null; for (Map row : dataRows) { LinkedHashMap columnAndValues = new LinkedHashMap<>(); @@ -462,7 +476,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res execSpecifiedCheckAndFill(columnAndValues); //默认新增 columnAndValues.put("SUB_STATUS", IcResiUserSubStatusEnum.IMPORT.getSubStatus()); - String idCard = columnAndValues.get("ID_CARD"); + idCard = columnAndValues.get("ID_CARD"); Map existingResiMap = icResiUserDao.selectResiInfoMap(loginUserCustomerId, idCard, null); if (existingResiMap == null) { @@ -579,7 +593,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res errorMsg = e.getMessage(); } else { errorMsg = "未知系统错误"; - log.error(ExceptionUtils.getErrorStackTrace(e)); + log.error("【居民信息导入】导入身份证为{}的居民基础信息出现未知错误:{}", idCard == null ? "" : idCard, ExceptionUtils.getErrorStackTrace(e)); } ErrorRow errorRow = new ErrorRow(); @@ -695,12 +709,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 遍历每一行,将行内容转化为 for (Map row : dataRows) { - + String idCard = null; try { convertColumnWrappers2Map4Persist(headerColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues, false); // 检验身份证号 - String idCard = columnAndValues.get("ID_CARD"); + idCard = columnAndValues.get("ID_CARD"); if (StringUtils.isBlank(idCard)) { String resiName = columnAndValues.get("NAME"); if (resiName == null) { @@ -754,7 +768,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res errorMsg = e.getMessage(); } else { errorMsg = "未知系统错误"; - log.error(ExceptionUtils.getErrorStackTrace(e)); + log.error("【居民信息导入】导入身份证为{}的居民扩展信息{}出现未知错误:{}", idCard == null ? "" : idCard, targetTableName, ExceptionUtils.getErrorStackTrace(e)); } ErrorRow errorRow = new ErrorRow(); 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 3e341bf86b..49336ffb95 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) { @@ -2183,6 +2193,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl icResiUserAttachmentService.save(item)); // 如果是已经存在的居民,并且是租客状态,需要更新原本的状态 if (NumConstant.ONE_STR.equals(formDTO.getType())) { - IcResiUserEntity entity = new IcResiUserEntity(); +// IcResiUserEntity entity = new IcResiUserEntity(); + IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); entity.setId(resiUserId); entity.setIsTenant(NumConstant.ONE_STR); entity.setIsFloating(NumConstant.ONE_STR); @@ -2221,6 +2233,70 @@ 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/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java index 06ae46b36a..feb26f1aae 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -835,5 +835,151 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl ytPage(PageTripReportFormDTO formDTO) { + //1.获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = queryCurrentStaff(formDTO.getCustomerId(), formDTO.getUserId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + //2.按条件查询业务数据 + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) + .doSelectPageInfo(() -> baseDao.pageList(formDTO)); + List list = data.getList(); + if (CollectionUtils.isEmpty(list)) { + return new PageData(list, data.getTotal()); + } + //3.查询最近一次通知时间、核算检测关注名单 + if (CollectionUtils.isNotEmpty(list)) { + Map latestNotice = new HashMap<>(); + List gzIdCardList = new ArrayList<>(); + List idCardList = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList()); + //如果不分页可能会有很多个身份证号 + List> partionList = ListUtils.partition(idCardList, NumConstant.ONE_HUNDRED); + partionList.forEach(l -> { + Map map = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(), l); + List gzIdCards = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(), l); + latestNotice.putAll(map); + gzIdCardList.addAll(gzIdCards); + }); + for (IcTripReportRecordDTO dto : list) { + //默认未加入 + dto.setHeSuanCheck(false); + dto.setHeSuanCheckDesc("未加入"); + if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) { + dto.setHeSuanCheck(true); + dto.setHeSuanCheckDesc("已加入"); + } + if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) { + dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard())); + } + } + } + return new PageData(list, data.getTotal()); + } + + @Override + public IcTripReportRecordDTO ytDetail(PageTripReportFormDTO formDTO) { + //1.获取工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = queryCurrentStaff(formDTO.getCustomerId(), formDTO.getUserId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + //2.按条件查询业务数据 + List list = baseDao.pageList(formDTO); + if (CollectionUtils.isEmpty(list)) { + return null; + } + //3.查询最近一次通知时间、核算检测关注名单 + Map latestNotice = new HashMap<>(); + List gzIdCardList = new ArrayList<>(); + List idCardList = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList()); + //如果不分页可能会有很多个身份证号 + List> partionList = ListUtils.partition(idCardList, NumConstant.ONE_HUNDRED); + partionList.forEach(l -> { + Map map = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(), l); + List gzIdCards = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(), l); + latestNotice.putAll(map); + gzIdCardList.addAll(gzIdCards); + }); + + for (IcTripReportRecordDTO dto : list) { + //默认未加入 + dto.setHeSuanCheck(false); + dto.setHeSuanCheckDesc("未加入"); + if (CollectionUtils.isNotEmpty(gzIdCardList) && gzIdCardList.contains(dto.getIdCard())) { + dto.setHeSuanCheck(true); + dto.setHeSuanCheckDesc("已加入"); + } + if (MapUtils.isNotEmpty(latestNotice) && latestNotice.containsKey(dto.getIdCard())) { + dto.setLatestNoticeTime(latestNotice.get(dto.getIdCard())); + } + } + IcTripReportRecordDTO resultDto = list.get(NumConstant.ZERO); + if (null != resultDto) { + resultDto.setShowIdCard(resultDto.getIdCard()); + resultDto.setShowMobile(resultDto.getMobile()); + } + return resultDto; + } + + @Override + public String ytSave(IcYtTripReportFormDTO formDTO) { + //如果是单个录入的,默认数据属于当前用户所属组织id + if (IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())) { + //获取当前登录用户所属组织id + CustomerStaffInfoCacheResult staffInfo = queryCurrentStaff(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class); + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + entity.setPids(agencyInfoCache.getPids()); + //1.插入行程记录表 + entity.setYtId(IdWorker.getIdStr()); + insert(entity); + IcTripReportFormDTO dto = ConvertUtils.sourceToTarget(formDTO, IcTripReportFormDTO.class); + if (formDTO.getHeSuanCheck()) { + // 2.加入核算检测关注名单 + vaccinationAdd(dto); + } + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) { + sendNotice(dto, agencyInfoCache.getOrganizationName()); + } + return entity.getId(); + } + + @Override + public String ytUpdate(IcYtTripReportFormDTO formDTO) { + IcTripReportRecordEntity origin = baseDao.selectById(formDTO.getId()); + if (null == origin) { + log.warn("ic_trip_report_record记录不存在id:", formDTO.getId()); + return formDTO.getId(); + } + //如果是单个录入的,默认数据属于当前用户所属组织id + if (IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())) { + //获取当前登录用户所属组织id + CustomerStaffInfoCacheResult staffInfo = queryCurrentStaff(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class); + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + entity.setPids(agencyInfoCache.getPids()); + //1.修改行程记录表 + updateById(entity); + IcTripReportFormDTO dto = ConvertUtils.sourceToTarget(formDTO, IcTripReportFormDTO.class); + if (formDTO.getHeSuanCheck()) { + // 2.加入核算检测关注名单,如果之前关注了,会在通知的service层移除 + vaccinationAdd(dto); + } + //3.新增通知表信息 + if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) { + sendNotice(dto, agencyInfoCache.getOrganizationName()); + } + return entity.getId(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.90__alter_ic_move_in_record.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.90__alter_ic_move_in_record.sql new file mode 100644 index 0000000000..d3524ea263 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.90__alter_ic_move_in_record.sql @@ -0,0 +1,3 @@ +ALTER TABLE `ic_move_in_record` +MODIFY COLUMN `ADDRESS` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '详细地址' AFTER `SOURCE_ADDRESS`; + diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.91__data_sync_job_create.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.91__data_sync_job_create.sql new file mode 100644 index 0000000000..1cfa1ffca8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.91__data_sync_job_create.sql @@ -0,0 +1,19 @@ +CREATE TABLE `ic_sync_job` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PID` varchar(255) NOT NULL COMMENT '组织ID的上级', + `ORG_ID_PATH` varchar(1024) NOT NULL COMMENT '组织ID的所有上级,包括org_id', + `JOB_TYPE` varchar(32) NOT NULL COMMENT '任务类型,残疾:disability;死亡:death;核酸:nat;', + `OPERATOR_ID` varchar(255) NOT NULL COMMENT '操作员ID【staffId】', + `OPERATION_STATUS` varchar(32) DEFAULT NULL COMMENT '操作状态,等待中:waiting;进行中:processing;结束:finish', + `PROCESSOR_IP` varchar(15) DEFAULT NULL COMMENT '处理器实例ip', + `DEL_FLAG` int(11) NOT NULL, + `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`), + KEY `ORG_ID` (`ORG_ID`,`OPERATION_STATUS`,`JOB_TYPE`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同步任务表' \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.92__alter_ic_trip_report.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.92__alter_ic_trip_report.sql new file mode 100644 index 0000000000..57751d7f40 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.92__alter_ic_trip_report.sql @@ -0,0 +1,63 @@ + +-- 去掉必填项 +ALTER TABLE `ic_trip_report_record` +MODIFY COLUMN `PRESENT_ADDRESS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '现居地名称eg:山东省-青岛市-黄岛区-玫瑰山路社区' AFTER `PRESENT_ADDRESS_PATH_CODE`, +MODIFY COLUMN `DETAIL_ADDRESS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '详细地址(烟台的对应address字段)' AFTER `PRESENT_ADDRESS`, +MODIFY COLUMN `SOURCE_ADDRESS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源地区地址' AFTER `SOURCE_ADDRESS_PATH_CODE`, +MODIFY COLUMN `ARRIVE_DATE` date NULL COMMENT '到达日期' AFTER `SOURCE_ADDRESS`; + +ALTER TABLE `ic_trip_report_record` +MODIFY COLUMN `DETAIL_ADDRESS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '详细地址(烟台的对应address字段)' AFTER `PRESENT_ADDRESS`; + + +-- 新增字段、索引 +ALTER TABLE `ic_trip_report_record` +ADD COLUMN `detection_abnormal` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '核酸检测报告异常 是/否【烟台】' AFTER `trip_data_type`, +ADD COLUMN `two_code_one_report_status` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '两码一报告状态 (正常 异常)【烟台】' AFTER `detection_abnormal`, +ADD COLUMN `declaration_status` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申报状态( 0未审核 1审核通过 2无效数据)【烟台】' AFTER `two_code_one_report_status`, +ADD COLUMN `nonlocal_residence_history` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否有外地旅居史 是/否【烟台】' AFTER `declaration_status`, +ADD COLUMN `via_province` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '途经省【烟台】' AFTER `nonlocal_residence_history`, +ADD COLUMN `via_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '途经市【烟台】' AFTER `via_province`, +ADD COLUMN `via_county` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '途经县区【烟台】' AFTER `via_city`, +ADD COLUMN `via_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编码' AFTER `via_county`, +ADD COLUMN `via_path_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编码全路径' AFTER `via_code`, +ADD COLUMN `travel_personnel` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '同行人员【烟台】' AFTER `via_path_code`, +ADD COLUMN `registered_residence_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '户籍地【烟台】' AFTER `travel_personnel`, +ADD COLUMN `registered_residence_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '户籍地详细【烟台】' AFTER `registered_residence_city`, +ADD COLUMN `registered_residence_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编码' AFTER `registered_residence_address`, +ADD COLUMN `registered_residence_path_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编码全路径' AFTER `registered_residence_code`, +ADD COLUMN `carry_vehicle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否带车 是/否 【烟台】' AFTER `registered_residence_path_code`, +ADD COLUMN `carry_vehicle_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '带车车牌号【烟台】' AFTER `carry_vehicle`, +ADD COLUMN `carry_vehicle_number_color` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '车牌颜色【烟台】' AFTER `carry_vehicle_number`, +ADD COLUMN `destination_station` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目的地交通场站【烟台】' AFTER `carry_vehicle_number_color`, +ADD COLUMN `arrive_lu_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '入鲁时间【烟台】' AFTER `destination_station`, +ADD COLUMN `travel_code_img` varchar(3000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行程码【烟台】' AFTER `arrive_lu_time`, +ADD COLUMN `invalid_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '无效时间【烟台】' AFTER `travel_code_img`, +ADD COLUMN `card_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证件类型【烟台】' AFTER `invalid_time`, +ADD COLUMN `area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域【烟台】' AFTER `card_type`, +ADD COLUMN `age` int(22) NULL DEFAULT NULL COMMENT '年龄【烟台】' AFTER `area`, +ADD COLUMN `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别【烟台】' AFTER `age`, +ADD COLUMN `covid_flag` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否有新冠肺炎病史 是/否 【烟台】' AFTER `sex`, +ADD COLUMN `come_mode` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来烟方式【烟台】' AFTER `covid_flag`, +ADD COLUMN `shift` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '班次【烟台】' AFTER `come_mode`, +ADD COLUMN `arrive_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '抵烟时间【烟台】' AFTER `shift`, +ADD COLUMN `report_street` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上报街道【烟台】' AFTER `arrive_time`, +ADD COLUMN `come_area_full` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源地区全【烟台】' AFTER `report_street`, +ADD COLUMN `leave_the_risk_area_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '离开风险区域的时间【烟台】' AFTER `come_area_full`, +ADD COLUMN `carry_hesuan_proof` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否携带48小时核算证明 是/否【烟台】' AFTER `leave_the_risk_area_time`, +ADD COLUMN `province_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省【烟台】' AFTER `carry_hesuan_proof`, +ADD COLUMN `city_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市【烟台】' AFTER `province_name`, +ADD COLUMN `county_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '县【烟台】' AFTER `city_name`, +ADD COLUMN `twon_name` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址【烟台】' AFTER `county_name`, +ADD COLUMN `health_code_abnormal` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '健康码异常 是/否【烟台】' AFTER `twon_name`, +ADD COLUMN `travel_code_abnormal` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行程码异常 是/否【烟台】' AFTER `health_code_abnormal`, +ADD COLUMN `i_id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '【烟台】' AFTER `travel_code_abnormal`, +ADD COLUMN `i_date` varchar(7) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '【烟台】' AFTER `i_id`, +ADD COLUMN `i_type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '【烟台】' AFTER `i_date`, +ADD COLUMN `i_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '【烟台】' AFTER `i_type`, +ADD COLUMN `i_flag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '【烟台】' AFTER `i_time`, +ADD COLUMN `yt_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '烟台数据主键【烟台】对应烟台的id' AFTER `i_flag`, +DROP PRIMARY KEY, +ADD PRIMARY KEY (`ID`, `yt_id`), +ADD INDEX `yt_id` (`yt_id`) USING BTREE COMMENT '烟台数据Id普通索引'; + diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.93__ic_resi_contract_info.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.93__ic_resi_contract_info.sql new file mode 100644 index 0000000000..b60abb22d1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.93__ic_resi_contract_info.sql @@ -0,0 +1,14 @@ +CREATE TABLE `ic_resi_rent_contract_info` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `IC_RESI_USER` varchar(64) NOT NULL COMMENT '主表Id', + `CONTRACT_START_DATE` varchar(32) DEFAULT NULL COMMENT '合同开始日期', + `CONTRACT_END_DATE` varchar(32) DEFAULT NULL COMMENT '合同结束日期', + `DEL_FLAG` int(11) 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-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls index 4d7e3660d7..fc10d33a70 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template1125.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template1125.xls new file mode 100644 index 0000000000..b8d6f0689c Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template1125.xls 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 new file mode 100644 index 0000000000..a9aa1b3e6a Binary files /dev/null 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/ChangeDeathDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml index f0e6b117b8..1c0904951f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ChangeDeathDao.xml @@ -44,7 +44,10 @@ d.UPDATED_TIME FROM pli_change_death d - LEFT JOIN ic_resi_user u ON u.ID_CARD = d.ID_CARD + LEFT JOIN ic_resi_user u + ON (u.ID_CARD = d.ID_CARD + and u.DEL_FLAG='0' + and d.CUSTOMER_ID=u.CUSTOMER_ID) LEFT JOIN pli_change_welfare w ON d.ID_CARD = w.ID_CARD AND w.DEL_FLAG = '0' WHERE 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 51524b85c6..c2a9595488 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 @@ -43,7 +43,7 @@ w.UPDATED_TIME 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' @@ -90,6 +90,14 @@ AND ID_CARD = #{idCard} + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 0af0763a93..f42cd61546 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -326,7 +326,8 @@ SELECT - ID AS id, - DEPT_CODE AS deptCode, - DEPT_NAME AS deptName, - DATA_NAME AS dataName, - switch_status AS switchStatus, - sort AS sort, - data_code AS dataCode, - customer_id as customerId - FROM data_sync_config - WHERE DEL_FLAG = 0 + c.ID AS id, + c.DEPT_CODE AS deptCode, + c.DEPT_NAME AS deptName, + c.DATA_NAME AS dataName, + c.switch_status AS switchStatus, + c.sort AS sort, + c.data_code AS dataCode, + c.customer_id as customerId + FROM data_sync_config c + WHERE c.DEL_FLAG = 0 - AND switch_status = #{switchStatus} + AND c.switch_status = #{switchStatus} - AND CUSTOMER_ID = #{customerId} + AND c.CUSTOMER_ID = #{customerId} - AND data_code = #{dataCode} + AND c.data_code = #{dataCode} - order by sort + order by CONVERT(c.DEPT_NAME USING gbk),c.sort asc diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 243fbebcd7..049a806b55 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -49,13 +49,19 @@ b.nat_address natAddress, b.test_tube_code testTubeCode FROM - ic_nat_relation a + ( + select IC_NAT_ID, AGENCY_ID, USER_TYPE, IS_LOCAL_RESI_USER + from ic_nat_relation + WHERE AGENCY_ID = #{agencyId} + and DEL_FLAG = '0' + and customer_id = #{customerId} + + AND is_local_resi_user = #{isResiUser} + + ) a INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID WHERE - a.DEL_FLAG = '0' - AND b.DEL_FLAG = '0' - AND a.customer_id = #{customerId} - AND a.pids like concat('%', #{agencyId}, '%') + b.DEL_FLAG = '0' AND b.name like concat('%', #{name}, '%') @@ -77,9 +83,6 @@ AND b.sample_time #{sampleEndTime} - - AND a.is_local_resi_user = #{isResiUser} - ORDER BY b.nat_time DESC, b.id ASC @@ -175,17 +178,17 @@ - + + + select * from ic_resi_rent_contract_info where DEL_FLAG = 0 and IC_RESI_USER = #{userId} limit 1 + + + + + + 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 ec51178649..b3e82440ef 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 @@ -201,9 +201,9 @@ AND ( - NAME = #{keyword} - or MOBILE = #{keyword} - or ID_CARD = #{keyword} + NAME like concat('%', #{keyword},'%') + or MOBILE like concat('%', #{keyword},'%') + or ID_CARD like concat('%', #{keyword},'%') ) @@ -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 @@ + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml index 6ed0708d43..4b266d56c2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml @@ -3,8 +3,8 @@ - - select id, customer_id, org_id, @@ -13,6 +13,7 @@ job_type, operator_id, operation_status, + processor_ip, del_flag, revision, created_by, @@ -20,10 +21,16 @@ updated_by, updated_time from ic_sync_job - where OPERATION_STATUS = 'waiting' + where + DEL_FLAG = 0 + and OPERATION_STATUS = #{status} and JOB_TYPE = #{jobType} - and DEL_FLAG = 0 + + and PROCESSOR_IP = #{processorIp} + order by CREATED_TIME asc - limit #{itemCount} + + limit #{itemCount} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml index 92cb344f9f..8558874837 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -33,17 +33,18 @@ @@ -151,6 +152,18 @@ order by total desc + + + update ic_trip_report_record set del_flag='1',UPDATED_BY=#{userId},UPDATED_TIME=NOW() WHERE AGENCY_ID=#{agencyId} @@ -160,4 +173,198 @@ ) + + + + UPDATE ic_trip_report_record + + + + when yt_id = #{l.ytId} then #{l.detailAddress} + + + + + when yt_id = #{l.ytId} then #{l.travelCodeAbnormal} + + + + + when yt_id = #{l.ytId} then #{l.healthCodeAbnormal} + + + + + when yt_id = #{l.ytId} then #{l.twonName} + + + + + when yt_id = #{l.ytId} then #{l.countyName} + + + + + when yt_id = #{l.ytId} then #{l.cityName} + + + + + when yt_id = #{l.ytId} then #{l.provinceName} + + + + + when yt_id = #{l.ytId} then #{l.carryHesuanProof} + + + + + when yt_id = #{l.ytId} then #{l.leaveTheRiskAreaTime} + + + + + when yt_id = #{l.ytId} then #{l.comeAreaFull} + + + + + when yt_id = #{l.ytId} then #{l.reportStreet} + + + + + when yt_id = #{l.ytId} then #{l.arriveTime} + + + + + when yt_id = #{l.ytId} then #{l.shift} + + + + + when yt_id = #{l.ytId} then #{l.comeMode} + + + + + when yt_id = #{l.ytId} then #{l.covidFlag} + + + + + when yt_id = #{l.ytId} then #{l.sex} + + + + + when yt_id = #{l.ytId} then #{l.age} + + + + + when yt_id = #{l.ytId} then #{l.area} + + + + + when yt_id = #{l.ytId} then #{l.cardType} + + + + + when yt_id = #{l.ytId} then #{l.invalidTime} + + + + + when yt_id = #{l.ytId} then #{l.travelCodeImg} + + + + + when yt_id = #{l.ytId} then #{l.arriveLuTime} + + + + + when yt_id = #{l.ytId} then #{l.destinationStation} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicleNumberColor} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicleNumber} + + + + + when yt_id = #{l.ytId} then #{l.carryVehicle} + + + + + when yt_id = #{l.ytId} then #{l.registeredResidenceAddress} + + + + + when yt_id = #{l.ytId} then #{l.registeredResidenceCity} + + + + + when yt_id = #{l.ytId} then #{l.travelPersonnel} + + + + + when yt_id = #{l.ytId} then #{l.viaCounty} + + + + + when yt_id = #{l.ytId} then #{l.viaCity} + + + + + when yt_id = #{l.ytId} then #{l.viaProvince} + + + + + when yt_id = #{l.ytId} then #{l.nonlocalResidenceHistory} + + + + + when yt_id = #{l.ytId} then #{l.declarationStatus} + + + + + when yt_id = #{l.ytId} then #{l.twoCodeOneReportStatus} + + + + + when yt_id = #{l.ytId} then #{l.detectionAbnormal} + + + UPDATED_TIME = NOW() + + WHERE DEL_FLAG = '0' + AND yt_id IN ( + + #{l.ytId} + + ) + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml index d5aeb1384d..ea56bb20b6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml @@ -244,4 +244,12 @@ + + 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/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 @@