Browse Source

Merge remote-tracking branch 'origin/develop' into develop

dev
jianjun 4 years ago
parent
commit
77e0ebc4e2
  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. 7
      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. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java
  18. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  19. 55
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcFollowUpRecordDTO.java
  20. 71
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  21. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java
  22. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CancelAttentionPackageFormDTO.java
  23. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java
  24. 87
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java
  25. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java
  26. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageFollowUpFormDTO.java
  27. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PageTripReportFormDTO.java
  28. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java
  29. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java
  30. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java
  31. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/AttentionTypeEnum.java
  32. 44
      epmet-user/epmet-user-client/src/main/java/com/epmet/enums/ChannelEnum.java
  33. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
  34. 79
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  35. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
  36. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
  37. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
  38. 216
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  39. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
  40. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
  41. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java
  42. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java
  43. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcFollowUpRecordEntity.java
  44. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java
  45. 66
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/ImportEpidemicSpecialAttention.java
  46. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java
  47. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java
  48. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java
  49. 29
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/EpidemicSpecialAttentionErrorModel.java
  50. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  51. 116
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java
  52. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java
  53. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcFollowUpRecordService.java
  54. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java
  55. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java
  56. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiVaccineService.java
  57. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java
  58. 275
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java
  59. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java
  60. 42
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  61. 46
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java
  62. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  63. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiVaccineServiceImpl.java
  64. 306
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java
  65. 1
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__nat_add_uniquekey.sql
  66. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql
  67. 21
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.30__add_vaccine.sql
  68. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.31__modifty_trip_reportv2.sql
  69. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.32__update_ic_nat.sql
  70. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.33__modify_trip_reportv3.sql
  71. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx
  72. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/attention_vaccination_template.xlsx
  73. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx
  74. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/trip_report_import_template.xlsx
  75. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml
  76. 50
      epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml
  77. 31
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
  78. 22
      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 日期

7
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -15,10 +15,17 @@ 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";
/**
* 核酸检测
*/
String BIZ_TYPE_IC_NAT = "ic_nat";
/**
* 行程上报
*/
String BIZ_TYPE_IC_TRIP_REPORT = "ic_trip_report";
/**
* 处理状态处理中

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;
@ -79,4 +78,6 @@ public interface HouseService {
*/
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;
@ -457,4 +459,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')

4
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/IcResiUserConstant.java

@ -9,8 +9,10 @@ public interface IcResiUserConstant {
String IC_RESI_USER = "ic_resi_user";
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
* 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
*/
String USER_TYPE_RESI="resi";
String USER_TYPE_IC_RESI="icresi";
String USER_TYPE_INPUT="input";
String USER_TYPE_IMPORT="import";
}

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

71
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;未关联上的other
* 居民端小程序的人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 ;

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EpidemicPreventionFormDTO.java

@ -64,4 +64,7 @@ public class EpidemicPreventionFormDTO extends PageFormDTO implements Serializab
* 核酸检测次数
*/
private Integer natCount;
private String startDate;
private String endDate;
}

87
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java

