Browse Source

Merge branch 'dev_epidemic_situation' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_epidemic_situation

dev
wangxianzhang 3 years ago
parent
commit
95e20f7ec9
  1. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/ChannelEnum.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 3
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  5. 9
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeFormDTO.java
  6. 11
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeResultDTO.java
  7. 12
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java
  8. 12
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java
  9. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java
  10. 31
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  11. 81
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  12. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  13. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  14. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  15. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  16. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  17. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  18. 55
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java
  19. 69
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  20. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  21. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java
  22. 16
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  23. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  24. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java
  25. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java
  26. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  27. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java
  28. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java
  29. 44
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java
  30. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  31. 79
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  32. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
  33. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  34. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  35. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  36. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  37. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java
  38. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java
  39. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java
  40. 66
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java
  41. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java
  42. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java
  43. 29
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java
  44. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  45. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java
  46. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  47. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  48. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java
  49. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  50. 277
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  51. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java
  52. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  53. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  54. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  55. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java
  56. 50
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java
  57. 0
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql
  58. 21
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql
  59. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql
  60. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql
  61. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql
  62. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx
  63. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx
  64. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx
  65. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  66. 32
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  67. 5
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  68. 11
      epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

6
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) {

1
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

2
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 日期

3
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";
/**
* 核酸检测
*/

9
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;
}

11
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;
}

12
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<String>().ok(areaCodeService.addAreaCode(formDTO));
}
/**
* 行政地区编码逐级查询
* @param formDTO
* @return
*/
@PostMapping(value = "nextarea")
public Result<List<AreaCodeResultDTO>> nextArea(@RequestBody AreaCodeFormDTO formDTO){
return new Result<List<AreaCodeResultDTO>>().ok(areaCodeService.nextArea(formDTO));
}
}

12
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<AreaCodeEntity> {
AreaCodeDTO selectByCityCode(String cityCode);
AreaCodeDTO selectMaxCounty(String cityCode);
List<AreaCodeResultDTO> selectProvince();
List<AreaCodeResultDTO> selectCity(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectDistrict(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectStreet(@Param("pCode")String pCode);
List<AreaCodeResultDTO> selectCommunity(@Param("pCode")String pCode);
}

4
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<AreaCodeEntity> {
* @Date 2021/4/13 14:40
**/
String addAreaCode(AddAreaCodeFormDTO formDTO);
List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO);
}

31
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<AreaCodeDao, AreaCodeEn
return areaCode;
}
@Override
public List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){
return baseDao.selectProvince();
}
List<AreaCodeResultDTO> 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);

81
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
</select>
<select id="selectProvince" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.province_code AS areaCode,
ac.province_name AS areaName,
'' AS parentCode,
'province' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
ORDER BY
ac.province_code ASC
</select>
<select id="selectCity" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.city_code AS areaCode,
ac.city_name AS areaName,
ac.province_code AS parentCode,
'city' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
<if test='null != pCode and "" != pCode'>
and ac.province_code=#{pCode}
</if>
ORDER BY
ac.city_code ASC
</select>
<select id="selectDistrict" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT DISTINCT
ac.county_code AS areaCode,
ac.county_name AS areaName,
ac.city_code AS parentCode,
'district' AS LEVEL
FROM
area_code ac
WHERE
ac.DEL_FLAG = '0'
<if test='null != pCode and "" != pCode'>
and ac.city_code=#{pCode}
</if>
ORDER BY
ac.county_code ASC
</select>
<select id="selectStreet" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'street' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
ORDER BY
ac.`code` ASC
</select>
<select id="selectCommunity" resultType="com.epmet.dto.result.AreaCodeResultDTO">
SELECT
ac.`code` AS areaCode,
ac.`name` AS areaName,
ac.p_code AS parentCode,
'community' AS LEVEL
FROM
area_code_child ac
WHERE
ac.DEL_FLAG = '0'
AND ac.USER_DEFINED = '0'
<if test='null != pCode and "" != pCode'>
AND ac.p_code=#{pCode}
</if>
ORDER BY
ac.`code` ASC
</select>
</mapper>

13
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;
}

12
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<HouseInfoDTO> getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){
if(StringUtils.isBlank(houseId)){
return new Result<>();
}
return new Result<HouseInfoDTO>().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId));
}
}

3
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);
}

16
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;
}
}

3
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')

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

55
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;
}

69
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;
}

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

2
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<String> idCards;
/**
* 关注类型核酸检测2疫苗接种1
* 关注类型核酸检测2疫苗接种1行程上报0
*/
@NotNull(message = "attentionType不能为空",groups = CancelAttentionPackageForm.class)
private Integer attentionType ;

16
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;
/**
* 来源地区地址
*/

3
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

28
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;
}

5
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;
/**
* 来到本地时间
*/

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

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

46
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;
}
}

44
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;
}
}

6
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<EpidemicPreventionResultDTO> detail(@RequestBody EpidemicPreventionFormDTO formDTO) {
public Result<EpidemicPreventionResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO);
return new Result<EpidemicPreventionResultDTO>().ok(result);
}
@PostMapping("info")
public Result<EpidemicPreventionInfoDTO> info(@RequestBody EpidemicPreventionFormDTO formDTO) {
public Result<EpidemicPreventionInfoDTO> info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO);
return new Result<EpidemicPreventionInfoDTO>().ok(result);
}

79
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<ImportTaskCommonResultDTO> 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<String,Object> 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<VaccinationImportExcel>());
}else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
templatePath.setTemplateUrl("excel/attention_nat_template.xlsx");
fileName = "核酸检测关注名单导入模板";
map.put("maplist",new ArrayList<NatImportExcel>());
}
ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response);
}
}

93
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<PageData<IcFollowUpRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcFollowUpRecordDTO> page = icFollowUpRecordService.page(params);
/**
* 随访记录-列表
* @param formDTO
* @return
*/
@PostMapping("page")
public Result<PageData<IcFollowUpRecordDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class);
PageData<IcFollowUpRecordDTO> page = icFollowUpRecordService.page(formDTO);
return new Result<PageData<IcFollowUpRecordDTO>>().ok(page);
}
@ -41,11 +61,17 @@ public class IcFollowUpRecordController {
return new Result<IcFollowUpRecordDTO>().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<IcFollowUpRecordDTO> 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();
}
}
}
}

5
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<List<MyNatListResultDTO>> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.MyNat.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<MyNatListResultDTO>>().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();
}

47
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<PageData<IcTripReportRecordDTO>> 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<IcTripReportRecordDTO> 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();
}
}
}
}

3
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<IcEpidemicSpecial
* @param attentionType
* @return
*/
List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") Set<String> idCardSet, @Param("attentionType") Integer attentionType);
List<String> getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List<String> idCardSet, @Param("attentionType") Integer attentionType);
}

7
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<IcNatEntity> {
* @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);
}

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

4
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;
}

10
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;
/**
* 来源地区地址
*/

66
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<String> channel;
@ExcelIgnore
private Boolean addStatus = false;
@ExcelIgnore
private Integer num;
}

30
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;
}

27
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;
}

29
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;
}

17
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<IcEpidemi
* @author zxc
* @date 2022/3/28 13:45
*/
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO);
void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto);
/**
* Desc: 取消关注
@ -113,10 +114,20 @@ public interface IcEpidemicSpecialAttentionService extends BaseService<IcEpidemi
*/
void cancelAttention(CancelAttentionPackageFormDTO formDTO);
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导入
* @param tokenDto
* @param inputStream
* @param attentionType
* @author zxc
* @date 2022/3/29 15:35
*/
void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId);
/**
* 传入身份证集合返回已经关注的身份证号列表
* @param idCardSet
* @return
*/
List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet);
List<String> getHeSuanIdCardList(String customerId,List<String> idCardSet);
}

9
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<IcFollowUpRecordEntity> {
/**
* 默认分页
* 随访记录-列表
*
* @param params
* @param formDTO
* @return PageData<IcFollowUpRecordDTO>
* @author generator
* @date 2022-03-25
*/
PageData<IcFollowUpRecordDTO> page(Map<String, Object> params);
PageData<IcFollowUpRecordDTO> page(PageFollowUpFormDTO formDTO);
/**
* 默认查询
@ -47,7 +48,7 @@ public interface IcFollowUpRecordService extends BaseService<IcFollowUpRecordEnt
IcFollowUpRecordDTO get(String id);
/**
* 默认保存
* 随访记录-新增
*
* @param dto
* @return void

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

@ -77,5 +77,5 @@ public interface IcNatService extends BaseService<IcNatEntity> {
* @Author zhaoqifeng
* @Date 2022/3/29 16:29
*/
List<NatListDTO> getNatList(String idCard);
List<NatListDTO> getNatList(String customerId, String idCard);
}

3
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<IcNoticeEntity> {
* @param idCardSet
* @return
*/
Map<String, Date> getUserLatestNoticeTime(String customerId,Set<String> idCardSet);
Map<String, Date> getUserLatestNoticeTime(String customerId,List<String> idCardSet);
}

