Browse Source

Merge branch 'feature/userDtoJar' into feature/rentalRevision

# Conflicts:
#	epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java
dev
wanggongfeng 3 years ago
parent
commit
6e167e51cf
  1. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java
  4. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java
  5. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml
  6. 39
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcNatClearTask.java
  7. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java
  8. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java
  9. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  10. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
  11. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java
  12. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java
  13. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  14. 7
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.47__alter_ic_party_service_center_matter.sql
  15. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
  16. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  17. 1
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  18. 2
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java
  19. 1
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml
  20. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserDTO.java
  21. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/VaccineLogDetailDTO.java
  22. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  23. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  24. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  25. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  26. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java
  27. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java
  28. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java
  29. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java
  30. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java
  31. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java
  32. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  33. 40
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java
  34. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  35. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  36. 28
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncConfigDao.xml
  37. 44
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  38. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml

35
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=7str="1,2" 表示获取未来周天周一出现的日期两个总共出现七次
* 比如今天1号是周一则得到的值是1号7号8号14号15号21号22号7次的日期
*/
public static List<String> getCustomDay(Date startDate, int num, String str) {
List<String> 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)));
}
}

5
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;
/**
* 服务组织类型

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPolicyDao.java

@ -31,4 +31,6 @@ public interface IcPolicyDao extends BaseDao<IcPolicyEntity> {
@Param("title")String title,
@Param("content")String content,
@Param("expiredFlag")String expiredFlag);
String selectTitle(String policyId);
}

10
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<IcServiceRecor
private IcServiceScopeV2Dao icServiceScopeV2Dao;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired
private IcPolicyDao icPolicyDao;
@Override
public PageData<IcServiceRecordV2DTO> page(Map<String, Object> params) {
@ -271,6 +272,7 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
result.setGridIdList(scopeV2DTOS);
IcServiceFeedbackV2DTO feedbackV2 = serviceFeedbackV2Dao.getFeedbackV2(formDTO.getServiceRecordId());
result.setFeedback(feedbackV2);
result.setPolicyTitle(StringUtils.isNotBlank(result.getPolicyId()) ? icPolicyDao.selectTitle(result.getPolicyId()) : StrConstant.EPMETY_STR);
return result;
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPolicyDao.xml

@ -80,4 +80,13 @@
</if>
order by ip.CREATED_TIME desc
</select>
<select id="selectTitle" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
p.TITLE
FROM
ic_policy p
WHERE
p.id = #{policyId}
</select>
</mapper>

39
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<String, Object> paramMap;
if (StringUtils.isNotBlank(jsonParams)) {
paramMap = JSON.parseObject(jsonParams, new TypeReference<Map<String, Object>>(){});
} else {
paramMap = new HashMap<>();
}
epmetUserOpenFeignClient.clearNatRecords(paramMap);
}
}

7
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;
/**
* 可预约开始时间
*/

2
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 = "";

5
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 = "";

5
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;
/**
* 是否能取消预约 truefalse不能
*/

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