@ -9,7 +9,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 行程上报居民端入参
@ -22,6 +24,19 @@ public class IcTripReportFormDTO implements Serializable {
public interface ResiUserRequired extends CustomerClientShowGroup {
}
public interface PcAddOrUpdateInternalGroup {
}
public interface PcAddRequired extends CustomerClientShowGroup {
}
public interface IcResiInternalGroup {
}
public interface PcUpdateRequired extends CustomerClientShowGroup {
}
@NotBlank(message = "主键不能为空", groups = {PcUpdateRequired.class})
private String id;
/**
* 客户Id
*/
@ -30,37 +45,48 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "姓名不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String name;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "手机号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String mobile;
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "身份证号不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String idCard;
/**
* 是否添加到核算检测关注名单,true加入默认false不加入
*/
@NotNull(message = "是否添加到核算检测关注名单", groups = {PcAddRequired.class,PcUpdateRequired.class})
private Boolean heSuanCheck;
/**
* 现居地编码
*/
@NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class})
private String presentAddressCode;
/**
* 现居地编码路径"presentAddressPathCode":"37,3702,370203,370203026,370203026002"
*/
@NotBlank(message = "现居地编码路径不能为空", groups = {ResiUserRequired.class})
private String presentAddressPathCode;
/**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/
@NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "现居地名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String presentAddress;
/**
* 详细地址
*/
@NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "详细地址不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String detailAddress;
/**
@ -69,10 +95,16 @@ public class IcTripReportFormDTO implements Serializable {
@NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class})
private String sourceAddressCode;
/**
* 来源地编码路径 "sourceAddressPathCode": "37,3702,370203,370203026,370203026002"
*/
@NotBlank(message = "来自地编码路径不能为空", groups = {ResiUserRequired.class})
private String sourceAddressPathCode;
/**
* 来源地区地址
*/
@NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class})
@NotBlank(message = "来自地区名称不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String sourceAddress;
/**
@ -80,7 +112,7 @@ public class IcTripReportFormDTO implements Serializable {
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class})
@NotNull(message = "来到本地时间不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private Date arriveDate;
/**
@ -93,23 +125,56 @@ public class IcTripReportFormDTO implements Serializable {
/**
* 备注信息
*/
@Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class})
@Length(max = 500, message = "备注最多可输入500字", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class})
private String remark;
@NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class})
/**
* userType=icresi时必填,取值居民所属的网格ID
* 居民端小程序上报前端赋值当前用户所在的网格id
*/
@NotBlank(message = "网格不能为空", groups = {ResiUserInternalGroup.class,IcResiInternalGroup.class})
private String gridId;
//后端自己赋值
/**
* 用户id
* 居民端上报时后端自己赋值
* pc录入如果是从居民信息选择此列有值
*/
@NotBlank(message = "userId不能为空", groups = {IcResiInternalGroup.class})
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
* 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
* 居民端上报是后端赋值导入后端赋值
* pc录入是前端赋值
*/
@NotBlank(message = "数字社区的居民:icresi;其他:other", groups = {PcAddOrUpdateInternalGroup.class})
private String userType;
/**
* userType=icresi时必填
* 居民所属的组织id
*/
@NotBlank(message = "agencyId不能为空", groups = {IcResiInternalGroup.class})
private String agencyId;
/**
* pc录入时用
*/
private String currentStaffId;
/**
* pc录入时用
* 通知渠道 0小程序通知1短信通知
*/
private List<String> channel = new ArrayList<>();
/**
* pc录入时用
* 通知内容
*/
private String content = "";
}

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/SendNoticeFormDTO.java

@ -18,6 +18,7 @@ import java.util.List;
public class SendNoticeFormDTO implements Serializable {
private static final long serialVersionUID = 4800907725063604885L;
private String customerId;
private String staffId;
/**
* 用户列表
*/
@ -41,7 +42,6 @@ public class SendNoticeFormDTO implements Serializable {
/**
* 组织名
*/
@NotNull(message = "组织名不能为空", groups = DefaultGroup.class)
private String orgName;
@NoArgsConstructor

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

1
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java

@ -74,6 +74,7 @@ public class IcNoticeController {
public Result sendNotice(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
icNoticeService.sendNotice(formDTO);
return new Result();
}

216
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java

@ -1,40 +1,68 @@
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.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.utils.*;
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.constant.IcResiUserConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcTripReportRecordDTO;
import com.epmet.dto.form.IcTripReportFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
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;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 行程上报信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
* @since v10.0 2022-03-25
*/
@Slf4j
@RestController
@RequestMapping("tripreport")
public class IcTripReportRecordController {
public class IcTripReportRecordController implements ResultDataResolver {
@Autowired
private IcTripReportRecordService icTripReportRecordService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
/**
* pc: 行程上报-列表
@ -42,7 +70,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());
@ -51,40 +79,53 @@ public class IcTripReportRecordController {
return new Result<PageData<IcTripReportRecordDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcTripReportRecordDTO> get(@PathVariable("id") String id){
IcTripReportRecordDTO data = icTripReportRecordService.get(id);
return new Result<IcTripReportRecordDTO>().ok(data);
}
/**
* pc: 行程上报-新增
* @param dto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcTripReportRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icTripReportRecordService.save(dto);
return new Result();
public Result save(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setCurrentStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcAddRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class);
if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class);
}
String id=icTripReportRecordService.save(formDTO);
return new Result().ok(id);
}
/**
* pc: 行程上报-修改
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcTripReportRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icTripReportRecordService.update(dto);
return new Result();
public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcTripReportFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setCurrentStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.PcUpdateRequired.class,IcTripReportFormDTO.PcAddOrUpdateInternalGroup.class);
if(IcResiUserConstant.USER_TYPE_IC_RESI.equals(formDTO.getUserType())){
ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.IcResiInternalGroup.class);
}
return new Result().ok(icTripReportRecordService.update(formDTO));
}
/**
* pc:行程上报-删除
*
* @param ids
* @return
*/
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icTripReportRecordService.delete(ids);
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody String[] ids) {
if (ArrayUtils.isEmpty(ids)) {
return new Result();
}
icTripReportRecordService.delete(tokenDto.getCustomerId(),tokenDto.getUserId(),ids);
return new Result();
}
@ -116,4 +157,121 @@ public class IcTripReportRecordController {
return new Result<List<IcTripReportRecordDTO>>().ok(icTripReportRecordService.resiList(formDTO));
}
/**
* pc:行程上报-下载模板
* @param response
* @throws IOException
*/
@RequestMapping(value = "template-download", method = {RequestMethod.GET, RequestMethod.POST})
public void downloadTemplate(HttpServletResponse response) throws IOException {
response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
//response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.ms-excel");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("行程上报导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/trip_report_import_template.xlsx");
try {
ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os);
} finally {
if (is != null) {
is.close();
}
}
}
/**
* 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 today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "行程上报信息".concat(today);
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();
}
}
}
/**
* 导入excel
* @return
*/
@PostMapping("import")
public Result importExcel(MultipartFile file) {
String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
// 1.暂存文件
String originalFilename = file.getOriginalFilename();
String extName = originalFilename.substring(originalFilename.lastIndexOf("."));
Path fileSavePath;
try {
Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_trip_preport", "import");
fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName));
} catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【行程上报导入】创建临时存储文件失败:{}", errorMsg);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "文件上传失败", "文件上传失败");
}
InputStream is = null;
FileOutputStream os = null;
try {
is = file.getInputStream();
os = new FileOutputStream(fileSavePath.toString());
IOUtils.copy(is, os);
} catch (Exception e) {
e.printStackTrace();
} finally {
org.apache.poi.util.IOUtils.closeQuietly(is);
org.apache.poi.util.IOUtils.closeQuietly(os);
}
// 2.生成导入任务记录
ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
importTaskForm.setOperatorId(userId);
importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_IC_TRIP_REPORT);
importTaskForm.setOriginFileName(originalFilename);
ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
ServiceConstant.EPMET_COMMON_SERVICE,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"excel行程上报导入错误",
"行程上报导入失败");
// 3.执行导入
icTripReportRecordService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
return new Result();
}
}

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