11
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<IcResiVaccineEntity> {
* @date 2022-03-28
*/
void delete(String[] ids);
/**
* 获取居民疫苗接种信息
*
* @Param idCard
* @Return {@link List< VaccineListDTO>}
* @Author zhaoqifeng
* @Date 2022/3/30 10:24
*/
List<VaccineListDTO> getVaccineList(String customerId, String idCard);
}

11
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<IcTripReportRecor
* @return
*/
List<IcTripReportRecordDTO> resiList(MyReportedTripFormDTO formDTO);
/**
* 获取居民行程信息
*
* @Param idCard
* @Return {@link List< TripListDTO>}
* @Author zhaoqifeng
* @Date 2022/3/30 10:31
*/
List<TripListDTO> tripList(String customerId, String idCard);
}

277
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<IcEpidemicSpecialAttentionDao, IcEpidemicSpecialAttentionEntity> implements IcEpidemicSpecialAttentionService {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private IcNoticeService noticeService;
@Override
public PageData<IcEpidemicSpecialAttentionDTO> page(Map<String, Object> params) {
IPage<IcEpidemicSpecialAttentionEntity> page = baseDao.selectPage(
@ -106,7 +138,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
throw new EpmetException("未查询到工作人员信息"+formDTO.getUserId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
// 关注类型,核酸检测:2,疫苗接种:1
// 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
if (formDTO.getAttentionType().equals(NumConstant.ONE)){
if (formDTO.isPage()){
PageInfo<VaccinationListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.vaccinationList(formDTO));
@ -175,7 +207,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setCustomerId(formDTO.getCustomerId());
});
insertBatch(entities);
//TODO 发送通知
//新增通知表信息
List<IcEpidemicSpecialAttentionDTO> needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSedNotice)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> 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<IcEpi
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO) {
public void vaccinationUpdate(IcEpidemicSpecialAttentionDTO formDTO,TokenDto tokenDto) {
LambdaQueryWrapper<IcEpidemicSpecialAttentionEntity> w = new LambdaQueryWrapper<>();
IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity();
w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard())
@ -197,7 +241,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
e.setReason(formDTO.getReason());
e.setRemark(formDTO.getRemark());
update(e,w);
//TODO 通知
if (CollectionUtils.isNotEmpty(formDTO.getChannel())){
SendNoticeFormDTO dto = new SendNoticeFormDTO();
SendNoticeFormDTO.UserListBean userListBean = ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class);
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserList(Arrays.asList(userListBean));
dto.setChannel(formDTO.getChannel());
dto.setOrigin(formDTO.getAttentionType().toString());
dto.setContent(formDTO.getContent());
dto.setStaffId(tokenDto.getUserId());
noticeService.sendNotice(dto);
}
}
/**
@ -214,6 +268,163 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl<IcEpi
}
}
/**
* Desc: 疫苗接种关注名单核酸检测关注名单导入
* @param tokenDto
* @param inputStream
* @param attentionType
* @param taskId
* @author zxc
* @date 2022/3/29 15:35
*/
@Override
@Async
public void importFile(TokenDto tokenDto, InputStream inputStream, Integer attentionType, String taskId) {
List<EpidemicSpecialAttentionErrorModel> errorInfo = new ArrayList<>();
try {
List<ImportEpidemicSpecialAttention> 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<String, Long> 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<String> idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList());
List<String> 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<Boolean, List<ImportEpidemicSpecialAttention>> groupByStatus = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getAddStatus));
List<ImportEpidemicSpecialAttention> needInsert = groupByStatus.get(false);
if (CollectionUtils.isNotEmpty(needInsert)){
List<IcEpidemicSpecialAttentionEntity> 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<ImportEpidemicSpecialAttention> needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(needSendList)) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> 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<String> getChannel(String channelString){
List<String> 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<IcEpi
* @return
*/
@Override
public List<String> getHeSuanIdCardList(String customerId,Set<String> idCardSet) {
public List<String> getHeSuanIdCardList(String customerId,List<String> 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 <T> String importOssUpload(Collection<?> errorRows, Class<T> 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<UploadImgResultDTO> 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();
}
}

36
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<IcFollowUpRecordDao, IcFollowUpRecordEntity> implements IcFollowUpRecordService {
/**
* 随访记录-列表
* @param formDTO
* @return
*/
@Override
public PageData<IcFollowUpRecordDTO> page(Map<String, Object> params) {
IPage<IcFollowUpRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcFollowUpRecordDTO.class);
public PageData<IcFollowUpRecordDTO> page(PageFollowUpFormDTO formDTO) {
LambdaQueryWrapper<IcFollowUpRecordEntity> 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<IcFollowUpRecordEntity> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.selectList(wrapper));
List<IcFollowUpRecordDTO> list=ConvertUtils.sourceToTarget(data.getList(),IcFollowUpRecordDTO.class);
return new PageData(list,data.getTotal());
}
@Override
@ -62,7 +79,12 @@ public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecor
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcFollowUpRecordDTO dto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getCreatedBy());
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
IcFollowUpRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcFollowUpRecordEntity.class);
entity.setAgencyId(staffInfo.getAgencyId());
insert(entity);
}

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