7
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;
/**
* 可预约开始时间
*/

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -327,7 +327,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
List<String> 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<IcPartyServ
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
List<String> 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<IcPartyServ
throw new RenException("事项不存在...");
}
result.setAppointmentType(matter.getAppointmentType());
result.setDateList(getDateList(result.getAppointmentType()));
result.setDateList(getDateList(result.getAppointmentType(), matter.getCustomDay()));
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate())
@ -564,14 +564,16 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result;
}
public List<String> getDateList(String type) {
public List<String> getDateList(String type, String customDay) {
List<String> 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;
}

7
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`;

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

@ -63,7 +63,8 @@
ar.MATTER_ID as matterId,
c.CENTER_NAME,
c.ADDRESS,
cm.MATTER_IMG
cm.MATTER_IMG,
cm.CUSTOM_DAY as customDay
FROM ic_matter_appointment_record ar
LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
LEFT JOIN ic_party_service_center c ON (c.ID = cm.PARTY_SERVICE_CENTER_ID AND c.DEL_FLAG = 0)

8
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -27,8 +27,10 @@
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'custom' THEN CONCAT('自定义',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
IFNULL(cm.MATTER_IMG,'') AS matterImg,
cm.custom_day AS customDay
from ic_party_service_center_matter cm
where del_flag = 0
and PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId}
@ -60,12 +62,14 @@
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'custom' THEN CONCAT('自定义',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg,
c.ADDRESS,
c.WORK_PHONE,
c.CENTER_NAME,
cm.APPOINTMENT_TYPE as appointmentType
cm.APPOINTMENT_TYPE as appointmentType,
cm.CUSTOM_DAY as customDay
FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0

1
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -1846,6 +1846,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articleEntity.setOrgId(staffInfo.getAgencyId());
articleEntity.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
articleEntity.setRichTextFlag(NumConstant.ONE_STR);
articleEntity.setIsTop(formDTO.getIsTop());
baseDao.updateById(articleEntity);
// 2.内容
ArticleContentEntity articleContent = articleContentDao.selectByArticleId(formDTO.getArticleId());

2
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java

@ -105,6 +105,8 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcInd
@Override
public List<IndividualCategoryAllListResultDTO> individualCategoryAllList(TokenDto tokenDto) {
IcResiCategoryStatsConfigFormDTO formDTO = new IcResiCategoryStatsConfigFormDTO();
//只查状态展示的
formDTO.setStatus("show");
Result<List<IcResiCategoryStatsConfigDTO>> listResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(formDTO);
if (!listResult.success()){
throw new EpmetException("查询客户下的人员类别失败...");

1
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml

@ -22,6 +22,7 @@
INNER JOIN ic_resi_category_warn_config wc ON (sc.COLUMN_NAME = wc.COLUMN_NAME AND wc.DEL_FLAG = '0' AND wc.CUSTOMER_ID = sc.CUSTOMER_ID)
WHERE cm.DEL_FLAG = 0
AND cm.USER_ID = #{userId}
AND sc.STATUS = 'show'
ORDER BY cm.sort
</select>
</mapper>

13
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<VaccineLogDetailDTO> vaccineLog;
/**
* 预留字段1
*/
@ -555,4 +562,4 @@ public class IcResiUserDTO implements Serializable {
*/
private String field10;
}
}

46
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/VaccineLogDetailDTO.java

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

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -959,4 +959,14 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/icresiuser/rhzkList")
Result<List<RHZKStatisticsResultDTO>> 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<String, Object> map);
}

5
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<List<RHZKStatisticsResultDTO>> renHuCondition(RHZKStatisticsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "renHuCondition", formDTO);
}
@Override
public Result clearNatRecords(Map<String, Object> map) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "clearNatRecords", map);
}
}

22
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<String, Object> map) {
// 保留天数
Integer retentionDays = (Integer) map.get("retentionDays");
// 如果是非正数直接不做任何操作
if (retentionDays != null && retentionDays > 0) {
icNucleinService.clearNatRecords(retentionDays);
}
return new Result();
}
}

3
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<IcNatEntity> {
* @Date 2022/10/25 11:13
*/
void updateRelationOther();
void deleteNatRecordsBeforeRetentionDays(Date criticleTime);
}

4
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<IcNatRelationEntity> {
* @Description 关系数据删除--物理删除
**/
int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId);
void deleteBeforeRetentionDays(Date criticleTime);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java

@ -80,6 +80,10 @@ public abstract class AbstractDataSyncJobProcessor {
RLock lock = null;
try {
lock = distributedLock.getLock(getDistributeLockKey(), getDistributeLockLeaseTime(), getDistributeLockWaitTime(), TimeUnit.SECONDS);
if (lock == null) {
log.warn("【异步数据更新】{}获取锁为空", getJobType());
return;
}
// 查询可执行的任务列表,并且异步执行
List<IcSyncJobEntity> icSyncJobToExec = icSyncJobDao.selectJobListByStatus("waiting", getJobType(), null, leftCount);
if (!CollectionUtils.isEmpty(icSyncJobToExec)) {
@ -89,9 +93,7 @@ public abstract class AbstractDataSyncJobProcessor {
} catch (Exception e) {
log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e));
} finally {
if (lock != null) {
lock.unlock();
}
distributedLock.unLock(lock);
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java

@ -51,11 +51,11 @@ public class YanTaiNatSyncProcessor extends AbstractDataSyncJobProcessor {
@Override
protected long getDistributeLockLeaseTime() {
return 60;
return 5;
}
@Override
protected long getDistributeLockWaitTime() {
return 60;
return 6;
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java

@ -50,11 +50,11 @@ public class YanTaiResiComparisonSyncProcessor extends AbstractDataSyncJobProces
@Override
protected long getDistributeLockLeaseTime() {
return 60;
return 5;
}
@Override
protected long getDistributeLockWaitTime() {
return 60;
return 6;
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiTripReportSyncProcessor.java

@ -50,11 +50,11 @@ public class YanTaiTripReportSyncProcessor extends AbstractDataSyncJobProcessor
@Override
protected long getDistributeLockLeaseTime() {
return 60;
return 5;
}
@Override
protected long getDistributeLockWaitTime() {
return 60;
return 6;
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java

@ -49,11 +49,11 @@ public class YanTaiVaccineSyncProcessor extends AbstractDataSyncJobProcessor {
@Override
protected long getDistributeLockLeaseTime() {
return 60;
return 5;
}
@Override
protected long getDistributeLockWaitTime() {
return 60;
return 6;
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java

@ -97,4 +97,12 @@ public interface IcNatService extends BaseService<IcNatEntity> {
void initNatLocal();
/**
* 清理nat记录目前不区分客户后期需要区分可以再加
* @author wxz
* @date 2022/11/28 下午5:39
* * @param retentionDays 保留的天数(最近)
*
*/
void clearNatRecords(Integer retentionDays);
}

40
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java

@ -1126,26 +1126,26 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
}
}
});
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<List<IcTripReportRecordEntity>> needs = ListUtils.partition(needUpdate, NumConstant.TWENTY);
needs.forEach(n -> {
updateTripReportList(n);
});
}
}
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<List<IcTripReportRecordEntity>> needs = ListUtils.partition(needUpdate, NumConstant.TWENTY);
needs.forEach(n -> {
updateTripReportList(n);
});
}
});
}else {

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -733,4 +733,15 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> 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);
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -373,13 +373,25 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
c.setImportTag(importTag);
newlyOrChangedResi.set(c);
List<ResiCategoryItemResultDTO> resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId),
// 查询居民类别的字段->中文的map
//List<ResiCategoryItemResultDTO> resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId),
// ServiceConstant.OPER_CUSTOMIZE_SERVER,
// EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
// String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId),
// "居民信息导入失败");
//
//Map<String, String> columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel()));
IcResiCategoryStatsConfigDTO sfdto = new IcResiCategoryStatsConfigDTO();
sfdto.setCustomerId(customerId);
List<IcResiCategoryStatsConfigDTO> 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<String, String> columnNameAndLabel = resiCategoryItems.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel()));
Map<String, String> columnNameAndLabel = categoryListResult.stream().collect(Collectors.toMap((o) -> o.getColumnName(), (o) -> o.getLabel()));
resiCategoryColumnNameAndLabel.set(columnNameAndLabel);
}

28
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncConfigDao.xml

@ -31,26 +31,26 @@
</resultMap>
<select id="list" resultMap="dataConfigList">
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
<if test="switchStatus != null and switchStatus != ''">
AND switch_status = #{switchStatus}
AND c.switch_status = #{switchStatus}
</if>
<if test='null != customerId and customerId != "" '>
AND CUSTOMER_ID = #{customerId}
AND c.CUSTOMER_ID = #{customerId}
</if>
<if test="dataCode != null and dataCode != ''">
AND data_code = #{dataCode}
AND c.data_code = #{dataCode}
</if>
order by sort
order by CONVERT(c.DEPT_NAME USING gbk),c.sort asc
</select>
<!-- 范围查询 -->

44
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml

@ -49,14 +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}
<if test='null != isResiUser and "" != isResiUser'>
AND is_local_resi_user = #{isResiUser}
</if>
) 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}, '%')-->
AND a.AGENCY_ID = #{agencyId}
b.DEL_FLAG = '0'
<if test='null != name and "" != name'>
AND b.name like concat('%', #{name}, '%')
</if>
@ -78,9 +83,6 @@
<if test='null != sampleEndTime and "" != sampleEndTime'>
AND b.sample_time <![CDATA[ <= ]]> #{sampleEndTime}
</if>
<if test='null != isResiUser and "" != isResiUser'>
AND a.is_local_resi_user = #{isResiUser}
</if>
ORDER BY b.nat_time DESC, b.id ASC
</select>
@ -176,17 +178,17 @@
</foreach>
</select>
<!-- 获取关系和核酸检测 -->
<!-- 获取关系和核酸检测,这两个表数据量可能会很大,所以用嵌套子查询先过滤出一部分来,再关联 -->
<select id="getRelationAndNat" resultType="com.epmet.dto.result.RelationAndNatResultDTO">
SELECT
r.ID AS relationId,
i.ID AS natId,
i.ID_CARD,
r.PIDS AS staffAgencyIdPath
FROM ic_nat_relation r
INNER JOIN ic_nat i ON i.ID = r.IC_NAT_ID AND i.DEL_FLAG = 0
WHERE r.DEL_FLAG = 0
AND r.USER_TYPE IN ('import')
SELECT r.ID AS relationId,
i.ID AS natId,
i.ID_CARD,
r.PIDS AS staffAgencyIdPath
FROM (SELECT ID, PIDS, IC_NAT_ID
FROM ic_nat_relation
WHERE DEL_FLAG = 0
AND USER_TYPE IN ('import')) r
INNER JOIN ic_nat i ON i.ID = r.IC_NAT_ID AND i.DEL_FLAG = 0
</select>
<select id="getResiByIdCards" resultType="com.epmet.entity.IcResiUserEntity">
SELECT * FROM ic_resi_user
@ -275,4 +277,8 @@
UPDATED_TIME = NOW()
where user_type != 'import'
</update>
<delete id="deleteNatRecordsBeforeRetentionDays">
delete from ic_nat where SAMPLE_TIME <![CDATA[<]]> #{criticleTime}
</delete>
</mapper>

4
epmet-user/epmet-user-server/src/main/resources/mapper/IcNatRelationDao.xml

@ -13,4 +13,8 @@
</if>
</delete>
<delete id="deleteBeforeRetentionDays">
delete from ic_nat_relation where CREATED_TIME <![CDATA[<]]> #{criticleTime}
</delete>
</mapper>
Loading…
Cancel
Save