13
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;
@ -36,4 +37,16 @@ public interface IcNatDao extends BaseDao<IcNatEntity> {
* @Description 删除/取消同步操作--物理删除业务数据
**/
int delById(@Param("icNatId") String icNatId);
/**
* 插入或者更新
* @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);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcTripReportRecordDao.java

@ -33,4 +33,13 @@ public interface IcTripReportRecordDao extends BaseDao<IcTripReportRecordEntity>
* @return
*/
List<IcTripReportRecordDTO> pageList(PageTripReportFormDTO formDTO);
/**
* pc:行程上报-删除
* @param userId
* @param agencyId
* @param ids
* @return
*/
int batchDel(@Param("userId")String userId,@Param("agencyId")String agencyId, @Param("ids")String[] ids);
}

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

12
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcTripReportRecordEntity.java

@ -62,7 +62,7 @@ public class IcTripReportRecordEntity extends BaseEpmetEntity {
private String userId;
/**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
* 居民端小程序的人resi;数字社区的居民icresi;单独录入input; 导入import
*/
private String userType;
@ -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;
}

75
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcTripReportExcelData.java

@ -0,0 +1,75 @@
package com.epmet.excel.data;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 行程上报excel数据
*/
@Data
public class IcTripReportExcelData {
@NotBlank(message = "姓名为必填项")
@ExcelProperty("姓名")
private String name;
@NotBlank(message = "身份证号为必填项")
@ExcelProperty("身份证号")
private String idCard;
@NotBlank(message = "手机号为必填项")
@ExcelProperty("手机号")
private String mobile;
@NotBlank(message = "现居地为必填项")
@ExcelProperty("现居地(格式:省-市-区-街道-社区)")
private String presentAddress;
@NotBlank(message = "详细地址为必填项")
@ExcelProperty("详细地址")
private String detailAddress;
@NotBlank(message = "来自地区为必填项")
@ExcelProperty("来自地区(格式:省-市-区-街道-社区)")
private String sourceAddress;
@NotNull(message = "来到本地时间为必填项")
@ExcelProperty("来到本地时间(格式:2022-01-01)")
private Date arriveDate;
@ExcelProperty("离开本地时间(格式:2022-01-01)")
private Date leaveDate;
/**
* 备注信息
*/
@Length(max = 500,message = "备注不能超过500字")
@ExcelProperty("备注(500字以内)")
private String remark;
@Data
public static class ErrorRow {
@ExcelProperty("姓名")
@ColumnWidth(20)
private String name;
@ColumnWidth(20)
@ExcelProperty("身份证号")
private String idCard;
@ExcelProperty("手机号")
@ColumnWidth(20)
private String mobile;
@ColumnWidth(60)
@ExcelProperty("错误信息")
private String errorInfo;
}
}

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

5
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java

@ -60,7 +60,8 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
// 先校验数据
ValidatorUtils.validateEntity(data);
String natResult = "0";
// 默认空,没有结果
String natResult = "";
String natResultZh = data.getNatResultZh();
if (StringUtils.isNotBlank(natResultZh)) {
natResult = natResultZh.equals("阴性") ? "0" : "1";
@ -70,7 +71,7 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
icNatEntity.setAgencyId(currentAgencyId);
icNatEntity.setPids(currentAgencyPids);
icNatEntity.setUserId(currentUserId);
icNatEntity.setUserType("other");
icNatEntity.setUserType("import");
icNatEntity.setNatResult(natResult);
icNatEntity.setAttachmentType("");
icNatEntity.setAttachmentUrl("");

116
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcTripReportExcelImportListener.java

@ -0,0 +1,116 @@
package com.epmet.excel.handler;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.entity.IcTripReportRecordEntity;
import com.epmet.excel.data.IcTripReportExcelData;
import com.epmet.service.impl.IcTripReportRecordServiceImpl;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.List;
/**
* 行程上报excel导入监听器
*/
@Slf4j
public class IcTripReportExcelImportListener implements ReadListener<IcTripReportExcelData> {
/**
* 最大条数阈值
*/
public static final int MAX_THRESHOLD = 2;
/**
* 当前操作用户
*/
private CustomerStaffInfoCacheResult staffInfo;
private String customerId;
/**
* 数据
*/
private List<IcTripReportRecordEntity> datas = new ArrayList<>();
/**
* 错误项列表
*/
private List<IcTripReportExcelData.ErrorRow> errorRows = new ArrayList<>();
private IcTripReportRecordServiceImpl tripReportRecordService;
public IcTripReportExcelImportListener(String customerId,CustomerStaffInfoCacheResult staffInfo, IcTripReportRecordServiceImpl tripReportRecordService) {
this.customerId=customerId;
this.staffInfo = staffInfo;
this.tripReportRecordService = tripReportRecordService;
}
@Override
public void invoke(IcTripReportExcelData data, AnalysisContext context) {
try {
// 先校验数据
ValidatorUtils.validateEntity(data);
IcTripReportRecordEntity tripReportRecordEntity = ConvertUtils.sourceToTarget(data, IcTripReportRecordEntity.class);
tripReportRecordEntity.setCustomerId(customerId);
tripReportRecordEntity.setAgencyId(staffInfo.getAgencyId());
tripReportRecordEntity.setPids(staffInfo.getAgencyPIds());
tripReportRecordEntity.setUserType(IcResiUserConstant.USER_TYPE_IMPORT);
datas.add(tripReportRecordEntity);
if (datas.size() == MAX_THRESHOLD) {
execPersist();
}
} catch (Exception e) {
String errorMsg = null;
if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg();
} else {
errorMsg = "未知错误";
log.error("【行程上报导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
IcTripReportExcelData.ErrorRow errorRow = new IcTripReportExcelData.ErrorRow();
errorRow.setName(data.getName());
errorRow.setMobile(data.getMobile());
errorRow.setIdCard(data.getIdCard());
errorRow.setErrorInfo(errorMsg);
errorRows.add(errorRow);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
// 最后几条达不到阈值,这里必须再调用一次
execPersist();
}
/**
* 执行持久化
*/
private void execPersist() {
try {
if (datas != null && datas.size() > 0) {
tripReportRecordService.batchPersist(datas);
}
} finally {
datas.clear();
}
}
/**
* 获取错误行
* @return
*/
public List<IcTripReportExcelData.ErrorRow> getErrorRows() {
return errorRows;
}
}

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

38
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcTripReportRecordService.java

@ -6,8 +6,10 @@ 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.nio.file.Path;
import java.util.List;
import java.util.Map;
@ -40,24 +42,14 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
List<IcTripReportRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcTripReportRecordDTO
* @author generator
* @date 2022-03-25
*/
IcTripReportRecordDTO get(String id);
/**
* 默认保存
* pc: 行程上报-新增
*
* @param dto
* @return void
* @author generator
* @date 2022-03-25
*/
void save(IcTripReportRecordDTO dto);
String save(IcTripReportFormDTO dto);
/**
* 默认更新
@ -67,17 +59,17 @@ public interface IcTripReportRecordService extends BaseService<IcTripReportRecor
* @author generator
* @date 2022-03-25
*/
void update(IcTripReportRecordDTO dto);
String update(IcTripReportFormDTO dto);
/**
* 批量删除
* pc:行程上报-删除
*
* @param ids
* @return void
* @author generator
* @date 2022-03-25
*/
void delete(String[] ids);
void delete(String customerId,String userId,String[] ids);
/**
* 居民端小程序上报行程
@ -92,4 +84,20 @@ 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);
/**
* 执行Excel导入
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId);
}

275
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
//关注类型,核酸检测:2,疫苗接种:1,行程上报:0
return baseDao.getIdCardList(customerId,idCardSet,NumConstant.TWO);
}
/**
* 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);
}

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

@ -2,6 +2,7 @@ package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -19,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.*;
@ -77,6 +79,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Autowired
private OssFeignClient ossFeignClient;
@Autowired
private UserBaseInfoDao userBaseInfoDao;
/**
* @Author sun
* @Description 核酸检测-上报核酸记录
@ -84,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) {
@ -104,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);
}
@ -116,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;
}
@ -175,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());
@ -185,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));
@ -199,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);
}
}
@ -340,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);
@ -372,6 +385,13 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
* @param entities
*/
public void batchPersist(List<IcNatEntity> entities) {
insertBatch(entities);
//insertBatch(entities);
String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
entities.forEach(e -> {
String id = IdWorker.getIdStr(e);
e.setId(id);
e.setUpdatedBy(currentUserId);
baseDao.insertOrUpdate(e);
});
}
}

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

@ -5,14 +5,17 @@ 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.*;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.ChannelEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcNoticeDao;
import com.epmet.dto.IcNoticeDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.IcNoticeFormDTO;
import com.epmet.dto.form.ProjectSendMsgFormDTO;
import com.epmet.dto.form.SendNoticeFormDTO;
@ -20,6 +23,7 @@ import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.entity.IcNoticeEntity;
import com.epmet.feign.MessageFeignClient;
import com.epmet.service.IcNoticeService;
import com.epmet.service.UserBaseInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -44,6 +48,8 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
@Resource
private MessageFeignClient messageFeignClient;
@Resource
private UserBaseInfoService userBaseInfoService;
@Override
public PageData<IcNoticeDTO> page(IcNoticeFormDTO formDTO) {
@ -123,8 +129,14 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
*/
@Override
public void sendNotice(SendNoticeFormDTO formDTO) {
String orgName = "";
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null != staffInfo) {
orgName = staffInfo.getAgencyName();
}
//保存消息
String channel = StringUtils.join(formDTO.getChannel(), StrConstant.COMMA);
String finalOrgName = orgName;
List<IcNoticeEntity> entityList = formDTO.getUserList().stream().map(item -> {
IcNoticeEntity entity = new IcNoticeEntity();
entity.setCustomerId(formDTO.getCustomerId());
@ -134,7 +146,7 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
entity.setUserId(item.getUserId());
entity.setMobile(item.getMobile());
entity.setIdCard(item.getIdCard());
entity.setOrgName(formDTO.getOrgName());
entity.setOrgName(finalOrgName);
return entity;
}).collect(Collectors.toList());
insertBatch(entityList);
@ -145,18 +157,24 @@ public class IcNoticeServiceImpl extends BaseServiceImpl<IcNoticeDao, IcNoticeEn
List<ProjectSendMsgFormDTO> smsList = new ArrayList<>();
entityList.forEach(item -> {
if (StringUtils.isNotBlank(item.getUserId())) {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(item.getCustomerId());
messageFormDTO.setApp(AppClientConstant.APP_GOV);
messageFormDTO.setGridId(StrConstant.STAR);
messageFormDTO.setUserId(item.getUserId());
messageFormDTO.setTitle("您有一条通知消息!");
messageFormDTO.setMessageContent(item.getContent());
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC);
messageFormDTO.setTargetId(item.getId());
msgList.add(messageFormDTO);
if (StringUtils.isNotBlank(item.getIdCard())) {
//根据身份证获取居民ID
List<UserBaseInfoDTO> userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard());
if (CollectionUtils.isNotEmpty(userList)) {
userList.forEach(user -> {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(item.getCustomerId());
messageFormDTO.setApp(AppClientConstant.APP_GOV);
messageFormDTO.setGridId(StrConstant.STAR);
messageFormDTO.setUserId(user.getUserId());
messageFormDTO.setTitle("您有一条通知消息!");
messageFormDTO.setMessageContent(item.getContent());
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC);
messageFormDTO.setTargetId(item.getId());
msgList.add(messageFormDTO);
});
}
}
//TODO 短信消息
if (StringUtils.isNotBlank(item.getMobile())) {
@ -207,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<>();

20
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);
@ -1267,7 +1271,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
if (houseInfoMap.containsKey(item.getHomeId()) && null != houseInfoMap.get(item.getHomeId())) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(item.getHomeId());
item.setHomeId(houseInfoDTO.getAllName());
item.setHouseName(houseInfoDTO.getAllName());
}
});
}
@ -1300,12 +1304,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//查询房子名称
Set<String> houseIds = new HashSet<>();
houseIds.add(result.getHomeId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(new HashSet<>(houseIds),formDTO.getCustomerId());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
if (houseInfoMap.containsKey(result.getHomeId()) && null != houseInfoMap.get(result.getHomeId())) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(result.getHomeId());
result.setHomeId(houseInfoDTO.getAllName());
result.setHouseName(houseInfoDTO.getAllName());
}
}
return result;
@ -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());
}
}

306
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java

@ -1,36 +1,62 @@
package com.epmet.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
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.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
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.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.constants.ImportTaskConstants;
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.IcTripReportFormDTO;
import com.epmet.dto.form.MyReportedTripFormDTO;
import com.epmet.dto.form.PageTripReportFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.TripListDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcTripReportRecordEntity;
import com.epmet.excel.data.IcTripReportExcelData;
import com.epmet.excel.handler.IcTripReportExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcEpidemicSpecialAttentionService;
import com.epmet.service.IcNoticeService;
import com.epmet.service.IcTripReportRecordService;
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.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.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.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
@ -40,8 +66,9 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-25
*/
@Slf4j
@Service
public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportRecordDao, IcTripReportRecordEntity> implements IcTripReportRecordService {
public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportRecordDao, IcTripReportRecordEntity> implements IcTripReportRecordService, ResultDataResolver {
@Autowired
private UserBaseInfoDao userBaseInfoDao;
//关注
@ -50,6 +77,11 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
//通知
@Autowired
private IcNoticeService icNoticeService;
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private OssFeignClient ossFeignClient;
/**
* pc: 行程上报-列表
* @param formDTO
@ -58,10 +90,7 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
@Override
public PageData<IcTripReportRecordDTO> page(PageTripReportFormDTO formDTO) {
//1.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
CustomerStaffInfoCacheResult staffInfo=queryCurrentStaff(formDTO.getCustomerId(),formDTO.getUserId());
formDTO.setAgencyId(staffInfo.getAgencyId());
//2.按条件查询业务数据
PageInfo<IcTripReportRecordDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
@ -69,14 +98,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()));
@ -86,6 +125,14 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
return new PageData(list, data.getTotal());
}
private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
return staffInfo;
}
@Override
public List<IcTripReportRecordDTO> list(Map<String, Object> params) {
List<IcTripReportRecordEntity> entityList = baseDao.selectList(getWrapper(params));
@ -102,31 +149,118 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl<IcTripReportR
return wrapper;
}
@Override
public IcTripReportRecordDTO get(String id) {
IcTripReportRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcTripReportRecordDTO.class);
}
/**
* pc: 行程上报-新增
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcTripReportRecordDTO dto) {
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class);
public String save(IcTripReportFormDTO formDTO) {
//如果是单个录入的,默认数据属于当前用户所属组织id
if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){
//获取当前登录用户所属组织id
CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(formDTO.getCustomerId(),formDTO.getCurrentStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class);
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId());
if (null == agencyInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
entity.setPids(agencyInfoCache.getPids());
//1.插入行程记录表
insert(entity);
if(formDTO.getHeSuanCheck()){
// 2.加入核算检测关注名单
vaccinationAdd(formDTO);
}
//3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) {
sendNotice(formDTO,agencyInfoCache.getOrganizationName());
}
return entity.getId();
}
/**
* 行程上报-发送通知
* @param formDTO
*/
private void sendNotice(IcTripReportFormDTO formDTO,String agencyName) {
SendNoticeFormDTO dto = new SendNoticeFormDTO();
List<SendNoticeFormDTO.UserListBean> userList = new ArrayList<>();
//注意这里的userId是指的pc平台的居民
userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class));
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserList(userList);
dto.setChannel(formDTO.getChannel());
//通知来源 0 行程上报,1 疫苗接种,2 核酸检测
dto.setOrigin(NumConstant.ZERO_STR);
dto.setContent(formDTO.getContent());
dto.setOrgName(agencyName);
dto.setStaffId(formDTO.getCurrentStaffId());
icNoticeService.sendNotice(dto);
}
/**
* 行程上报-加入核算检测关注
* @param formDTO
*/
private void vaccinationAdd(IcTripReportFormDTO formDTO) {
VaccinationAddFormDTO vaccinationAddFormDTO=new VaccinationAddFormDTO();
vaccinationAddFormDTO.setCustomerId(formDTO.getCustomerId());
vaccinationAddFormDTO.setUserId(formDTO.getCurrentStaffId());
List<IcEpidemicSpecialAttentionDTO> list =new ArrayList<>();
IcEpidemicSpecialAttentionDTO dto=new IcEpidemicSpecialAttentionDTO();
dto.setName(formDTO.getName());
dto.setIdCard(formDTO.getIdCard());
dto.setMobile(formDTO.getMobile());
//避免再发通知,赋值个空集合吧
dto.setChannel(Collections.emptyList());
//关注类型,核酸检测:2,疫苗接种:1;行程上报:0
dto.setAttentionType(NumConstant.TWO);
list.add(dto);
vaccinationAddFormDTO.setList(list);
epidemicSpecialAttentionService.vaccinationAdd( vaccinationAddFormDTO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcTripReportRecordDTO dto) {
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcTripReportRecordEntity.class);
public String update(IcTripReportFormDTO formDTO) {
IcTripReportRecordEntity origin=baseDao.selectById(formDTO.getId());
if(null==origin){
log.warn("ic_trip_report_record记录不存在id:",formDTO.getId());
return formDTO.getId();
}
//如果是单个录入的,默认数据属于当前用户所属组织id
if(IcResiUserConstant.USER_TYPE_INPUT.equals(formDTO.getUserType())){
//获取当前登录用户所属组织id
CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(formDTO.getCustomerId(),formDTO.getCurrentStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
IcTripReportRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcTripReportRecordEntity.class);
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId());
if (null == agencyInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询组织信息异常", EpmetErrorCode.SERVER_ERROR.getMsg());
}
entity.setPids(agencyInfoCache.getPids());
//1.修改行程记录表
updateById(entity);
if(formDTO.getHeSuanCheck()){
// 2.加入核算检测关注名单,如果之前关注了,会在通知的service层移除
vaccinationAdd(formDTO);
}
//3.新增通知表信息
if (formDTO.getChannel().size() > NumConstant.ZERO && StringUtils.isNotBlank(formDTO.getContent())) {
sendNotice(formDTO,agencyInfoCache.getOrganizationName());
}
return entity.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
public void delete(String customerId, String userId, String[] ids) {
CustomerStaffInfoCacheResult staffInfo=queryCurrentStaff(customerId,userId);
baseDao.batchDel(userId,staffInfo.getAgencyId(),ids);
}
/**
@ -169,5 +303,127 @@ 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());
}
@Async
@Override
public void execAsyncExcelImport(Path filePath, String importTaskId) {
String userId = null;
String customerId=null;
try {
userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID);
//获取当前登录用户所属组织id
CustomerStaffInfoCacheResult staffInfo= queryCurrentStaff(customerId,userId);
IcTripReportExcelImportListener listener = new IcTripReportExcelImportListener(customerId,staffInfo, this);
EasyExcel.read(filePath.toFile(), IcTripReportExcelData.class, listener).headRowNumber(2).sheet(0).doRead();
Path errorDescFile = null;
String errorDesFileUrl = null;
List<IcTripReportExcelData.ErrorRow> errorRows = listener.getErrorRows();
// 生成并上传错误文件
try {
// 文件生成
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_trip_preport", "import", "error_des");
String fileName = UUID.randomUUID().toString().concat(".xlsx");
errorDescFile = errorDescDir.resolve(fileName);
FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile());
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName);
OutputStream os = fileItem.getOutputStream();
EasyExcel.write(os, IcTripReportExcelData.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows);
// 文件上传oss
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
if (errorDesFileUploadResult.success()) {
errorDesFileUrl = errorDesFileUploadResult.getData().getUrl();
}
} finally {
if (Files.exists(errorDescFile)) {
Files.delete(errorDescFile);
}
}
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(errorRows.size() <= 0 ? ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS : ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("");
importFinishTaskForm.setResultDescFilePath(errorDesFileUrl);
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
log.error("【行程上报导入】finishImportTask失败");
}
} catch (Exception e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【行程上报导入】出错:{}", errorMsg);
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("导入失败");
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) {
log.error("【行程上报导入】导入记录状态修改为'完成'失败");
}
} finally {
// 删除临时文件
if (Files.exists(filePath)) {
try {
Files.delete(filePath);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 批量持久化
* @param entities
*/
public void batchPersist(List<IcTripReportRecordEntity> entities) {
String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
entities.forEach(e -> {
String id = IdWorker.getIdStr(e);
e.setId(id);
e.setUpdatedBy(currentUserId);
baseDao.insert(e);
});
}
}

1
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.28__nat_add_uniquekey.sql

@ -0,0 +1 @@
alter table ic_nat add unique index unq_nat(ID_CARD, NAT_TIME)

2
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.29__modify_trip_report.sql

@ -0,0 +1,2 @@
alter table ic_trip_report_record MODIFY COLUMN PIDS VARCHAR(255) COMMENT 'agency_id的所有上级';
alter table ic_trip_report_record MODIFY COLUMN USER_TYPE VARCHAR(32) NOT NULL COMMENT '居民端小程序的人:resi;数字社区的居民:icresi;单独录入:input; 导入:import';

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/ic_nat.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},'%')

50
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,8 +68,51 @@
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>
<insert id="insertOrUpdate">
INSERT INTO epmet_user.ic_nat
(ID, CUSTOMER_ID, AGENCY_ID, PIDS, USER_ID,
USER_TYPE, NAME, MOBILE, ID_CARD, NAT_TIME, NAT_RESULT, NAT_ADDRESS, FILE_NAME, ATTACHMENT_TYPE, ATTACHMENT_URL,
DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
VALUES (#{id}, #{customerId}, #{agencyId}, #{pids}, #{userId},
#{userType}, #{name}, #{mobile}, #{idCard}, #{natTime},
#{natResult}, #{natAddress}, #{fileName}, #{attachmentType}, #{attachmentUrl},
#{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy},
#{updatedTime})
ON DUPLICATE KEY update
NAME=#{name},
MOBILE=#{mobile},
NAT_ADDRESS=#{natAddress},
NAT_RESULT=#{natResult},
UPDATED_BY=#{updatedBy},
UPDATED_TIME=NOW()
</insert>
</mapper>

31
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
@ -655,8 +656,28 @@
IFNULL( c.count, 0 ) AS natCount
FROM
ic_resi_user a
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
LEFT JOIN ( SELECT ID_CARD, count( id ) AS count FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
LEFT JOIN (
SELECT ID_CARD, count( id ) AS count
FROM ic_resi_vaccine
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
<if test="startDate != null and startDate != ''">
AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") &gt; #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") &lt; #{endDate}
</if>
GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD
LEFT JOIN (
SELECT ID_CARD, count( id ) AS count
FROM ic_nat
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
<if test="startDate != null and startDate != ''">
AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") &gt; #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND DATE_FORMAT(NAT_TIME,"%Y-%m-%d") &lt; #{endDate}
</if>
GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD
WHERE
a.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
@ -672,7 +693,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}
@ -690,7 +711,7 @@
AND MOBILE LIKE concat( '%', #{mobile}, '%' )
</if>
<if test="idCard != null and idCard != ''">
AND ID_CARD LIKE concat( '%', #{idCard}, '%' )
AND a.ID_CARD LIKE concat( '%', #{idCard}, '%' )
</if>
) t
WHERE

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

@ -47,13 +47,27 @@
<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
</select>
<update id="batchDel" parameterType="map">
update ic_trip_report_record set del_flag='1',UPDATED_BY=#{userId},UPDATED_TIME=NOW()
WHERE USER_TYPE !='resi'
AND AGENCY_ID=#{agencyId}
AND (
<foreach collection="ids" item="id" separator=" OR ">
id=#{id}
</foreach>
)
</update>
</mapper>
Loading…
Cancel
Save