@ -20,6 +20,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.form.*;
@ -78,6 +79,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
/**
* @Author sun
* @Description 核酸检测-上报核酸记录
@ -85,6 +89,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> 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<IcNatDao, IcNatEntity> 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<IcNatDao, IcNatEntity> imp
**/
@Override
public List<MyNatListResultDTO> myNatList(MyNatListFormDTO formDTO) {
//1.根据身份证号查询该人员所有核酸记录(居民端录入、数字平台录入、数字平台导入)
//1.根据token信息查询居民身份证号
UserBaseInfoResultDTO dto = userBaseInfoDao.selectListByUserIdList(formDTO.getUserId());
formDTO.setIdCard(dto.getIdNum());
//2.查询当前人员创建的或该身份证号录入的核算检测数据(居民端录入、数字平台录入、数字平台导入)
List<MyNatListResultDTO> resultList = baseDao.getMyNatList(formDTO);
return resultList;
}
@ -176,6 +188,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> 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<IcNatDao, IcNatEntity> 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<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
@ -200,7 +211,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> 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<IcNatDao, IcNatEntity> imp
* @Date 2022/3/29 16:29
*/
@Override
public List<NatListDTO> getNatList(String idCard) {
public List<NatListDTO> getNatList(String customerId, String idCard) {
LambdaQueryWrapper<IcNatEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcNatEntity::getCustomerId, customerId);
wrapper.eq(IcNatEntity::getIdCard, idCard);
wrapper.orderByDesc(IcNatEntity::getNatTime);
List<IcNatEntity> list = baseDao.selectList(wrapper);

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java

@ -225,7 +225,7 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
* @return
*/
@Override
public Map<String, Date> getUserLatestNoticeTime(String customerId,Set<String> idCardSet) {
public Map<String, Date> getUserLatestNoticeTime(String customerId,List<String> idCardSet) {
Map<String, Date> map=new HashMap<>();
for(String idCard:idCardSet) {
LambdaQueryWrapper<IcNoticeEntity> wrapper = new LambdaQueryWrapper<>();

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -120,6 +120,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private RedisTemplate redisTemplate;
@Resource
private IcNatService icNatService;
@Resource
private IcResiVaccineService icResiVaccineService;
@Resource
private IcTripReportRecordService icTripReportRecordService;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
@ -1326,10 +1330,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
IcResiUserEntity icResiUser = baseDao.selectById(formDTO.getId());
if (null != icResiUser) {
//核酸检测
List<NatListDTO> natList = icNatService.getNatList(icResiUser.getIdCard());
List<NatListDTO> natList = icNatService.getNatList(formDTO.getCustomerId(), icResiUser.getIdCard());
result.setNatList(natList);
//TODO 疫苗接种
//TODO 行程信息
//疫苗接种
List<VaccineListDTO> vaccineList = icResiVaccineService.getVaccineList(formDTO.getCustomerId(), icResiUser.getIdCard());
result.setVaccineList(vaccineList);
//行程信息
List<TripListDTO> tripList = icTripReportRecordService.tripList(formDTO.getCustomerId(), icResiUser.getIdCard());
result.setTripList(tripList);
}
return result;
}

37
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<IcResiVaccineDao,
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 获取居民疫苗接种信息
*
* @param idCard
* @Param idCard
* @Return {@link List< VaccineListDTO >}
* @Author zhaoqifeng
* @Date 2022/3/30 10:24
*/
@Override
public List<VaccineListDTO> getVaccineList(String customerId, String idCard) {
LambdaQueryWrapper<IcResiVaccineEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiVaccineEntity::getCustomerId, customerId);
wrapper.eq(IcResiVaccineEntity::getIdCard, idCard);
wrapper.orderByDesc(IcResiVaccineEntity::getInoculateTime);
List<IcResiVaccineEntity> 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());
}
}

