diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 3a3ca19096..087970e1ea 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -78,4 +78,10 @@ public class HouseInfoDTO implements Serializable { private String allName; private String customerId; + + private String agencyId; + /** + * eg:市北区-阜新路街道-南宁社区 + */ + private String agencyPathName; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index ab86eb425b..9aac6abbd4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -291,4 +291,16 @@ public class HouseController implements ResultDataResolver { return new Result(); } + /** + * 获取房屋信息 + * @param houseId + * @return + */ + @PostMapping("gethouseinfo/{houseId}") + public Result getHouseInfo(@LoginUser TokenDto tokenDto,@PathVariable("houseId") String houseId){ + if(StringUtils.isBlank(houseId)){ + return new Result<>(); + } + return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(),houseId)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java index e9f8cd8141..24c42f7f20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java @@ -26,7 +26,6 @@ import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.excel.IcHouseExcel; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; @@ -79,4 +78,6 @@ public interface HouseService { */ void allDelete(NeighborHoodManageDelFormDTO formDTO); + + HouseInfoDTO getHouseInfoDTO(String customerId,String houseId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 66a40b9349..43c9c64fe8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -13,7 +13,9 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; @@ -457,4 +459,16 @@ 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(agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName())); + } else { + houseInfo.setAgencyPathName(StrConstant.EPMETY_STR); + } + return houseInfo; + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index b8f3bfef66..f5476ed398 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -368,7 +368,8 @@ IFNULL(ib.LONGITUDE,'') as buildingLongitude, IFNULL(ib.LATITUDE,'') as buildingLatitude, ih.CUSTOMER_ID AS customerId, - concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName + concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName, + n.AGENCY_ID as agencyId FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java index f8d6f90ef7..9c085f2e07 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcTripReportFormDTO.java @@ -68,7 +68,7 @@ public class IcTripReportFormDTO implements Serializable { /** * 现居地编码 */ - @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + @NotBlank(message = "现居地编码不能为空", groups = {ResiUserRequired.class}) private String presentAddressCode; /** @@ -86,7 +86,7 @@ public class IcTripReportFormDTO implements Serializable { /** * 来源地区编码 */ - @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class,PcAddRequired.class,PcUpdateRequired.class}) + @NotBlank(message = "来自地区编码不能为空", groups = {ResiUserRequired.class}) private String sourceAddressCode; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java index 19b5c8c792..73b7d77ca6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java @@ -13,4 +13,5 @@ public class DemandUserResDTO implements Serializable { private String gridId; private String idCard; private String agencyId; + private String houseId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 8a2cd30ea8..1017075ac6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -1,5 +1,6 @@ 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; @@ -7,6 +8,7 @@ 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; @@ -15,7 +17,9 @@ 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.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; @@ -26,6 +30,9 @@ 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; /** @@ -173,4 +180,22 @@ public class IcEpidemicSpecialAttentionController { } + @PostMapping("export-template") + public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams(); + String fileName = ""; + Map map = new HashMap<>(); + // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx"); + fileName = "疫苗接种关注名单导入模板"; + map.put("maplist",new ArrayList()); + }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){ + templatePath.setTemplateUrl("excel/attention_nat_template.xlsx"); + fileName = "核酸检测关注名单导入模板"; + map.put("maplist",new ArrayList()); + } + ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java new file mode 100644 index 0000000000..e332fe88df --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatImportExcel.java @@ -0,0 +1,30 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class NatImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "关注原因") + private String reason; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java new file mode 100644 index 0000000000..b7349e4d03 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationImportExcel.java @@ -0,0 +1,27 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class VaccinationImportExcel extends ExcelVerifyInfo { + + @Excel(name = "姓名") + private String name; + + @Excel(name = "电话") + private String mobile; + + @Excel(name = "身份证") + private String idCard; + + @Excel(name = "备注") + private String remark; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 915f32b18e..83d2ed51cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -299,7 +299,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl 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); + if (list.size() > errorInfo.size()){ + Map groupByIdCard = list.stream().collect(Collectors.groupingBy(ImportEpidemicSpecialAttention::getIdCard, Collectors.counting())); + groupByIdCard.forEach((idCard,count) -> { + if (Integer.valueOf(count.toString()).compareTo(1) != 0){ + for (ImportEpidemicSpecialAttention i : list) { + if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ + errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); + i.setAddStatus(true); + } } } - } - }); - List idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); - List existList = baseDao.getExistList(attentionType, idCards); - if (CollectionUtils.isNotEmpty(existList)){ - for (String s : existList) { - for (int i = NumConstant.ZERO; i < list.size(); i++) { - if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ - errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum())); - list.get(i).setAddStatus(true); - continue; + }); + List idCards = list.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); + List existList = baseDao.getExistList(attentionType, idCards); + if (CollectionUtils.isNotEmpty(existList)){ + for (String s : existList) { + for (int i = NumConstant.ZERO; i < list.size(); i++) { + if (s.equals(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ + errorInfo.add(getErrorInfo(list.get(i),"数据已存在",list.get(i).getNum())); + list.get(i).setAddStatus(true); + continue; + } } } } @@ -352,8 +354,8 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + // send msg 产品说导入不用发通知 + /*List needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(needSendList)) { SendNoticeFormDTO dto = new SendNoticeFormDTO(); List userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class); @@ -364,7 +366,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl