com.epmet
epmet-user-client
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
new file mode 100644
index 0000000000..de3612756d
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicPreventionController.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+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.dto.form.EpidemicPreventionFormDTO;
+import com.epmet.dto.result.EpidemicPreventionInfoDTO;
+import com.epmet.dto.result.EpidemicPreventionResultDTO;
+import com.epmet.service.IcResiUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+
+/**
+ * 用户基础信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-10-26
+ */
+@Slf4j
+@RestController
+@RequestMapping("epidemicPrevention")
+public class IcEpidemicPreventionController{
+
+ @Resource
+ private IcResiUserService icResiUserService;
+
+
+ /**
+ * 居民防疫信息查询
+ * @Param tokenDto
+ * @Param formDTO
+ * @Return {@link Result< PageData>}
+ * @Author zhaoqifeng
+ * @Date 2022/3/29 14:25
+ */
+ @PostMapping("page")
+ public Result> search(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ PageData result = icResiUserService.epidemicPreventionList(formDTO);
+ return new Result>().ok(result);
+ }
+
+ @PostMapping("user-list")
+ public Result> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ PageData result = icResiUserService.userList(formDTO);
+ return new Result>().ok(result);
+ }
+
+ /**
+ * 居民防疫信息详情
+ * @Param formDTO
+ * @Return {@link Result< EpidemicPreventionResultDTO>}
+ * @Author zhaoqifeng
+ * @Date 2022/3/29 16:13
+ */
+ @PostMapping("detail")
+ public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO);
+ return new Result().ok(result);
+ }
+
+ @PostMapping("info")
+ public Result info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO);
+ return new Result().ok(result);
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
new file mode 100644
index 0000000000..b2d1ea6249
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
@@ -0,0 +1,201 @@
+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.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;
+
+
+/**
+ * 疫情特别关注
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-28
+ */
+@RestController
+@RequestMapping("icEpidemicSpecialAttention")
+@Slf4j
+public class IcEpidemicSpecialAttentionController {
+
+ @Autowired
+ private IcEpidemicSpecialAttentionService icEpidemicSpecialAttentionService;
+ @Autowired
+ private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+
+ /**
+ * Desc: 【疫苗接种关注名单,疫苗接种关注名单】列表
+ * @param formDTO
+ * @author zxc
+ * @date 2022/3/28 10:29
+ */
+ @PostMapping("list")
+ public Result vaccinationList(@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){
+ ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, VaccinationListFormDTO.VaccinationListForm.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ return new Result().ok(icEpidemicSpecialAttentionService.vaccinationList(formDTO));
+ }
+
+ /**
+ * Desc:【疫苗接种关注名单,核酸检测关注名单】新增
+ * @param formDTO
+ * @param tokenDto
+ * @author zxc
+ * @date 2022/3/28 13:35
+ */
+ @PostMapping("vaccination-add")
+ @NoRepeatSubmit
+ public Result vaccinationAdd(@RequestBody VaccinationAddFormDTO formDTO,@LoginUser TokenDto tokenDto){
+ ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionAdd.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ icEpidemicSpecialAttentionService.vaccinationAdd(formDTO);
+ return new Result();
+ }
+
+ /**
+ * Desc:【疫苗接种关注名单,核酸检测关注名单】修改
+ * @param formDTO
+ * @author zxc
+ * @date 2022/3/28 13:45
+ */
+ @PostMapping("vaccination-update")
+ @NoRepeatSubmit
+ public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO,@LoginUser TokenDto tokenDto){
+ ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class);
+ icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto);
+ return new Result();
+ }
+
+ /**
+ * Desc: 取消关注
+ * @param formDTO
+ * @author zxc
+ * @date 2022/3/28 13:51
+ */
+ @PostMapping("cancel-attention")
+ @NoRepeatSubmit
+ public Result cancelAttention(@RequestBody CancelAttentionPackageFormDTO formDTO){
+ ValidatorUtils.validateEntity(formDTO, CancelAttentionPackageFormDTO.CancelAttentionPackageForm.class);
+ icEpidemicSpecialAttentionService.cancelAttention(formDTO);
+ return new Result();
+ }
+
+ /**
+ * Desc: 【疫苗接种关注名单,核酸检测关注名单】导入
+ * @param
+ * @author zxc
+ * @date 2022/3/28 13:40
+ */
+ @PostMapping("vaccination-import")
+ public Result vaccinationImport(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file,@RequestParam("attentionType")Integer attentionType){
+ if (file.isEmpty()) {
+ throw new EpmetException("请上传文件");
+ }
+ // 校验文件类型
+ String extension = FilenameUtils.getExtension(file.getOriginalFilename());
+ if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
+ throw new EpmetException("文件类型不匹配");
+ }
+ // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
+ ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
+ importTaskForm.setOriginFileName(file.getOriginalFilename());
+ importTaskForm.setOperatorId(tokenDto.getUserId());
+ if (attentionType.equals(NumConstant.ONE)){
+ importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_VACCINATION);
+ }else if (attentionType.equals(NumConstant.TWO)){
+ importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_NAT);
+ }else if (attentionType.equals(NumConstant.ZERO)){
+ importTaskForm.setBizType(ImportTaskConstants.BIZ_TYPE_ATTENTION_TRIP_REPORT);
+ }
+ Result result = commonServiceOpenFeignClient.createImportTask(importTaskForm);
+ if (!result.success()) {
+ throw new EpmetException(9999,"存在进行中的导入");
+ }
+ InputStream inputStream = null;
+ try {
+ inputStream = file.getInputStream();
+ }catch (Exception e){
+ ImportTaskCommonFormDTO input = new ImportTaskCommonFormDTO();
+ input.setOperatorId(tokenDto.getUserId());
+ input.setTaskId(result.getData().getTaskId());
+ input.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
+ commonServiceOpenFeignClient.finishImportTask(input);
+ log.error("读取文件失败");
+ }
+ icEpidemicSpecialAttentionService.importFile(tokenDto,inputStream,attentionType,result.getData().getTaskId());
+ return new Result();
+ }
+
+ /**
+ * Desc: 【疫苗接种关注名单,核酸检测关注名单】导出
+ * @param response
+ * @param formDTO
+ * @param tokenDto
+ * @author zxc
+ * @date 2022/3/28 13:57
+ */
+ @PostMapping("vaccination-export")
+ public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception {
+ ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setIsPage(false);
+ PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO);
+ // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
+ if (formDTO.getAttentionType().equals(NumConstant.ONE)){
+ ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class);
+ }else {
+ ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class);
+ }
+
+ }
+
+ @PostMapping("export-template")
+ public void exportTemplate(HttpServletResponse response, @RequestBody VaccinationListFormDTO formDTO) throws Exception {
+ TemplateExportParams templatePath = new TemplateExportParams();
+ String fileName = "";
+ Map map = new HashMap<>();
+ // 关注类型,核酸检测:2,疫苗接种:1,行程上报:0
+ if (formDTO.getAttentionType().equals(NumConstant.ONE)){
+ templatePath.setTemplateUrl("excel/attention_vaccination_template.xlsx");
+ fileName = "疫苗接种关注名单导入模板";
+ map.put("maplist",new ArrayList());
+ }else if (formDTO.getAttentionType().equals(NumConstant.TWO)){
+ templatePath.setTemplateUrl("excel/attention_nat_template.xlsx");
+ fileName = "核酸检测关注名单导入模板";
+ map.put("maplist",new ArrayList());
+ }
+ ExcelPoiUtils.exportExcel(templatePath ,map,fileName,response);
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
new file mode 100644
index 0000000000..7b0b375207
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
@@ -0,0 +1,149 @@
+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.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 javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+
+
+/**
+ * 随访记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-25
+ */
+@Slf4j
+@RestController
+@RequestMapping("followup")
+public class IcFollowUpRecordController {
+
+ @Autowired
+ private IcFollowUpRecordService icFollowUpRecordService;
+
+ /**
+ * 随访记录-列表
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("page")
+ public Result> page(@LoginUser TokenDto tokenDto, @RequestBody PageFollowUpFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserShowGroup.class,PageFormDTO.AddUserInternalGroup.class);
+ PageData page = icFollowUpRecordService.page(formDTO);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ IcFollowUpRecordDTO data = icFollowUpRecordService.get(id);
+ return new Result().ok(data);
+ }
+
+ /**
+ * 随访记录-新增
+ * @param dto
+ * @return
+ */
+ @NoRepeatSubmit
+ @PostMapping("save")
+ 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();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody IcFollowUpRecordDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ icFollowUpRecordService.update(dto);
+ return new Result();
+ }
+
+ @PostMapping("delete")
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ icFollowUpRecordService.delete(ids);
+ 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.setIsPage(false);
+
+ ExcelWriter excelWriter = null;
+ formDTO.setPageSize(NumConstant.TEN_THOUSAND);
+ int pageNo = formDTO.getPageNo();
+ try {
+ //导出文件名:张三随访记录0330
+ String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
+ String fileName = formDTO.getName().concat("随访记录").concat(today).concat(".xlsx");
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcFollowUpRecordDTO.class).build();
+ WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
+ PageData data = null;
+ do {
+ data = icFollowUpRecordService.page(formDTO);
+ data.getList().forEach(o->{
+ //0行程上报,1疫苗接种,2核酸检测
+ switch(o.getOrigin()){
+ case NumConstant.ZERO_STR:
+ o.setOrigin("行程上报");
+ break;
+ case NumConstant.ONE_STR:
+ o.setOrigin("疫苗接种");
+ break;
+ case NumConstant.TWO_STR:
+ o.setOrigin("核酸检测");
+ break;
+ }
+ });
+ formDTO.setPageNo(++pageNo);
+ excelWriter.write(data.getList(), writeSheet);
+ } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size()==formDTO.getPageSize());
+
+ }catch (Exception e){
+ log.error("export exception", e);
+ }finally {
+ // 千万别忘记finish 会帮忙关闭流
+ if (excelWriter != null) {
+ excelWriter.finish();
+ }
+ }
+ }
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
new file mode 100644
index 0000000000..e2d6b7344f
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java
@@ -0,0 +1,318 @@
+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.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.*;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.constants.ImportTaskConstants;
+import com.epmet.dto.IcNatDTO;
+import com.epmet.dto.form.AddIcNatFormDTO;
+import com.epmet.dto.form.ImportTaskCommonFormDTO;
+import com.epmet.dto.form.MyNatListFormDTO;
+import com.epmet.dto.result.ImportTaskCommonResultDTO;
+import com.epmet.dto.result.MyNatListResultDTO;
+import com.epmet.dto.result.NatListCommonExcelResultDTO;
+import com.epmet.dto.result.NatListResultDTO;
+import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
+import com.epmet.service.IcNatService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.io.IOUtils;
+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.List;
+import java.util.UUID;
+
+
+/**
+ * 核酸上报记录
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-25
+ */
+@Slf4j
+@RestController
+@RequestMapping("icNat")
+public class IcNatController implements ResultDataResolver {
+
+ @Autowired
+ private IcNatService icNucleinService;
+
+ @Autowired
+ private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+
+ /**
+ * 记录一下核酸记录模块的业务程序逻辑,防止后续理不清 ic_nat:基础信息表 ic_nat_relation:关系表
+ * 1.数字平台导入时,按身份证检测时间查询数据,查到数据不是导入的状态则记录下并跳过,是导入数据更新结果,未查到直接新增
+ * 是否居民以及userId值查询数据平台居民,能查到就相应的赋值;
+ * 2.居民端录入可以录自己的或别人的,但是数据属于当前录入的组织;
+ * 3.数据平台录入可以为已有居民录入也可以录新数据,新数据则是否居民和userId无值;
+ * 4.导入数据不允许修改删除,录入数据可以修改删除,删除时相应的删除基础表和可能存在的所有关心表数据,
+ * 数据同步可多次重复,只是修改对应的关系表数据,基础信息表数据公用;
+ * 5.同一条数据被A街道和A社区都同步了,街道在看本辖区数据时会看到两条,但是只有A街道的那一条才能看到取消同步按钮;
+ * 6.数据库一个人一个检测时间只存在一条记录,以导入数据结果为准,已导入的各项值都不能修改,即使错误也只能通过导入修改;
+ * 7.新增、删除居民时会相应的修改基础信息表是否居民以及userId的值;
+ * 注:1.导入数据不允许修改是觉得导入数据是官方提供的且没有问题的数据,不需要在平台有维护操作,只要看就可以了;
+ * 2.是否居民的查询条件以及是否居民的列标题在看整个客户列表数据时这两个都隐藏
+ *
+ */
+
+ /**
+ * @Author sun
+ * @Description 核酸检测-上报核酸记录
+ **/
+ //@NoRepeatSubmit
+ @PostMapping("add")
+ 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();
+ }
+
+ /**
+ * @Author sun
+ * @Description 核酸检测-居民端我的上报
+ **/
+ @NoRepeatSubmit
+ @PostMapping("mynatlist")
+ public Result> myNatList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ return new Result>().ok(icNucleinService.myNatList(formDTO));
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息列表
+ **/
+ @NoRepeatSubmit
+ @PostMapping("natlist")
+ public Result> natList(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ return new Result>().ok(icNucleinService.natList(formDTO));
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息详情
+ **/
+ @NoRepeatSubmit
+ @PostMapping("detail")
+ public Result detail(@RequestBody MyNatListFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Detail.class);
+ return new Result().ok(icNucleinService.detail(formDTO));
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息修改
+ **/
+ @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();
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息删除/取消同步
+ **/
+ @NoRepeatSubmit
+ @PostMapping("del")
+ public Result del(@RequestBody MyNatListFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Del.class);
+ icNucleinService.del(formDTO);
+ return new Result<>();
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息同步
+ **/
+ @NoRepeatSubmit
+ @PostMapping("synchro")
+ public Result synchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ icNucleinService.synchro(formDTO);
+ return new Result();
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息取消同步
+ **/
+ @NoRepeatSubmit
+ @PostMapping("cancelsynchro")
+ public Result cancelSynchro(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, MyNatListFormDTO.Synchro.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ icNucleinService.cancelSynchro(formDTO);
+ return new Result<>();
+ }
+
+ /**
+ * 导入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_nat", "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_NAT);
+ importTaskForm.setOriginFileName(originalFilename);
+
+ ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm),
+ ServiceConstant.EPMET_COMMON_SERVICE,
+ EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
+ "excel导入核酸检测信息错误",
+ "导入居民核酸检测信息失败");
+
+ // 3.执行导入
+ icNucleinService.execAsyncExcelImport(fileSavePath, rstData.getTaskId());
+
+ return new Result();
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息下载模板
+ **/
+ @RequestMapping(value = "import-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/ic_nat.xlsx");
+ try {
+ ServletOutputStream os = response.getOutputStream();
+ IOUtils.copy(is, os);
+ } finally {
+ if (is != null) {
+ is.close();
+ }
+ }
+
+ }
+
+ /**
+ * @Author sun
+ * @Description 【核酸】核酸检测信息列表
+ **/
+ @NoRepeatSubmit
+ @PostMapping("export")
+ public void export(@LoginUser TokenDto tokenDto, @RequestBody MyNatListFormDTO formDTO, HttpServletResponse response) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+
+ //formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
+ //formDTO.setUserId("73ae6280e46a6653a5605d51d5462725");
+
+ formDTO.setIsPage(false);
+
+ ExcelWriter excelWriter = null;
+ formDTO.setPageSize(NumConstant.TEN_THOUSAND);
+ int pageNo = formDTO.getPageNo();
+ try {
+ // 这里 需要指定写用哪个class去写
+ String fileName = "核酸检测信息.xlsx";
+ if ("all".equals(formDTO.getOrgType())) {
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListResultDTO.class).build();
+ }else {
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListCommonExcelResultDTO.class).build();
+ }
+
+ WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
+ PageData data = null;
+ do {
+ data = icNucleinService.natList(formDTO);
+ data.getList().forEach(o-> {
+ o.setNatResult(NumConstant.ONE_STR.equals(o.getNatResult()) ? "阳性" : "阴性");
+ o.setIsResiUser(NumConstant.ONE_STR.equals(o.getIsResiUser()) ? "是" : "否");
+ });
+ formDTO.setPageNo(++pageNo);
+ if ("current".equals(formDTO.getOrgType())) {
+ List list = ConvertUtils.sourceToTarget(data.getList(), NatListResultDTO.class);
+ excelWriter.write(list, writeSheet);
+ }else{
+ excelWriter.write(data.getList(), writeSheet);
+ }
+ } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
+
+ }catch (Exception e){
+ log.error("export exception", e);
+ }finally {
+ // 千万别忘记finish 会帮忙关闭流
+ if (excelWriter != null) {
+ excelWriter.finish();
+ }
+ }
+ }
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java
new file mode 100644
index 0000000000..9fb17bbd23
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatRelationController.java
@@ -0,0 +1,24 @@
+package com.epmet.controller;
+
+import com.epmet.service.IcNatRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 核酸记录关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-31
+ */
+@RestController
+@RequestMapping("icNatRelation")
+public class IcNatRelationController {
+
+ @Autowired
+ private IcNatRelationService icNatRelationService;
+
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
new file mode 100644
index 0000000000..b0b8a31553
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java
@@ -0,0 +1,82 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+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.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.IcNoticeDTO;
+import com.epmet.dto.form.IcNoticeFormDTO;
+import com.epmet.dto.form.SendNoticeFormDTO;
+import com.epmet.service.IcNoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 防疫通知
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-28
+ */
+@RestController
+@RequestMapping("icNotice")
+public class IcNoticeController {
+
+ @Autowired
+ private IcNoticeService icNoticeService;
+
+ @RequestMapping("page")
+ public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcNoticeFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ PageData page = icNoticeService.page(formDTO);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(method = {RequestMethod.POST,RequestMethod.GET})
+ public Result get(@RequestBody IcNoticeFormDTO formDTO){
+ IcNoticeDTO data = icNoticeService.get(formDTO.getNoticeId());
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody IcNoticeDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ icNoticeService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody IcNoticeDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ icNoticeService.update(dto);
+ return new Result();
+ }
+
+ @PostMapping("delete")
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ icNoticeService.delete(ids);
+ return new Result();
+ }
+
+ @PostMapping("sendNotice")
+ 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();
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
index 7b8df6ad1d..c25f04bc2b 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
@@ -11,9 +11,12 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
+import com.epmet.dto.form.LatestSubmitCollectFormDTO;
+import com.epmet.dto.form.ResiCollectFormDTO;
import com.epmet.dto.result.CollectListExcelResultDTO;
import com.epmet.dto.result.CollectListMemberExcelResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
+import com.epmet.dto.result.LatestCollectResDTO;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -89,7 +92,7 @@ public class IcResiCollectController {
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
- formDTO.setPage(false);
+ formDTO.setIsPage(false);
PageData collectList = icResiCollectService.getCollectList(formDTO);
List list =new ArrayList<>();
@@ -108,4 +111,33 @@ public class IcResiCollectController {
ExcelUtils.exportExcelToTarget(response, null, list, CollectListExcelResultDTO.class);
}
+ /**
+ * 居民端小程序:社区居民信息登记-提交
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("save-resi")
+ public Result saveResi(@LoginUser TokenDto tokenDto, @RequestBody ResiCollectFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO, ResiCollectFormDTO.InternalShowGroup.class, ResiCollectFormDTO.AddUserInternalGroup.class);
+ icResiCollectService.saveResi(formDTO);
+ return new Result();
+ }
+
+ /**
+ * 居民端小程序:社区居民信息登记-查询
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("latest-submit")
+ public Result latestSubmit(@LoginUser TokenDto tokenDto, @RequestBody LatestSubmitCollectFormDTO formDTO){
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(formDTO,LatestSubmitCollectFormDTO.AddUserInternalGroup.class);
+ return new Result().ok(icResiCollectService.latestSubmit(formDTO));
+ }
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java
new file mode 100644
index 0000000000..722c2966eb
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiVaccineController.java
@@ -0,0 +1,73 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+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.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.dto.IcResiVaccineDTO;
+import com.epmet.service.IcResiVaccineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 居民疫苗情况
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-28
+ */
+@RestController
+@RequestMapping("icResiVaccine")
+public class IcResiVaccineController {
+
+ @Autowired
+ private IcResiVaccineService icResiVaccineService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = icResiVaccineService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ IcResiVaccineDTO data = icResiVaccineService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody IcResiVaccineDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ icResiVaccineService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody IcResiVaccineDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ icResiVaccineService.update(dto);
+ return new Result();
+ }
+
+ @PostMapping("delete")
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ icResiVaccineService.delete(ids);
+ return new Result();
+ }
+
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
new file mode 100644
index 0000000000..e50ed23b70
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
@@ -0,0 +1,277 @@
+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.*;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+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 v10.0 2022-03-25
+ */
+@Slf4j
+@RestController
+@RequestMapping("tripreport")
+public class IcTripReportRecordController implements ResultDataResolver {
+
+ @Autowired
+ private IcTripReportRecordService icTripReportRecordService;
+ @Autowired
+ private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+
+ /**
+ * pc: 行程上报-列表
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("page")
+ public Result> page(@LoginUser TokenDto tokenDto,@RequestBody PageTripReportFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(PageFormDTO.AddUserInternalGroup.class);
+ PageData page = icTripReportRecordService.page(formDTO);
+ return new Result>().ok(page);
+ }
+
+ /**
+ * pc: 行程上报-新增
+ * @param formDTO
+ * @return
+ */
+ @NoRepeatSubmit
+ @PostMapping("save")
+ 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(@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(@LoginUser TokenDto tokenDto, @RequestBody String[] ids) {
+ if (ArrayUtils.isEmpty(ids)) {
+ return new Result();
+ }
+ icTripReportRecordService.delete(tokenDto.getCustomerId(),tokenDto.getUserId(),ids);
+ return new Result();
+ }
+
+ /**
+ * 居民端小程序:上报行程
+ * @param tokenDto
+ * @param formDTO
+ * @return
+ */
+ @PostMapping("resi-save")
+ public Result resiSave(@LoginUser TokenDto tokenDto, @RequestBody IcTripReportFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setUserType(IcResiUserConstant.USER_TYPE_RESI);
+ ValidatorUtils.validateEntity(formDTO,IcTripReportFormDTO.ResiUserRequired.class,IcTripReportFormDTO.ResiUserInternalGroup.class);
+ return new Result().ok(icTripReportRecordService.resiSave(formDTO));
+ }
+
+ /**
+ * 居民端小程序:我的上报
+ * @param tokenDto
+ * @return
+ */
+ @PostMapping("resi-list")
+ public Result> resiList(@LoginUser TokenDto tokenDto,@RequestBody MyReportedTripFormDTO formDTO){
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setUserId(tokenDto.getUserId());
+ ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
+ return new Result>().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.setIsPage(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 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();
+ }
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
index 41f14362ee..f018a32789 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java
@@ -43,7 +43,7 @@ public class PatrolRoutineWorkController {
@NoRepeatSubmit
@PostMapping("selectList")
public Result> gridUserWork(@RequestBody PatrolQueryFormDTO formDTO){
- formDTO.setPage(false);
+ formDTO.setIsPage(false);
Page data = gridUserWorkService.listPage(formDTO);
return new Result().ok(data.getResult());
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
new file mode 100644
index 0000000000..ba1564855e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java
@@ -0,0 +1,63 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.VaccinationListFormDTO;
+import com.epmet.dto.result.VaccinationListResultDTO;
+import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 疫情特别关注
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-28
+ */
+@Mapper
+public interface IcEpidemicSpecialAttentionDao extends BaseDao {
+
+ /**
+ * Desc: 疫苗接种关注名单
+ * @param formDTO
+ * @author zxc
+ * @date 2022/3/28 14:19
+ */
+ List vaccinationList(VaccinationListFormDTO formDTO);
+
+ /**
+ * Desc: 核酸检测关注名单
+ * @param formDTO
+ * @author zxc
+ * @date 2022/3/28 15:23
+ */
+ List natList(VaccinationListFormDTO formDTO);
+
+ /**
+ * Desc: 取消关注
+ * @param list
+ * @param attentionType
+ * @author zxc
+ * @date 2022/3/28 16:59
+ */
+ void cancelAttention(@Param("list")List list,@Param("attentionType")Integer attentionType);
+
+ /**
+ * Desc: 查询已经存在的关注
+ * @param attentionType
+ * @param list
+ * @author zxc
+ * @date 2022/3/28 17:29
+ */
+ List getExistList(@Param("attentionType")Integer attentionType,@Param("list")List list);
+
+ /**
+ * 返回idCardSet中已经关注的身份证号
+ *
+ * @param idCardSet
+ * @param attentionType
+ * @return
+ */
+ List getIdCardList(@Param("customerId") String customerId,@Param("idCardSet") List idCardSet, @Param("attentionType") Integer attentionType);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java
new file mode 100644
index 0000000000..0117f48651
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcFollowUpRecordDao.java
@@ -0,0 +1,16 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.IcFollowUpRecordEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 随访记录表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-25
+ */
+@Mapper
+public interface IcFollowUpRecordDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
new file mode 100644
index 0000000000..5496919f3c
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java
@@ -0,0 +1,69 @@
+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;
+import com.epmet.entity.IcNatEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 核酸上报记录
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-25
+ */
+@Mapper
+public interface IcNatDao extends BaseDao {
+
+ /**
+ * @Author sun
+ * @Description 核酸检测-按条件查询核酸记录
+ **/
+ List getMyNatList(MyNatListFormDTO formDTO);
+
+ /**
+ * @Author sun
+ * @Description 【核酸】本辖区核酸检测信息列表
+ **/
+ List getNatList(MyNatListFormDTO formDTO);
+
+ /**
+ * @Author sun
+ * @Description 【核酸】客户下核酸检测信息列表
+ **/
+ List getCustomerNatList(MyNatListFormDTO formDTO);
+
+ /**
+ * @Author sun
+ * @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, @Param("natResult") String natResult);
+
+ /**
+ * desc:根据客户id 更新是否居民状态
+ *
+ * @param customerId
+ * @param icResiUserId 如果为空则更新全部
+ * @return
+ */
+ int updateIsResiFlag(@Param("customerId") String customerId, @Param("icResiUserId") String icResiUserId);
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java
new file mode 100644
index 0000000000..0b37f87121
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatRelationDao.java
@@ -0,0 +1,22 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.IcNatRelationEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 核酸记录关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-31
+ */
+@Mapper
+public interface IcNatRelationDao extends BaseDao {
+
+ /**
+ * @Author sun
+ * @Description 关系数据删除--物理删除
+ **/
+ int delRelation(@Param("icNatId") String icNatId, @Param("agencyId") String agencyId);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java
new file mode 100644
index 0000000000..a5f035887d
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNoticeDao.java
@@ -0,0 +1,16 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.IcNoticeEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 防疫通知
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-03-28
+ */
+@Mapper
+public interface IcNoticeDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
index f70f0e04ff..2602b5858a 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java
@@ -23,7 +23,8 @@ public interface IcResiCollectDao extends BaseDao {
int updateRec(@Param("id") String id,
@Param("houseType") String houseType,
@Param("houseHolderName") String houseHolderName,
- @Param("totalResi") Integer totalResi);
+ @Param("totalResi") Integer totalResi,
+ @Param("updatedBy") String updatedBy);
/**
* Desc: 查询采集居民信息
@@ -33,4 +34,11 @@ public interface IcResiCollectDao extends BaseDao {
*/
List getCollectList(CollectListFormDTO formDTO);
+ /**
+ * 我上次提交的主表记录
+ * @param customerId
+ * @param userId
+ * @return
+ */
+ String selectLastSubmitId(@Param("customerId") String customerId, @Param("userId") String userId);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
index e4748e01b2..e61539e1da 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiMemberDao.java
@@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.IcResiCollectMemFormDTO;
import com.epmet.entity.IcResiMemberEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 居民信息成员表
@@ -12,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcResiMemberDao extends BaseDao {
-
+
+ List selectMySubmit(@Param("latestResiCollectId") String latestResiCollectId, @Param("userId")String userId);
}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
index 596b61446d..f5ebf8ac51 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
@@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.IcResiUserDTO;
+import com.epmet.dto.form.EpidemicPreventionFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
@@ -53,15 +54,16 @@ public interface IcResiUserDao extends BaseDao {
**/
void upTable(@Param("tableName") String tableName, @Param("id") String id, @Param("map") Map map);
- List