50
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<IcTripReportR
List<IcTripReportRecordDTO> list = data.getList();
//3.查询最近一次通知时间、核算检测关注名单
if (CollectionUtils.isNotEmpty(list)) {
Set<String> idCardSet = list.stream().map(m -> m.getIdCard()).collect(Collectors.toSet());
Map<String, Date> latestNotice = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(),idCardSet);
List<String> gzIdCardList = epidemicSpecialAttentionService.getHeSuanIdCardList(formDTO.getCustomerId(),idCardSet);
Map<String, Date> latestNotice = new HashMap<>();
List<String> gzIdCardList = new ArrayList<>();
List<String> idCardList = list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList());
//如果不分页可能会有很多个身份证号
List<List<String>> partionList = ListUtils.partition(idCardList, NumConstant.ONE_HUNDRED);
partionList.forEach(l -> {
Map<String, Date> map = icNoticeService.getUserLatestNoticeTime(formDTO.getCustomerId(), l);
List<String> 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<IcTripReportR
dto.setOrigin(NumConstant.ZERO_STR);
dto.setContent(formDTO.getContent());
dto.setOrgName(agencyName);
dto.setStaffId(formDTO.getCurrentStaffId());
icNoticeService.sendNotice(dto);
}
@ -263,5 +278,34 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
return result.getList();
}
/**
* 获取居民行程信息
*
* @param idCard
* @Param idCard
* @Return {@link List< TripListDTO >}
* @Author zhaoqifeng
* @Date 2022/3/30 10:31
*/
@Override
public List<TripListDTO> tripList(String customerId, String idCard) {
LambdaQueryWrapper<IcTripReportRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcTripReportRecordEntity::getCustomerId, customerId);
wrapper.eq(IcTripReportRecordEntity::getIdCard, idCard);
wrapper.orderByDesc(IcTripReportRecordEntity::getArriveDate);
List<IcTripReportRecordEntity> 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());
}
}

0
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__modify_trip_report.sql → epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql

21
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='居民疫苗情况';

2
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 '来源地区编码';

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

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

BIN
epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx

Binary file not shown.

BIN
epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx

Binary file not shown.

23
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -7,7 +7,8 @@
<update id="cancelAttention">
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}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
AND a.MOBILE LIKE CONCAT('%',#{mobile},'%')
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%')
</if>
<if test=' null != vaccinationCount'>
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}
<if test='null != name and "" != name'>
AND a.`NAME` = #{name}
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
</if>
<if test='null != mobile and "" != mobile'>
AND a.MOBILE = #{mobile}
AND a.MOBILE LIKE CONCAT('%',#{mobile},'%')
</if>
<if test='null != mobile and "" != mobile'>
AND a.ID_CARD = #{idCard}
AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%')
</if>
<if test='null != reason and "" != reason'>
AND a.REASON LIKE CONCAT('%',#{reason},'%')

32
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}
<if test='null != idCard and "" != idCard'>
OR id_card = #{idCard}
</if>
)
ORDER BY nat_time DESC
</select>
@ -63,6 +68,31 @@
ORDER BY nat_time DESC
</select>
<select id="getNatDTO" resultType="com.epmet.dto.IcNatDTO">
SELECT
id,
agency_id,
user_id,
user_type,
`name`,
mobile,
id_card,
nat_time,
nat_result,
nat_address
FROM
ic_nat
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
AND DATE_FORMAT(nat_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{natTime}, '%Y-%m-%d %h:%i')
<if test='null != icNatId and "" != icNatId'>
AND id != #{icNatId}
</if>
LIMIT 1
</select>
<delete id="delById">
DELETE FROM ic_nat WHERE id = #{icNatId}
</delete>

5
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}
</if>
<if test="neighborId != null and neighborId != ''">
AND NEIGHBOR_HOOD_ID = #{neighborId}
AND VILLAGE_ID = #{neighborId}
</if>
<if test="buildingId != null and buildingId != ''">
AND BUILD_ID = #{buildingId}

11
epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml

@ -47,11 +47,14 @@
<if test='null != sourceAddressCode and "" != sourceAddressCode'>
AND SOURCE_ADDRESS_CODE like concat(#{sourceAddressCode},'%')
</if>
<if test='null != startTime and "" != startTime'>
AND ARRIVE_DATE <![CDATA[ >= ]]> #{startTime}
<if test='null != sourceAddress and "" != sourceAddress'>
AND SOURCE_ADDRESS like concat('%',#{sourceAddress},'%')
</if>
<if test='null != endTime and "" != endTime'>
AND ARRIVE_DATE <![CDATA[ <= ]]> #{endTime}
<if test='null != startDate and "" != startDate'>
AND ARRIVE_DATE <![CDATA[ >= ]]> #{startDate}
</if>
<if test='null != endDate and "" != endDate'>
AND ARRIVE_DATE <![CDATA[ <= ]]> #{endDate}
</if>
ORDER BY
r.CREATED_TIME DESC

Loading…
Cancel
Save