diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java index 389338f717..c1305d0e5a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java @@ -1,6 +1,6 @@ package com.epmet.commons.tools.enums; -import com.epmet.commons.tools.exception.EpmetErrorCode; +import java.util.Objects; /** * @author Administrator @@ -22,11 +22,11 @@ public enum ChannelEnum { public static String getName(String code) { ChannelEnum[] houseTypeEnums = values(); for (ChannelEnum houseTypeEnum : houseTypeEnums) { - if (houseTypeEnum.getCode() == code) { + if (Objects.equals(houseTypeEnum.getCode(), code)) { return houseTypeEnum.getName(); } } - return EpmetErrorCode.SERVER_ERROR.getMsg(); + return null; } public static String getCode(String name) { 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 4614beb5ba..bf8bcdc86b 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 @@ -251,6 +251,7 @@ public enum EpmetErrorCode { ORG_EDIT_FAILED(8920,"编辑失败"), ORG_DEL_FAILED(8921,"删除失败"), NEIGHBORHOOD_DEL_FAILED(8922,""), + IC_NAT_IDCARD_NATTIME(8923,"核酸检测时间已存在相同记录"), //通用错误码 start 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 f956423f3a..a28a038f7b 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 @@ -60,7 +60,7 @@ public class DateUtils { public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_CHINESE = "chinese"; - + public static final String DATE_PATTERN_MMDD = "MMdd"; /** * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index 8e7ef7eedb..46b99ffea4 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -15,6 +15,9 @@ public interface ImportTaskConstants { String BIZ_TYPE_COMMUNITY_SELF_ORG = "community_self_org"; String BIZ_TYPE_PARTY_UNIT = "party_unit"; String BIZ_TYPE_PARTY_ACTIVITY = "party_activity"; + String BIZ_TYPE_ATTENTION_NAT = "attention_nat"; + String BIZ_TYPE_ATTENTION_VACCINATION = "attention_vaccination"; + String BIZ_TYPE_ATTENTION_TRIP_REPORT = "attention_vaccination"; /** * 核酸检测 */ diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java new file mode 100644 index 0000000000..bc88cf3a28 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class AreaCodeFormDTO { + private String parentAreaCode; + private String parentLevel; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java new file mode 100644 index 0000000000..7b09f4f020 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class AreaCodeResultDTO { + private String areaCode; + private String parentCode; + private String areaName; + private String level; +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java index df821f7410..7bf4e537f8 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java @@ -28,7 +28,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.service.AreaCodeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -121,4 +123,14 @@ public class AreaCodeController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(areaCodeService.addAreaCode(formDTO)); } + + /** + * 行政地区编码逐级查询 + * @param formDTO + * @return + */ + @PostMapping(value = "nextarea") + public Result> nextArea(@RequestBody AreaCodeFormDTO formDTO){ + return new Result>().ok(areaCodeService.nextArea(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java index 54b89ee82f..bfe5c8139e 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AreaCodeDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -40,4 +42,14 @@ public interface AreaCodeDao extends BaseDao { AreaCodeDTO selectByCityCode(String cityCode); AreaCodeDTO selectMaxCounty(String cityCode); + + List selectProvince(); + + List selectCity(@Param("pCode")String pCode); + + List selectDistrict(@Param("pCode")String pCode); + + List selectStreet(@Param("pCode")String pCode); + + List selectCommunity(@Param("pCode")String pCode); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java index 99c25ab2f2..e452332fea 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java @@ -23,7 +23,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import java.util.List; @@ -123,4 +125,6 @@ public interface AreaCodeService extends BaseService { * @Date 2021/4/13 14:40 **/ String addAreaCode(AddAreaCodeFormDTO formDTO); + + List nextArea(AreaCodeFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index 0de5ddac2b..f300c4bb4e 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -38,7 +38,9 @@ import com.epmet.dto.AreaCodeDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AddAreaCodeFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.AreaCodeResultDTO; import com.epmet.entity.AreaCodeEntity; import com.epmet.redis.AreaCodeRedis; import com.epmet.service.AreaCodeChildService; @@ -688,6 +690,35 @@ public class AreaCodeServiceImpl extends BaseServiceImpl nextArea(AreaCodeFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){ + return baseDao.selectProvince(); + } + List list=new ArrayList<>(); + switch (formDTO.getParentLevel()) { + case AreaCodeConstant.PROVINCE: + list = baseDao.selectCity(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.CITY: + list = baseDao.selectDistrict(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.DISTRICT: + list = baseDao.selectStreet(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.STREET: + list = baseDao.selectCommunity(formDTO.getParentAreaCode()); + break; + case AreaCodeConstant.COMMUNITY: + log.info("社区无下级"); + list=null; + break; + default: + log.warn("parentLevel错误:"+formDTO.getParentLevel()); + } + return list; + } + private String addDistrictAreaCode(String cityCode, String countyName) { AreaCodeDTO city = baseDao.selectByCityCode(cityCode); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml index 9eaffba75a..eca90f2415 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml @@ -27,4 +27,85 @@ order by ac.COUNTY_CODE desc limit 1 + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 3a3ca19096..ae5a6d07ba 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -78,4 +78,17 @@ public class HouseInfoDTO implements Serializable { private String allName; private String customerId; + + /** + * 小区所在的组织id + */ + private String agencyId; + /** + * eg:市北区-阜新路街道-南宁社区 + */ + private String agencyPathName; + /** + * 组织的area_code + */ + private String areaCode; } 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 ab86eb425b..9aac6abbd4 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 @@ -291,4 +291,16 @@ public class HouseController implements ResultDataResolver { return new Result(); } + /** + * 获取房屋信息 + * @param houseId + * @return + */ + @PostMapping("gethouseinfo/{houseId}") + public Result getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){ + if(StringUtils.isBlank(houseId)){ + return new Result<>(); + } + return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index 74d38894e4..a651ed1615 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -26,7 +26,6 @@ import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcHouseExcel; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; @@ -78,4 +77,6 @@ public interface HouseService { * @date 2022/3/1 4:57 下午 */ void allDelete(NeighborHoodManageDelFormDTO formDTO); + + HouseInfoDTO getHouseInfoDTO(String customerId,String houseId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 36ace6672d..210f8e8b49 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -13,7 +13,9 @@ 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.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; @@ -455,4 +457,18 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } } } + + @Override + public HouseInfoDTO getHouseInfoDTO(String customerId, String houseId) { + HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId); + if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId()); + houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName())?agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()):agencyInfoCache.getOrganizationName()); + houseInfo.setAreaCode(StringUtils.isNotBlank(agencyInfoCache.getAreaCode())?agencyInfoCache.getAreaCode():StrConstant.EPMETY_STR); + } else { + houseInfo.setAgencyPathName(StrConstant.EPMETY_STR); + houseInfo.setAreaCode(StrConstant.EPMETY_STR); + } + return houseInfo; + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index b8f3bfef66..f3698b35ed 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -368,7 +368,8 @@ IFNULL(ib.LONGITUDE,'') as buildingLongitude, IFNULL(ib.LATITUDE,'') as buildingLatitude, ih.CUSTOMER_ID AS customerId, - concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName + concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.DOOR_NAME,'')) AS allName, + n.AGENCY_ID as agencyId FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java index 43a40b0d90..8234693f38 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -55,7 +55,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { private Integer isAttention; /** - * 关注类型,核酸检测:2,疫苗接种:1 + * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 */ @NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) private Integer attentionType; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java index ae5c05bede..aba428a576 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java @@ -1,8 +1,20 @@ package com.epmet.dto; +import com.alibaba.excel.annotation.ExcelIgnore; +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.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.Date; -import lombok.Data; /** @@ -11,79 +23,120 @@ import lombok.Data; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) @Data public class IcFollowUpRecordDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AddInternalGroup { + } + public interface AddUserRequired extends CustomerClientShowGroup { + } + /** * 主键ID */ + @ExcelIgnore private String id; /** * 客户Id */ + @ExcelIgnore private String customerId; /** * 姓名 */ + @ColumnWidth(20) + @ExcelProperty("姓名") + @NotBlank(message = "姓名不能为空", groups = {AddUserRequired.class}) private String name; /** * 手机号 */ + @ColumnWidth(20) + @ExcelProperty("手机号") + @NotBlank(message = "手机号不能为空", groups = {AddUserRequired.class}) private String mobile; /** * 身份证号 */ + @ColumnWidth(25) + @ExcelProperty("身份证号") + @NotBlank(message = "身份证号不能为空", groups = {AddUserRequired.class}) private String idCard; /** * 0行程上报,1疫苗接种,2核酸检测 */ + @ColumnWidth(25) + @ExcelProperty("来源") + @NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddInternalGroup.class}) private String origin; /** * 随访时间 */ + @ColumnWidth(25) + @ExcelProperty("随访时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "随访时间不能为空", groups = {AddUserRequired.class}) private Date visitTime; /** * 随访内容 */ + @ColumnWidth(200) + @ExcelProperty("随访内容") + @NotBlank(message = "随访内容不能为空", groups = {AddUserRequired.class}) + @Length(message = "随访内容最多输入1000字", groups = {AddUserRequired.class}) private String content; + /** + * 工作人员所属组织id + */ + @ExcelIgnore + private String agencyId; + /** * 删除标识 1删除;0未删除 */ + @ExcelIgnore private String delFlag; /** * 乐观锁 */ + @ExcelIgnore private Integer revision; /** * 创建人 */ + @ExcelIgnore private String createdBy; /** * 创建时间 */ + @ExcelIgnore private Date createdTime; /** * 更新人 */ + @ExcelIgnore private String updatedBy; /** * 更新时间 */ + @ExcelIgnore private Date updatedTime; } \ 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 deb2abaed1..47d23549da 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 @@ -1,5 +1,10 @@ package com.epmet.dto; +import com.alibaba.excel.annotation.ExcelIgnore; +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; @@ -13,6 +18,7 @@ import java.util.Date; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) @Data public class IcTripReportRecordDTO implements Serializable { @@ -21,137 +27,192 @@ public class IcTripReportRecordDTO implements Serializable { /** * 主键ID */ + @ExcelIgnore private String id; /** * 居民端用户所在网格id,数字社区居民所属网格id */ + @ExcelIgnore private String gridId; /** * 居民端上报的:存储用户所在网格的组织id; */ + @ExcelIgnore private String agencyId; /** * agency_id的所有上级 */ + @ExcelIgnore private String pids; /** * 客户Id */ + @ExcelIgnore private String customerId; /** * 姓名 */ + @ColumnWidth(15) + @ExcelProperty("姓名") private String name; /** * 手机号 */ + @ColumnWidth(15) + @ExcelProperty("手机号") private String mobile; /** * 身份证号 */ + @ColumnWidth(22) + @ExcelProperty("身份证号") private String idCard; /** * 用户id */ + @ExcelIgnore private String userId; /** * 居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import */ + @ExcelIgnore private String userType; /** * 现居地编码 */ + @ExcelIgnore private String presentAddressCode; + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + @ExcelIgnore + private String presentAddressPathCode; + /** * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 */ + @ColumnWidth(50) + @ExcelProperty("现居地") private String presentAddress; /** * 详细地址 */ + @ColumnWidth(35) + @ExcelProperty("详细地址") private String detailAddress; /** * 来源地区编码 */ + @ExcelIgnore private String sourceAddressCode; + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + @ExcelIgnore + private String sourceAddressPathCode; + /** * 来源地区地址 */ + @ColumnWidth(50) + @ExcelProperty("来自地区") private String sourceAddress; /** * 到达日期 */ + @ColumnWidth(25) + @ExcelProperty("来到本地时间") @JsonFormat(pattern = "yyyy-MM-dd") private Date arriveDate; /** * 离开日期 */ + @ColumnWidth(25) + @ExcelProperty("离开本地时间") @JsonFormat(pattern = "yyyy-MM-dd") private Date leaveDate; + /** + * pc行程上报-列表返参:最近一次通知时间 + */ + @ColumnWidth(25) + @ExcelProperty("最近一次通知时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date latestNoticeTime; + /** * 备注信息 */ + @ColumnWidth(100) + @ExcelProperty("备注") private String remark; /** * 删除标识 1删除;0未删除 */ + @ExcelIgnore private String delFlag; /** * 乐观锁 */ + @ExcelIgnore private Integer revision; /** * 创建人 */ + @ExcelIgnore private String createdBy; /** * 创建时间 */ + @ExcelIgnore @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createdTime; /** * 更新人 */ + @ExcelIgnore private String updatedBy; /** * 更新时间 */ + @ExcelIgnore @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updatedTime; + @ExcelIgnore @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Date reportTime; - /** - * pc行程上报-列表返参:最近一次通知时间 - */ - private Date latestNoticeTime; /** * pc行程上报-列表返参:是否加入核酸检测关注名单:true:已加入;false:未加入 */ + @ExcelIgnore private Boolean heSuanCheck; + + @ColumnWidth(20) + @ExcelProperty("核算检测关注名单") + private String heSuanCheckDesc; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index 73928633fb..b67375b5c5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -20,10 +21,13 @@ public class AddIcNatFormDTO implements Serializable { public interface Nat extends CustomerClientShowGroup { } + public interface Edit extends CustomerClientShowGroup { + } /** * 核酸记录Id,修改时使用 */ + @NotBlank(message = "组织Id不能为空", groups = Edit.class) private String icNatId; /** * 当前网格所属组织Id @@ -57,7 +61,7 @@ public class AddIcNatFormDTO implements Serializable { /** * 检测时间 */ - //@NotBlank(message = "检测时间不能为空", groups = Nat.class) + @NotNull(message = "检测时间不能为空", groups = Nat.class) @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date natTime; /** @@ -92,6 +96,7 @@ public class AddIcNatFormDTO implements Serializable { //token中信息 private String customerId; + private String staffId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java index f0c8f9a900..183c59195f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java @@ -28,7 +28,7 @@ public class CancelAttentionPackageFormDTO implements Serializable { private List idCards; /** - * 关注类型,核酸检测:2,疫苗接种:1 + * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 */ @NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class) private Integer attentionType ; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java index f8d6f90ef7..3de314d424 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java @@ -68,9 +68,15 @@ public class IcTripReportFormDTO implements Serializable { /** * 现居地编码 */ - @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) private String presentAddressCode; + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) + private String presentAddressPathCode; + /** * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 */ @@ -86,9 +92,15 @@ public class IcTripReportFormDTO implements Serializable { /** * 来源地区编码 */ - @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) private String sourceAddressCode; + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) + private String sourceAddressPathCode; + /** * 来源地区地址 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index e9620dc5d2..157bc89a27 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -14,8 +14,6 @@ import javax.validation.constraints.NotBlank; public class MyNatListFormDTO extends PageFormDTO { private static final long serialVersionUID = 9156247659994638103L; - public interface MyNat extends CustomerClientShowGroup { - } public interface Detail extends CustomerClientShowGroup { } public interface Del extends CustomerClientShowGroup { @@ -26,7 +24,6 @@ public class MyNatListFormDTO extends PageFormDTO { /** * 身份证号 */ - @NotBlank(message = "身份证号不能为空", groups = MyNat.class) private String idCard; /** * 当前组织:current 根组织:all diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java new file mode 100644 index 0000000000..ab4a416d9e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + + +@Data +public class PageFollowUpFormDTO extends PageFormDTO { + + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class}) + private String idCard; + + @NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class}) + private String name; + + /** + * 0行程上报,1疫苗接种,2核酸检测 + */ + @NotBlank(message = "origin不能为空:0行程上报,1疫苗接种,2核酸检测", groups = {AddUserInternalGroup.class}) + private String origin; + + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java index b5c4aa2462..af23243c03 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java @@ -28,7 +28,10 @@ public class PageTripReportFormDTO extends PageFormDTO implements Serializable { * 来源地区编码 */ private String sourceAddressCode; - + /** + * 来源地区名称 + */ + private String sourceAddress; /** * 来到本地时间 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java index ec8d2a3932..fc69f5da84 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java @@ -20,7 +20,7 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable public interface VaccinationListForm{} /** - * 关注类型,核酸检测:2,疫苗接种:1 + * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 */ @NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class) private Integer attentionType; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java index 19b5c8c792..73b7d77ca6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java @@ -13,4 +13,5 @@ public class DemandUserResDTO implements Serializable { private String gridId; private String idCard; private String agencyId; + private String houseId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java new file mode 100644 index 0000000000..3e40404466 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java @@ -0,0 +1,46 @@ +package com.epmet.enums; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:17 + * @DESC + */ +public enum AttentionTypeEnum { + + XCSB(0,"行程上报"), + YMJZ(1,"疫苗接种"), + NAT(2,"核酸检测") + ; + + private Integer key; + private String value; + + AttentionTypeEnum(Integer key, String value) { + this.key = key; + this.value = value; + } + + public static Integer getKeyByValue(String value){ + if (StringUtils.isBlank(value)){ + return NumConstant.ZERO; + } + for (AttentionTypeEnum a : AttentionTypeEnum.values()) { + if (a.getValue().equals(value)){ + return a.getKey(); + } + } + return NumConstant.ZERO; + } + + public Integer getKey() { + return key; + } + + public String getValue() { + return value; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java new file mode 100644 index 0000000000..d0df62c66f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java @@ -0,0 +1,44 @@ +package com.epmet.enums; + +import com.epmet.commons.tools.constant.NumConstant; +import org.apache.commons.lang3.StringUtils; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:35 + * @DESC + */ +public enum ChannelEnum { + + MINI("0","小程序"), + MSG("1","短信") + ; + + private String key; + private String value; + + ChannelEnum(String key, String value) { + this.key = key; + this.value = value; + } + + public static String getKeyByValue(String value){ + if (StringUtils.isBlank(value)){ + return NumConstant.ONE_STR; + } + for (ChannelEnum a : ChannelEnum.values()) { + if (a.getValue().equals(value)){ + return a.getKey(); + } + } + return NumConstant.ONE_STR; + } + + public String getKey() { + return key; + } + + public String getValue() { + return value; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java index 7ed8b936e2..10394a9987 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java @@ -72,13 +72,15 @@ public class IcEpidemicPreventionController{ * @Date 2022/3/29 16:13 */ @PostMapping("detail") - public Result detail(@RequestBody EpidemicPreventionFormDTO formDTO) { + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO); return new Result().ok(result); } @PostMapping("info") - public Result info(@RequestBody EpidemicPreventionFormDTO formDTO) { + public Result info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO); return new Result().ok(result); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 8035d509b3..1017075ac6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -1,26 +1,38 @@ package com.epmet.controller; +import cn.afterturn.easypoi.excel.entity.TemplateExportParams; 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.dto.form.PageFormDTO; +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.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.NatExportExcel; -import com.epmet.excel.UserResiRegisterVisitExcel; +import com.epmet.excel.NatImportExcel; import com.epmet.excel.VaccinationExportExcel; +import com.epmet.excel.VaccinationImportExcel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcEpidemicSpecialAttentionService; +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.ArrayList; +import java.util.HashMap; +import java.util.Map; /** @@ -31,10 +43,13 @@ import javax.servlet.http.HttpServletResponse; */ @RestController @RequestMapping("icEpidemicSpecialAttention") +@Slf4j public class IcEpidemicSpecialAttentionController { @Autowired private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; /** * Desc: 【疫苗接种关注名单,疫苗接种关注名单】列表 @@ -75,9 +90,9 @@ public class IcEpidemicSpecialAttentionController { */ @PostMapping("vaccination-update") @NoRepeatSubmit - public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){ + public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO,@LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class); - icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO); + icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto); return new Result(); } @@ -102,8 +117,42 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:40 */ @PostMapping("vaccination-import") - public Result vaccinationImport(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){ - + public Result vaccinationImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){ + if (file.isEmpty()) { + throw new EpmetException("请上传文件"); + } + // 校验文件类型 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (!"xls".equals(extension) && !"xlsx".equals(extension)) { + throw new EpmetException("文件类型不匹配"); + } + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOriginFileName(file.getOriginalFilename()); + importTaskForm.setOperatorId(tokenDto.getUserId()); + if (attentionType.equals(NumConstant.ONE)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_VACCINATION); + }else if (attentionType.equals(NumConstant.TWO)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_NAT); + }else if (attentionType.equals(NumConstant.ZERO)){ + importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_TRIP_REPORT); + } + 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("读取文件失败"); + } + icEpidemicSpecialAttentionService.importFile(tokenDto,inputStream,attentionType,result.getData().getTaskId()); return new Result(); } @@ -122,7 +171,7 @@ public class IcEpidemicSpecialAttentionController { formDTO.setUserId(tokenDto.getUserId()); formDTO.setPage(false); PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO); - // 关注类型,核酸检测:2,疫苗接种:1 + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 if (formDTO.getAttentionType().equals(NumConstant.ONE)){ ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class); }else { @@ -131,4 +180,22 @@ public class IcEpidemicSpecialAttentionController { } + @PostMapping("export-template") + public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams(); + String fileName = ""; + Map map = new HashMap<>(); + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx"); + fileName = "疫苗接种关注名单导入模板"; + map.put("maplist",new ArrayList()); + }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + templatePath.setTemplateUrl("excel/attention_nat_template.xlsx"); + fileName = "核酸检测关注名单导入模板"; + map.put("maplist",new ArrayList()); + } + ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java index 2e717fbe8d..b03ad85ed0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java @@ -1,19 +1,31 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.dto.form.PageFollowUpFormDTO; import com.epmet.service.IcFollowUpRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.util.Date; /** @@ -22,6 +34,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@Slf4j @RestController @RequestMapping("followup") public class IcFollowUpRecordController { @@ -29,9 +42,16 @@ public class IcFollowUpRecordController { @Autowired private IcFollowUpRecordService icFollowUpRecordService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icFollowUpRecordService.page(params); + /** + * 随访记录-列表 + * @param formDTO + * @return + */ + @PostMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class); + PageData page = icFollowUpRecordService.page(formDTO); return new Result>().ok(page); } @@ -41,11 +61,17 @@ public class IcFollowUpRecordController { return new Result().ok(data); } + /** + * 随访记录-新增 + * @param dto + * @return + */ @NoRepeatSubmit @PostMapping("save") - public Result save(@RequestBody IcFollowUpRecordDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcFollowUpRecordDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setCreatedBy(tokenDto.getUserId()); + ValidatorUtils.validateEntity(dto, IcFollowUpRecordDTO.AddUserRequired.class,IcFollowUpRecordDTO.AddInternalGroup.class); icFollowUpRecordService.save(dto); return new Result(); } @@ -67,6 +93,57 @@ public class IcFollowUpRecordController { return new Result(); } + /** + * 随访记录-导出 + * 目前是导出个人 + * @param tokenDto + * @param formDTO + * @param response + */ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + //formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + formDTO.setPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + //导出文件名:张三随访记录0330 + String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); + String fileName = formDTO.getName().concat("随访记录").concat(today).concat(".xlsx"); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcFollowUpRecordDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); + PageData data = null; + do { + data = icFollowUpRecordService.page(formDTO); + data.getList().forEach(o->{ + //0行程上报,1疫苗接种,2核酸检测 + switch(o.getOrigin()){ + case NumConstant.ZERO_STR: + o.setOrigin("行程上报"); + break; + case NumConstant.ONE_STR: + o.setOrigin("疫苗接种"); + break; + case NumConstant.TWO_STR: + o.setOrigin("核酸检测"); + break; + } + }); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize()); + }catch (Exception e){ + log.error("export exception", e); + }finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } } 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 95814147cb..d6ff6b6af7 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 @@ -75,6 +75,7 @@ public class IcNatController implements ResultDataResolver { public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); icNucleinService.add(formDTO); return new Result(); } @@ -86,8 +87,8 @@ public class IcNatController implements ResultDataResolver { @NoRepeatSubmit @PostMapping("mynatlist") public Result> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.MyNat.class); formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(icNucleinService.myNatList(formDTO)); } @@ -121,7 +122,9 @@ public class IcNatController implements ResultDataResolver { @NoRepeatSubmit @PostMapping("edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Edit.class); formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); icNucleinService.edit(formDTO); 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 36d1c39e53..4b4fff68f8 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 @@ -1,10 +1,15 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IcResiUserConstant; @@ -13,6 +18,8 @@ import com.epmet.dto.form.IcTripReportFormDTO; import com.epmet.dto.form.MyReportedTripFormDTO; import com.epmet.dto.form.PageTripReportFormDTO; import com.epmet.service.IcTripReportRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +40,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2022-03-25 */ +@Slf4j @RestController @RequestMapping("tripreport") public class IcTripReportRecordController { @@ -46,7 +54,7 @@ public class IcTripReportRecordController { * @param formDTO * @return */ - @RequestMapping("page") + @PostMapping("page") public Result> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); @@ -157,5 +165,42 @@ public class IcTripReportRecordController { } } + /** + * pc:行程上报-导出 + * @param tokenDto + * @param formDTO + * @param response + */ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody PageTripReportFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + // formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + // formDTO.setUserId("35005df15fb0f7c791344f0b424870b7"); + formDTO.setPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + // 这里 需要指定写用哪个class去写 + String fileName = "行程上报.xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); + PageData data = null; + do { + data = icTripReportRecordService.page(formDTO); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + } catch (Exception e) { + log.error("export exception", e); + } finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java index 6115d34c1b..ba1564855e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -8,7 +8,6 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.Set; /** * 疫情特别关注 @@ -60,5 +59,5 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") Set idCardSet, @Param("attentionType") Integer attentionType); + List getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List idCardSet, @Param("attentionType") Integer attentionType); } \ No newline at end of file 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 97b365bb6f..22afc94f76 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 @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IcNatDTO; import com.epmet.dto.form.MyNatListFormDTO; import com.epmet.dto.result.MyNatListResultDTO; import com.epmet.dto.result.NatListResultDTO; @@ -42,4 +43,10 @@ public interface IcNatDao extends BaseDao { * @param e */ void insertOrUpdate(IcNatEntity e); + + /** + * @Author sun + * @Description 按条件查询业务数据 + **/ + IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java index 3ade140ffa..52e6ff132f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java @@ -47,7 +47,7 @@ public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity { private Integer isAttention; /** - * 关注类型,核酸检测:2,疫苗接种:1 + * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 */ private Integer attentionType; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java index 4d9e6de99e..8f976d02b2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java @@ -56,4 +56,8 @@ public class IcFollowUpRecordEntity extends BaseEpmetEntity { */ private String content; + /** + * 工作人员所属组织id + */ + private String agencyId; } 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 0b7d4fd4fd..f14eb97013 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 @@ -71,6 +71,11 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity { */ private String presentAddressCode; + /** + * 现居地编码路径:"presentAddressPathCode":"37,3702,370203,370203026,370203026002" + */ + private String presentAddressPathCode; + /** * 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区 */ @@ -86,6 +91,11 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity { */ private String sourceAddressCode; + /** + * 来源地编码路径: "sourceAddressPathCode": "37,3702,370203,370203026,370203026002" + */ + private String sourceAddressPathCode; + /** * 来源地区地址 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java new file mode 100644 index 0000000000..2f690d2d7c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java @@ -0,0 +1,66 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/29 15:47 + * @DESC + */ +@Data +public class ImportEpidemicSpecialAttention extends ExcelVerifyInfo { + + /** + * 姓名 + */ + @Excel(name = "姓名") + private String name; + + /** + * 手机号 + */ + @Excel(name = "手机号") + private String mobile; + + /** + * 身份证号 + */ + @Excel(name = "身份证号") + private String idCard; + + /** + * 原因 + */ + @Excel(name = "关注原因") + private String reason; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remark; + + @ExcelIgnore + private Integer attentionType; + + @Excel(name = "通知内容") + private String content; + + @Excel(name = "通知渠道") + private String channelString; + + @ExcelIgnore + private List channel; + + @ExcelIgnore + private Boolean addStatus = false; + + @ExcelIgnore + private Integer num; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java new file mode 100644 index 0000000000..e332fe88df --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java @@ -0,0 +1,30 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class NatImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "关注原因") + private String reason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java new file mode 100644 index 0000000000..b7349e4d03 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java @@ -0,0 +1,27 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class VaccinationImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java new file mode 100644 index 0000000000..ef007cfa4c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java @@ -0,0 +1,29 @@ +package com.epmet.excel.error; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 16:57 + * @DESC + */ +@Data +public class EpidemicSpecialAttentionErrorModel { + + @Excel(name = "行号",width = 10) + private Integer num; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "错误信息", width = 200) + private String errorMsg; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index 8883fa0f28..8a6eb03f04 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -2,15 +2,16 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.CancelAttentionPackageFormDTO; import com.epmet.dto.form.VaccinationAddFormDTO; import com.epmet.dto.form.VaccinationListFormDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; +import java.io.InputStream; import java.util.List; import java.util.Map; -import java.util.Set; /** * 疫情特别关注 @@ -103,7 +104,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService getHeSuanIdCardList(String customerId,Set idCardSet); + List getHeSuanIdCardList(String customerId,List idCardSet); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java index 7183ae1e4d..7bdc1a1da5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.dto.form.PageFollowUpFormDTO; import com.epmet.entity.IcFollowUpRecordEntity; import java.util.List; @@ -17,14 +18,14 @@ import java.util.Map; public interface IcFollowUpRecordService extends BaseService { /** - * 默认分页 + * 随访记录-列表 * - * @param params + * @param formDTO * @return PageData * @author generator * @date 2022-03-25 */ - PageData page(Map params); + PageData page(PageFollowUpFormDTO formDTO); /** * 默认查询 @@ -47,7 +48,7 @@ public interface IcFollowUpRecordService extends BaseService { * @Author zhaoqifeng * @Date 2022/3/29 16:29 */ - List getNatList(String idCard); + List getNatList(String customerId, String idCard); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java index 13529cadbf..3f72855558 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -10,7 +10,6 @@ import com.epmet.entity.IcNoticeEntity; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.Set; /** * 防疫通知 @@ -104,5 +103,5 @@ public interface IcNoticeService extends BaseService { * @param idCardSet * @return */ - Map getUserLatestNoticeTime(String customerId,Set idCardSet); + Map getUserLatestNoticeTime(String customerId,List idCardSet); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java index 44207d875f..c1b2ea0655 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcResiVaccineDTO; +import com.epmet.dto.result.VaccineListDTO; import com.epmet.entity.IcResiVaccineEntity; import java.util.List; @@ -75,4 +76,14 @@ public interface IcResiVaccineService extends BaseService { * @date 2022-03-28 */ void delete(String[] ids); + + /** + * 获取居民疫苗接种信息 + * + * @Param idCard + * @Return {@link List< VaccineListDTO>} + * @Author zhaoqifeng + * @Date 2022/3/30 10:24 + */ + List getVaccineList(String customerId, String idCard); } \ No newline at end of file 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 bc19691e60..a7f961542d 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 @@ -6,6 +6,7 @@ import com.epmet.dto.IcTripReportRecordDTO; import com.epmet.dto.form.IcTripReportFormDTO; import com.epmet.dto.form.MyReportedTripFormDTO; import com.epmet.dto.form.PageTripReportFormDTO; +import com.epmet.dto.result.TripListDTO; import com.epmet.entity.IcTripReportRecordEntity; import java.util.List; @@ -82,4 +83,14 @@ public interface IcTripReportRecordService extends BaseService resiList(MyReportedTripFormDTO formDTO); + + /** + * 获取居民行程信息 + * + * @Param idCard + * @Return {@link List< TripListDTO>} + * @Author zhaoqifeng + * @Date 2022/3/30 10:31 + */ + List tripList(String customerId, String idCard); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 2362052dc1..83d2ed51cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -1,5 +1,7 @@ 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.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -8,26 +10,48 @@ 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.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; -import com.epmet.dto.form.CancelAttentionPackageFormDTO; -import com.epmet.dto.form.VaccinationAddFormDTO; -import com.epmet.dto.form.VaccinationListFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.VaccinationListResultDTO; import com.epmet.entity.IcEpidemicSpecialAttentionEntity; +import com.epmet.enums.ChannelEnum; +import com.epmet.excel.ImportEpidemicSpecialAttention; +import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.service.IcEpidemicSpecialAttentionService; +import com.epmet.service.IcNoticeService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.fileupload.FileItem; +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.util.*; import java.util.stream.Collectors; @@ -38,8 +62,16 @@ import java.util.stream.Collectors; * @since v1.0.0 2022-03-28 */ @Service +@Slf4j public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl implements IcEpidemicSpecialAttentionService { + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private OssFeignClient ossFeignClient; + @Autowired + private IcNoticeService noticeService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -106,7 +138,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO)); @@ -175,7 +207,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSedNotice)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSedNotice, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSedNotice.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSedNotice.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSedNotice.get(NumConstant.ZERO).getContent()); + dto.setStaffId(formDTO.getUserId()); + noticeService.sendNotice(dto); + } } /** @@ -188,7 +232,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity(); w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard()) @@ -197,7 +241,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl errorInfo = new ArrayList<>(); + + try { + List list = ExcelPoiUtils.importExcel(inputStream, 0,1,ImportEpidemicSpecialAttention.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()); + } + for (int i = 0; i < list.size(); i++) { + list.get(i).setNum(i+1); + list.get(i).setAttentionType(attentionType); +// list.get(i).setChannel(getChannel(list.get(i).getChannelString())); + if (StringUtils.isBlank(list.get(i).getName()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "姓名不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i), "身份证号不能为空",i+1)); + list.get(i).setAddStatus(true); + continue; + } + if (StringUtils.isBlank(list.get(i).getMobile()) && !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(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting())); + groupByIdCard.forEach((idCard,count) -> { + if (Integer.valueOf(count.toString()).compareTo(1) != 0){ + for (ImportEpidemicSpecialAttention i : list) { + if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ + errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); + i.setAddStatus(true); + } + } + } + }); + List idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); + List existList = baseDao.getExistList(attentionType, idCards); + if (CollectionUtils.isNotEmpty(existList)){ + for (String s : existList) { + for (int i = NumConstant.ZERO; i < list.size(); i++) { + if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum())); + list.get(i).setAddStatus(true); + continue; + } + } + } + } + } + Map> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus)); + List needInsert = groupByStatus.get(false); + if (CollectionUtils.isNotEmpty(needInsert)){ + List entities = ConvertUtils.sourceToTarget(needInsert, IcEpidemicSpecialAttentionEntity.class); + entities.forEach(e -> { + e.setIsAttention(NumConstant.ONE); + e.setOrgId(agencyInfo.getId()); + e.setPid(agencyInfo.getPid()); + e.setPids(agencyInfo.getPids()); + e.setCustomerId(tokenDto.getCustomerId()); + }); + insertBatch(entities); + // send msg 产品说导入不用发通知 + /*List needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSendList)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSendList.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSendList.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSendList.get(NumConstant.ZERO).getContent()); + dto.setStaffId(tokenDto.getUserId()); + noticeService.sendNotice(dto); + }*/ + } + if (CollectionUtils.isNotEmpty(errorInfo)){ + String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.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,""); + } + } + + public List getChannel(String channelString){ + List result = new ArrayList<>(); + if (StringUtils.isBlank(channelString)){ + return result; + } + String[] split = channelString.split(","); + for (String s : split) { + result.add(ChannelEnum.getKeyByValue(s)); + } + return result; + } + + /** + * Desc: 关闭任务 + * @param taskId + * @param userId + * @param status + * @param url + * @author zxc + * @date 2022/3/30 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 zxc + * @date 2022/3/29 17:17 + */ + public EpidemicSpecialAttentionErrorModel getErrorInfo(ImportEpidemicSpecialAttention dto,String info,Integer num){ + EpidemicSpecialAttentionErrorModel result = ConvertUtils.sourceToTarget(dto, EpidemicSpecialAttentionErrorModel.class); + result.setErrorMsg(info); + result.setNum(num); + return result; + } + /** * 传入身份证集合,返回已经关注的身份证号列表 * @@ -221,12 +432,58 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl getHeSuanIdCardList(String customerId,Set idCardSet) { + public List getHeSuanIdCardList(String customerId,List idCardSet) { if(CollectionUtils.isEmpty(idCardSet)){ return new ArrayList<>(); } - //关注类型,核酸检测:2,疫苗接种:1 - return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO); + //关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + return baseDao.getIdCardList(customerId,idCardSet,NumConstant.ZERO); + } + + /** + * Desc: 文件上传并返回url + * @param errorRows + * @param tClass + * @author zxc + * @date 2022/3/30 09:16 + */ + 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(); } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java index 40d380278a..eb9255a8ec 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java @@ -1,15 +1,22 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcFollowUpRecordDao; import com.epmet.dto.IcFollowUpRecordDTO; +import com.epmet.dto.form.PageFollowUpFormDTO; import com.epmet.entity.IcFollowUpRecordEntity; import com.epmet.service.IcFollowUpRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -28,13 +35,23 @@ import java.util.Map; public class IcFollowUpRecordServiceImpl extends BaseServiceImpl implements IcFollowUpRecordService { + /** + * 随访记录-列表 + * @param formDTO + * @return + */ @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcFollowUpRecordDTO.class); + public PageData page(PageFollowUpFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(formDTO.getIdCard()),IcFollowUpRecordEntity::getIdCard,formDTO.getIdCard()) + .eq(StringUtils.isNotBlank(formDTO.getName()),IcFollowUpRecordEntity::getName,formDTO.getName()) + .eq(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin()) + .eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId()) + .orderByDesc(IcFollowUpRecordEntity::getVisitTime); + PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage()) + .doSelectPageInfo(() -> baseDao.selectList(wrapper)); + List list=ConvertUtils.sourceToTarget(data.getList(),IcFollowUpRecordDTO.class); + return new PageData(list,data.getTotal()); } @Override @@ -62,7 +79,12 @@ public class IcFollowUpRecordServiceImpl extends BaseServiceImpl imp @Autowired private OssFeignClient ossFeignClient; + @Autowired + private UserBaseInfoDao userBaseInfoDao; + /** * @Author sun * @Description 核酸检测-上报核酸记录 @@ -85,6 +89,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void add(AddIcNatFormDTO formDTO) { + //0.先根据身份证号和检查时间校验数据是否存在 + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + if (null != icNatDTO) { + throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); + } //1.获取所填居民所属组织缓存信息 AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); if (null == agencyInfo) { @@ -105,7 +114,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp dto.setChannel(formDTO.getChannel()); dto.setOrigin("2"); dto.setContent(formDTO.getContent()); - dto.setOrgName(agencyInfo.getOrganizationName()); + dto.setStaffId(formDTO.getStaffId()); icNoticeService.sendNotice(dto); } @@ -117,7 +126,10 @@ public class IcNatServiceImpl extends BaseServiceImpl imp **/ @Override public List myNatList(MyNatListFormDTO formDTO) { - //1.根据身份证号查询该人员所有核酸记录(居民端录入、数字平台录入、数字平台导入) + //1.根据token信息查询居民身份证号 + UserBaseInfoResultDTO dto = userBaseInfoDao.selectListByUserIdList(formDTO.getUserId()); + formDTO.setIdCard(dto.getIdNum()); + //2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入) List resultList = baseDao.getMyNatList(formDTO); return resultList; } @@ -176,6 +188,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void edit(AddIcNatFormDTO formDTO) { + //0.先根据身份证号和检测时间校验除当前数据是否还存在相同数据 + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + if (null != icNatDTO) { + throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); + } //1.更新核酸记录表数据 IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class); entity.setId(formDTO.getIcNatId()); @@ -186,12 +203,6 @@ public class IcNatServiceImpl extends BaseServiceImpl imp //3.新增通知表信息 if (CollectionUtils.isNotEmpty(formDTO.getChannel())) { - IcNatEntity icNatEntity = baseDao.selectById(formDTO.getIcNatId()); - //1.获取所填居民所属组织缓存信息 - AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(icNatEntity.getAgencyId()); - if (null == agencyInfo) { - throw new RenException(String.format("获取组织缓存信息失败%s", icNatEntity.getAgencyId())); - } SendNoticeFormDTO dto = new SendNoticeFormDTO(); List userList = new ArrayList<>(); userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); @@ -200,7 +211,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp dto.setChannel(formDTO.getChannel()); dto.setOrigin("2"); dto.setContent(formDTO.getContent()); - dto.setOrgName(agencyInfo.getOrganizationName()); + dto.setStaffId(formDTO.getStaffId()); icNoticeService.sendNotice(dto); } } @@ -341,8 +352,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @Date 2022/3/29 16:29 */ @Override - public List getNatList(String idCard) { + public List getNatList(String customerId, String idCard) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNatEntity::getCustomerId, customerId); wrapper.eq(IcNatEntity::getIdCard, idCard); wrapper.orderByDesc(IcNatEntity::getNatTime); List list = baseDao.selectList(wrapper); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index 3a224d8540..c306bec8aa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -225,7 +225,7 @@ public class IcNoticeServiceImpl extends BaseServiceImpl getUserLatestNoticeTime(String customerId,Set idCardSet) { + public Map getUserLatestNoticeTime(String customerId,List idCardSet) { Map map=new HashMap<>(); for(String idCard:idCardSet) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); 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 e7d124a71d..2b02a65fb5 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 @@ -120,6 +120,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -1326,10 +1330,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl natList = icNatService.getNatList(icResiUser.getIdCard()); + List natList = icNatService.getNatList(formDTO.getCustomerId(), icResiUser.getIdCard()); result.setNatList(natList); - //TODO 疫苗接种 - //TODO 行程信息 + //疫苗接种 + List vaccineList = icResiVaccineService.getVaccineList(formDTO.getCustomerId(), icResiUser.getIdCard()); + result.setVaccineList(vaccineList); + //行程信息 + List tripList = icTripReportRecordService.tripList(formDTO.getCustomerId(), icResiUser.getIdCard()); + result.setTripList(tripList); } return result; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java index c8c586137a..2f5f0b0928 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java @@ -1,23 +1,28 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.IcResiVaccineDao; import com.epmet.dto.IcResiVaccineDTO; +import com.epmet.dto.result.VaccineListDTO; import com.epmet.entity.IcResiVaccineEntity; import com.epmet.service.IcResiVaccineService; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 居民疫苗情况 @@ -80,4 +85,32 @@ public class IcResiVaccineServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/3/30 10:24 + */ + @Override + public List getVaccineList(String customerId, String idCard) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiVaccineEntity::getCustomerId, customerId); + wrapper.eq(IcResiVaccineEntity::getIdCard, idCard); + wrapper.orderByDesc(IcResiVaccineEntity::getInoculateTime); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + VaccineListDTO dto = new VaccineListDTO(); + dto.setAddress(item.getInoculateAddress()); + dto.setManufactor(item.getManufacturer()); + dto.setVaccinateTime(DateUtils.format(item.getInoculateTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + return dto; + }).collect(Collectors.toList()); + } + } \ No newline at end of file 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 e1c58337fa..5c42a0d00e 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 @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -13,12 +14,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IcResiUserConstant; import com.epmet.dao.IcTripReportRecordDao; import com.epmet.dao.UserBaseInfoDao; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.IcTripReportRecordDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.TripListDTO; import com.epmet.entity.IcTripReportRecordEntity; import com.epmet.service.IcEpidemicSpecialAttentionService; import com.epmet.service.IcNoticeService; @@ -27,6 +30,7 @@ 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.collections4.ListUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -69,14 +73,24 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl list = data.getList(); //3.查询最近一次通知时间、核算检测关注名单 if (CollectionUtils.isNotEmpty(list)) { - Set idCardSet = list.stream().map(m -> m.getIdCard()).collect(Collectors.toSet()); - Map latestNotice = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(),idCardSet); - List gzIdCardList = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(),idCardSet); + 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())); @@ -158,6 +172,7 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/3/30 10:31 + */ + @Override + public List tripList(String customerId, String idCard) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcTripReportRecordEntity::getCustomerId, customerId); + wrapper.eq(IcTripReportRecordEntity::getIdCard, idCard); + wrapper.orderByDesc(IcTripReportRecordEntity::getArriveDate); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + TripListDTO dto = new TripListDTO(); + dto.setArrivalTime(DateUtils.format(item.getArriveDate(), DateUtils.DATE_PATTERN)); + dto.setFromRegion(item.getSourceAddress()); + dto.setLeaveTime(DateUtils.format(item.getLeaveDate(), DateUtils.DATE_PATTERN)); + dto.setRemark(item.getRemark()); + return dto; + }).collect(Collectors.toList()); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__modify_trip_report.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql similarity index 100% rename from epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__modify_trip_report.sql rename to epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql new file mode 100644 index 0000000000..a41ed606c6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql @@ -0,0 +1,21 @@ +CREATE TABLE `ic_resi_vaccine` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `NAME` varchar(64) NOT NULL COMMENT '姓名', + `MOBILE` varchar(11) NOT NULL COMMENT '手机号', + `ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', + `INOCULATE_TIME` datetime NOT NULL COMMENT '接种时间', + `INOCULATE_ADDRESS` varchar(32) NOT NULL DEFAULT '' COMMENT '接种地点', + `MANUFACTURER` varchar(32) NOT NULL DEFAULT '' COMMENT '疫苗厂家', + `FIELD1` varchar(32) DEFAULT NULL COMMENT '预留字段1', + `FIELD2` varchar(255) DEFAULT NULL COMMENT '预留字段2', + `FIELD3` varchar(255) DEFAULT NULL COMMENT '预留字段3', + `REMAEK` varchar(255) 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`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='居民疫苗情况'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql new file mode 100644 index 0000000000..a7e6ad6382 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql @@ -0,0 +1,2 @@ +alter table ic_trip_report_record MODIFY COLUMN PRESENT_ADDRESS_CODE VARCHAR(32) COMMENT '现居地编码'; +alter table ic_trip_report_record MODIFY COLUMN SOURCE_ADDRESS_CODE VARCHAR(32) COMMENT '来源地区编码'; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql new file mode 100644 index 0000000000..30d6bd9ac1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql @@ -0,0 +1,3 @@ + ALTER TABLE `ic_nat` + DROP INDEX `unq_nat` , + ADD UNIQUE INDEX `unq_nat` (`ID_CARD`, `NAT_TIME`, `AGENCY_ID`) USING BTREE ; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql new file mode 100644 index 0000000000..927c2f9a35 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql @@ -0,0 +1,2 @@ +alter table ic_trip_report_record add column PRESENT_ADDRESS_PATH_CODE VARCHAR(255) COMMENT '现居地编码全路径' AFTER PRESENT_ADDRESS_CODE; +alter table ic_trip_report_record add column SOURCE_ADDRESS_PATH_CODE VARCHAR(255) COMMENT '来源地区编码全路径' AFTER SOURCE_ADDRESS_CODE; \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx new file mode 100644 index 0000000000..1ef3866f47 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx new file mode 100644 index 0000000000..b186c33b7a Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx index f13d7ec77d..587ecda2e0 100644 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx and b/epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx differ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 67f80a3905..1510da99b8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -7,7 +7,8 @@ UPDATE ic_epidemic_special_attention SET UPDATED_TIME = NOW(), - IS_ATTENTION = 0 + IS_ATTENTION = 0, + del_flag = 1 WHERE del_flag = 0 AND attention_type = #{attentionType} AND id_card IN ( @@ -24,21 +25,21 @@ a.MOBILE, a.ID_CARD, a.REMARK, - IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime, - COUNT(v.ID) AS vaccinationCount + IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime, + IFNULL(v.vaccinationCount,0) AS vaccinationCount FROM ic_epidemic_special_attention a - LEFT JOIN ic_resi_vaccine v ON (v.ID_CARD = a.ID_CARD AND v.DEL_FLAG = '0') + LEFT JOIN (SELECT id_card ,count(1) AS vaccinationCount FROM ic_resi_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD) v ON (v.ID_CARD = a.ID_CARD) WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} AND ATTENTION_TYPE = #{attentionType} - AND a.`NAME` = #{name} + AND a.`NAME` LIKE CONCAT('%',#{name},'%') - AND a.MOBILE = #{mobile} + AND a.MOBILE LIKE CONCAT('%',#{mobile},'%') - AND a.ID_CARD = #{idCard} + AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%') HAVING vaccinationCount = #{vaccinationCount} @@ -54,19 +55,19 @@ a.ID_CARD, a.REMARK, a.REASON, - IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = '1' AND ID_CARD = #{idCard} ORDER BY CREATED_TIME LIMIT 1),'') AS lastInformTime + IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime FROM ic_epidemic_special_attention a WHERE a.DEL_FLAG = 0 AND a.ORG_ID = #{orgId} AND ATTENTION_TYPE = #{attentionType} - AND a.`NAME` = #{name} + AND a.`NAME` LIKE CONCAT('%',#{name},'%') - AND a.MOBILE = #{mobile} + AND a.MOBILE LIKE CONCAT('%',#{mobile},'%') - AND a.ID_CARD = #{idCard} + AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%') AND a.REASON LIKE CONCAT('%',#{reason},'%') 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 28b4129229..06cbc05a85 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 @@ -21,7 +21,12 @@ WHERE del_flag = '0' AND customer_id = #{customerId} - AND id_card = #{idCard} + AND ( + CREATED_BY = #{userId} + + OR id_card = #{idCard} + + ) ORDER BY nat_time DESC @@ -63,6 +68,31 @@ ORDER BY nat_time DESC + + DELETE FROM ic_nat WHERE id = #{icNatId} 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 c68d4e504e..ca26c6bf4e 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 @@ -302,7 +302,8 @@ concat(ir.`NAME`,'(',ir.MOBILE,')')as label, ir.grid_id as gridId, ir.ID_CARD as idCard, - ir.AGENCY_ID as agencyId + ir.AGENCY_ID as agencyId, + ir.HOME_ID as houseId FROM ic_resi_user ir WHERE @@ -672,7 +673,7 @@ AND GRID_ID = #{gridId} - AND NEIGHBOR_HOOD_ID = #{neighborId} + AND VILLAGE_ID = #{neighborId} AND BUILD_ID = #{buildingId} 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 85343a5257..f667e9826d 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 @@ -47,11 +47,14 @@ AND SOURCE_ADDRESS_CODE like concat(#{sourceAddressCode},'%') - - AND ARRIVE_DATE = ]]> #{startTime} + + AND SOURCE_ADDRESS like concat('%',#{sourceAddress},'%') - - AND ARRIVE_DATE #{endTime} + + AND ARRIVE_DATE = ]]> #{startDate} + + + AND ARRIVE_DATE #{endDate} ORDER BY r.CREATED_TIME DESC