diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java
index bb889a5913..26a0e2d01a 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/MaskResponse.java
@@ -15,6 +15,7 @@ public @interface MaskResponse {
*/
String MASK_TYPE_ID_CARD = "ID_CARD";
String MASK_TYPE_MOBILE = "MOBILE";
+ String MASK_TYPE_CHINESE_NAME = "CHINESE_NAME";
///**
// * 默认的一些字段,如果没有手动指定,就会使用默认的。如果手动指定了,就不再使用默认的
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java
index 24bce5bff3..a3169a2ec6 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java
@@ -133,11 +133,35 @@ public class MaskProcessor {
return maskIdCard(originString);
} else if (MaskResponse.MASK_TYPE_MOBILE.equals(maskType)) {
return maskMobile(originString);
+ } else if (MaskResponse.MASK_TYPE_CHINESE_NAME.equals(maskType)) {
+ return maskChineseName(originString);
} else {
return originString;
}
}
+ /**
+ * 对中文人名进行打码
+ * @param originString
+ * @return
+ */
+ private String maskChineseName(String originString) {
+ if (StringUtils.isBlank(originString)) {
+ // 空串,或者只有一个字的,不打码,直接返回
+ return originString;
+ }
+
+ int length = originString.length();
+ // 2个字以上的,首位字母明文,中间*
+ // 中文不能用\\w,要用[\u4e00-\u9fa5]
+ if (length == 2) {
+ return originString.replaceAll("^([\\u4e00-\\u9fa5]).*$", "$1*");
+ } else {
+ String maskStr = StrUtil.repeat("*", length - 2);
+ return originString.replaceAll("^([\\u4e00-\\u9fa5]).*([\\u4e00-\\u9fa5])$", "$1" + maskStr + "$2");
+ }
+ }
+
/**
* 唯一整件号打码,可能是身份证号或者是护照号
* 将明文字符串打码变为掩码。保留前6,后面打码
@@ -161,12 +185,15 @@ public class MaskProcessor {
return originString.replaceAll("^(\\d{10})\\d+([a-zA-Z0-9]{2})$", new StringBuilder("$1").append(maskStr).append("$2").toString());
} else if (regexUtil.getTypeEnum() == IdCardTypeEnum.PASSPORT) {
// 护照,前两位,后两位为明文,其他*
- String maskStr = StrUtil.repeatByLength("*", originString.length() - 4);
- return originString.replaceAll("^([a-zA-Z0-9]{2})\\d+(\\d{2})$", new StringBuilder("$1").append(maskStr).append("$2").toString());
- } else {
- // 其他情况,不码
- return originString;
+ int clearLength = 4;
+ int maskedLength = 0;
+ if ((maskedLength = originString.length() - clearLength) > 0) {
+ String maskStr = StrUtil.repeatByLength("*", maskedLength);
+ return originString.replaceAll("^([a-zA-Z0-9]{2})[a-zA-Z0-9]+([a-zA-Z0-9]{2})$", new StringBuilder("$1").append(maskStr).append("$2").toString());
+ }
}
+
+ return originString;
}
/**
diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
index d44e9bb3fb..96d7d02a62 100644
--- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
+++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
@@ -25,7 +25,7 @@ public class IdCardRegexUtils {
/**
* 9位护照
*/
- private static final Pattern PATTERN_9_PASSPORT = Pattern.compile("^[a-zA-Z]{2}\\d{7}$|^[a-zA-Z]{1}\\d{8}$");
+ private static final Pattern PATTERN_9_PASSPORT = Pattern.compile("^[a-zA-Z0-9]{8,9}$");
private String inputText;
@@ -86,7 +86,7 @@ public class IdCardRegexUtils {
}
}
- if (input.length() == 9) {
+ if (input.length() == 9 || input.length() == 8) {
Matcher matcher = PATTERN_9_PASSPORT.matcher(input);
if (matcher.matches()) {
return new IdCardRegexUtils(IdCardTypeEnum.PASSPORT, matcher, input);
diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
index 9ba9386fb3..49dad70cf7 100644
--- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
+++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
@@ -7,13 +7,13 @@
+
+ select *
+ from ic_building_unit
+ where DEL_FLAG = '0'
+ and CUSTOMER_ID = #{customerId}
+ and BUILDING_ID = #{buildId}
+ and UNIT_NAME = #{unitName}
+
+
+
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 6098775330..5d6fbe270f 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
@@ -550,5 +550,14 @@
and DOOR_NAME = #{doorName}
+
+ select *
+ from ic_house
+ where del_flag = '0'
+ and CUSTOMER_ID = #{customerId}
+ and BUILDING_UNIT_ID = #{unitId}
+ and DOOR_NAME = #{homeName}
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
index 2f76bc1b7a..96ec0dd57f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
@@ -662,6 +662,15 @@
ORDER BY
SORT, DOOR_NAME+0
+
+ select *
+ from ic_neighbor_hood
+ where DEL_FLAG = '0'
+ and CUSTOMER_ID = #{customerId}
+ and GRID_ID = #{gridId}
+ and NEIGHBOR_HOOD_NAME = #{villageName}
+
diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
index 3bb3a435d7..8d502c339d 100644
--- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
+++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
@@ -403,7 +403,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl{
if(topicInfo.getPublishedUser().equals(re.getUserId())){
//话题发起人
- String street = re.getStreet() == null ? "" : re.getStreet() + "-";
+// String street = re.getStreet() == null ? "" : re.getStreet() + "-";
String realName = re.getRealName() == null ? "" : re.getRealName();
- topicInfo.setPublishedUser(street + realName);
+ topicInfo.setPublishedUser(realName);
}
});
} else {
@@ -2754,7 +2754,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl{
if(issueResult.getUserId().equals(re.getUserId())){
//话题发起人
- String street = re.getStreet() == null ? "" : re.getStreet() + "-";
String realName = re.getRealName() == null ? "" : re.getRealName();
- issueDetailResult.setIssueInitiator(street + realName);
+ issueDetailResult.setIssueInitiator(realName);
}
});
} else {
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java
index 08c5da3ce1..a7d56eeec7 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java
@@ -90,6 +90,7 @@ public class IcVaccinePrarmeterDTO implements Serializable {
* 户口性质:0户籍 1外来
*/
private String householdType;
+ private String householdTypeName;
/**
* 姓名
@@ -110,6 +111,7 @@ public class IcVaccinePrarmeterDTO implements Serializable {
* 是否接种:0否1是
*/
private String isVaccination;
+ private String isVaccinationName;
/**
* 第一次接种时间
@@ -181,4 +183,15 @@ public class IcVaccinePrarmeterDTO implements Serializable {
*/
private Date updatedTime;
-}
\ No newline at end of file
+ /**
+ * 审核状态:0待审核 1审核不通过 2审核通过
+ */
+ private String checkState;
+ private String checkStateName;
+
+ /**
+ * 审核理由
+ */
+ private String checkReason;
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
index 6ef7eb715e..5cc4b7ea6a 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
@@ -54,7 +54,7 @@ public class EditInfoFormDTO implements Serializable {
/**
* 路牌号
*/
- @NotBlank(message = "路牌号不能为空",groups = AddUserShowGroup.class)
+// @NotBlank(message = "路牌号不能为空",groups = AddUserShowGroup.class)
private String street;
/**
* 小区名称
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridInfoVaccinePrarmeterFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridInfoVaccinePrarmeterFormDTO.java
new file mode 100644
index 0000000000..18e124e529
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridInfoVaccinePrarmeterFormDTO.java
@@ -0,0 +1,36 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 所属网格
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-20
+ */
+@Data
+public class GridInfoVaccinePrarmeterFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 所属网格名称
+ */
+ private String gridName;
+
+ /**
+ * 当前登录人组织ID
+ */
+ private String agencyId;
+
+
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcVaccineCheckFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcVaccineCheckFormDTO.java
new file mode 100644
index 0000000000..7eb317b62e
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcVaccineCheckFormDTO.java
@@ -0,0 +1,79 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 新冠病毒疫苗接种人员信息台账-审核入参
+ *
+ * @author wgf
+ * @since v1.0.0 2022-08-25
+ */
+@Data
+public class IcVaccineCheckFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ @NotBlank(message = "Id不能为空")
+ private String id;
+
+ /**
+ * 审核状态:0待审核 1未通过 2已通过
+ */
+ @NotBlank(message = "审核状态不能为空")
+ private String checkState;
+
+ /**
+ * 审核原因
+ */
+ private String checkReason;
+
+ /**
+ * 所属小区ID;
+ */
+ private String villageId;
+
+ /**
+ * 所属楼宇Id
+ */
+ private String buildId;
+
+ /**
+ * 单元号
+ */
+ private String unitId;
+
+ /**
+ * 房间ID
+ */
+ private String homeId;
+
+ /**
+ * 房间号
+ */
+ private String homeName;
+
+ /**
+ * 客户ID(审核人)
+ */
+ private String customerId;
+
+ /**
+ * 员工ID(审核人)
+ */
+ private String userId;
+
+ /**
+ * 员工姓名(审核人)
+ */
+ private String realName;
+
+
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePrarmeterListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePrarmeterListFormDTO.java
new file mode 100644
index 0000000000..859a30a01d
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinePrarmeterListFormDTO.java
@@ -0,0 +1,51 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.dto.form.PageFormDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author wgf
+ * @DateTime 2022/8/22 10:30
+ * @DESC
+ */
+@Data
+public class VaccinePrarmeterListFormDTO extends PageFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -498378993902522370L;
+
+ /**
+ * 手机号
+ */
+ private String mobile;
+
+ /**
+ * 地点名称
+ */
+ private String name;
+
+ /**
+ * 证件号
+ */
+ private String idCard;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+ /**
+ * 部门ID
+ */
+ private String agencyId;
+
+ private String isVaccination;
+ private String gridId;
+ private String villageId;
+ private String buildId;
+ private String unitId;
+ private String homeId;
+
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
index 3ef123383f..a62980703a 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
@@ -1365,7 +1365,8 @@ public class IcResiUserController implements ResultDataResolver {
* @return
*/
@PostMapping("listresi-zhzl")
- @MaskResponse(fieldNames = {"MOBILE", "ID_CARD"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD})
+ @MaskResponse(fieldNames = {"MOBILE", "ID_CARD", "NAME"},
+ fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_CHINESE_NAME})
public Result>> listResiZhzl(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO) {
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
pageFormDTO.setStaffId(tokenDto.getUserId());
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java
index 102e5e0ea7..217c0600cf 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java
@@ -1,21 +1,42 @@
package com.epmet.controller;
+import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.dto.form.PageFormDTO;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+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.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.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.commons.tools.validator.group.UpdateGroup;
+import com.epmet.constants.ImportTaskConstants;
+import com.epmet.dao.IcVaccinePrarmeterDao;
import com.epmet.dto.IcVaccinePrarmeterDTO;
+import com.epmet.dto.form.IcVaccineCheckFormDTO;
+import com.epmet.dto.form.ImportTaskCommonFormDTO;
+import com.epmet.dto.form.VaccinePrarmeterListFormDTO;
+import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcVaccinePrarmeterExcel;
+import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcVaccinePrarmeterService;
+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.HashMap;
import java.util.List;
import java.util.Map;
@@ -28,14 +49,23 @@ import java.util.Map;
*/
@RestController
@RequestMapping("icVaccinePrarmeter")
+@Slf4j
public class IcVaccinePrarmeterController {
@Autowired
private IcVaccinePrarmeterService icVaccinePrarmeterService;
+ @Autowired
+ private IcVaccinePrarmeterDao icVaccinePrarmeterDao;
+
+ @Autowired
+ private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+
@RequestMapping("page")
- public Result> page(@RequestParam Map params){
- PageData page = icVaccinePrarmeterService.page(params);
+// @MaskResponse(fieldNames = {"MOBILE", "ID_CARD"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD})
+ public Result> page(@RequestParam Map params, @LoginUser TokenDto tokenDto){
+// PageData page = icVaccinePrarmeterService.page(params);
+ PageData page = icVaccinePrarmeterService.getPhrasePage(params,tokenDto);
return new Result>().ok(page);
}
@@ -47,7 +77,7 @@ public class IcVaccinePrarmeterController {
@NoRepeatSubmit
@PostMapping("save")
- public Result save(@RequestBody IcVaccinePrarmeterDTO dto){
+ public Result save(@RequestBody IcVaccinePrarmeterDTO dto, @LoginUser TokenDto tokenDto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icVaccinePrarmeterService.save(dto);
@@ -55,7 +85,7 @@ public class IcVaccinePrarmeterController {
}
@NoRepeatSubmit
- @PutMapping("update")
+ @PostMapping("update")
public Result update(@RequestBody IcVaccinePrarmeterDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@@ -77,6 +107,97 @@ public class IcVaccinePrarmeterController {
ExcelUtils.exportExcelToTarget(response, null, list, IcVaccinePrarmeterExcel.class);
}
+ /**
+ * Desc: 【新冠病毒疫苗接种人员信息台账】导出
+ * @param response
+ * @param formDTO
+ * @param tokenDto
+ * @author wgf
+ * @date 2022/6/24 13:57
+ */
+ @PostMapping("vaccine-export")
+ public void vaccineExport(HttpServletResponse response, @RequestBody VaccinePrarmeterListFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception {
+ ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ // 获取工作人员缓存信息
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
+ if (null == staffInfo) {
+ throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", tokenDto.getUserId()));
+ }
+ formDTO.setAgencyId(staffInfo.getAgencyId());
+ List list = icVaccinePrarmeterDao.vaccineExport(formDTO);
+ ExcelUtils.exportExcelToTarget(response, null, list, IcVaccinePrarmeterExcel.class);
+
+ }
+
+ /**
+ * 导出模板
+ * @param response
+ * @throws Exception
+ */
+ @PostMapping("exporttemplate")
+ public void exportTemplate( HttpServletResponse response) throws Exception {
+ TemplateExportParams templatePath = new TemplateExportParams("excel/ic_vaccine_prarmeter_excel.xls");
+ ExcelPoiUtils.exportExcel(templatePath ,new HashMap<>(),"新冠病毒疫苗接种人员信息台账",response);
+ }
+
+ /**
+ * Desc: 【新冠病毒疫苗接种人员信息台账】导入
+ * @param
+ * @author wgf
+ * @date 2022/8/22 13:40
+ */
+ @PostMapping("importFile")
+ public Result importFile(@LoginUser TokenDto tokenDto, @RequestParam("file") MultipartFile file){
+ if (file.isEmpty()) {
+ throw new EpmetException("请上传文件");
+ }
+ // 校验文件类型
+ String extension = FilenameUtils.getExtension(file.getOriginalFilename());
+ if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
+ throw new EpmetException("文件类型不匹配");
+ }
+
+ ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO();
+ importTaskForm.setOriginFileName(file.getOriginalFilename());
+ importTaskForm.setOperatorId(tokenDto.getUserId());
+ importTaskForm.setBizType(ImportTaskConstants.IC_VACCINE_PRARMETER);
+ 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("读取文件失败");
+ }
+ icVaccinePrarmeterService.importFile(tokenDto,inputStream,result.getData().getTaskId());
+ return new Result();
+ }
+
+ /**
+ * 信息采集-审核
+ * @param formDTO
+ * @param tokenDto
+ * @return
+ */
+ @PostMapping("vaccineCheck")
+ public Result vaccineCheck(@RequestBody IcVaccineCheckFormDTO formDTO, @LoginUser TokenDto tokenDto) {
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ icVaccinePrarmeterService.vaccineCheck(formDTO,tokenDto);
+
+ return new Result();
+ }
+
+
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java
index d4db61ad5b..55b4591be3 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java
@@ -64,4 +64,12 @@ public interface IcVaccineDao extends BaseDao {
IcVaccineDTO getVaccineDTO(@Param("customerId") String customerId, @Param("icVaccineId") String icVaccineId, @Param("idCard") String idCard, @Param("inoculateTime") String inoculateTime);
+ /**
+ * 根据身份证号以及接种时间查询接种信息
+ * @param idCard
+ * @param time
+ * @return
+ */
+ List getVaccineListByIdCard(@Param("idCard") String idCard,@Param("time") String time);
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java
index a2e7c17a67..c5bdfcdbf7 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java
@@ -1,9 +1,15 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.IcPointNucleicMonitoringDTO;
+import com.epmet.dto.IcVaccinePrarmeterDTO;
+import com.epmet.dto.form.VaccinePrarmeterListFormDTO;
import com.epmet.entity.IcVaccinePrarmeterEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+import java.util.Map;
+
/**
* 新冠病毒疫苗接种人员信息台账
*
@@ -12,5 +18,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcVaccinePrarmeterDao extends BaseDao {
-
-}
\ No newline at end of file
+
+ List vaccineExport(VaccinePrarmeterListFormDTO formDTO);
+
+ /**
+ * 条件查询
+ * @param params
+ * @return
+ */
+ List getPhrasePage(Map params);
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java
index 60d80b3f61..6d087a1055 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java
@@ -14,4 +14,8 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface IcVaccineRelationDao extends BaseDao {
int delRelation(@Param("icVaccineId") String icNatId, @Param("agencyId") String agencyId);
-}
\ No newline at end of file
+
+ void updateRelationInfoByVaccineId(IcVaccineRelationEntity icVaccineRelationEntity);
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java
index c5dde0c103..c6b982f80d 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java
@@ -151,4 +151,14 @@ public class IcVaccinePrarmeterEntity extends BaseEpmetEntity {
*/
private String note;
+ /**
+ * 审核状态:0待审核 1审核不通过 2审核通过
+ */
+ private String checkState;
+
+ /**
+ * 审核理由
+ */
+ private String checkReason;
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java
index dc58b059b3..06cb0b9e15 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java
@@ -14,49 +14,28 @@ import java.util.Date;
@Data
public class IcVaccinePrarmeterExcel {
- @Excel(name = "主键")
- private String id;
- @Excel(name = "客户Id customer.id")
- private String customerId;
-
- @Excel(name = "网格ID")
- private String gridId;
@Excel(name = "网格名称")
private String gridName;
- @Excel(name = "组织Id")
- private String agencyId;
-
- @Excel(name = "组织的pids")
- private String pids;
-
- @Excel(name = "所属小区ID;")
- private String villageId;
@Excel(name = "所属小区名称")
private String villageName;
- @Excel(name = "所属楼宇Id")
- private String buildId;
@Excel(name = "所属楼宇名称")
private String buildName;
- @Excel(name = "单元id")
- private String unitId;
@Excel(name = "单元名")
private String unitName;
- @Excel(name = "所属家庭Id")
- private String homeId;
@Excel(name = "房间名")
private String homeName;
- @Excel(name = "户口性质:0户籍 1外来")
+ @Excel(name = "户口性质", replace = {"户籍_0","外来_1"})
private String householdType;
@Excel(name = "姓名")
@@ -65,10 +44,10 @@ public class IcVaccinePrarmeterExcel {
@Excel(name = "联系电话")
private String mobile;
- @Excel(name = "身份证号")
+ @Excel(name = "证件号")
private String idCard;
- @Excel(name = "是否接种:0否1是")
+ @Excel(name = "是否接种", replace = {"否_0","是_1"})
private String isVaccination;
@Excel(name = "第一次接种时间")
@@ -89,29 +68,18 @@ public class IcVaccinePrarmeterExcel {
@Excel(name = "第三次接种地点")
private String thirdVacSite;
- @Excel(name = "原因:禁忌症/拒绝接种/其他原因")
+ @Excel(name = "原因")
private String reason;
@Excel(name = "备注")
private String note;
- @Excel(name = "删除标识 0.未删除 1.已删除")
- private Integer delFlag;
-
- @Excel(name = "乐观锁")
- private Integer revision;
-
- @Excel(name = "创建人")
- private String createdBy;
-
- @Excel(name = "创建时间")
- private Date createdTime;
+ @Excel(name = "审核状态", replace = {"待审核_0","审核不通过_1","审核通过_2"})
+ private String checkState;
- @Excel(name = "更新人")
- private String updatedBy;
+ @Excel(name = "审核理由")
+ private String checkReason;
- @Excel(name = "更新时间")
- private Date updatedTime;
-}
\ No newline at end of file
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterImportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterImportExcel.java
new file mode 100644
index 0000000000..3d9ed7a6a7
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterImportExcel.java
@@ -0,0 +1,97 @@
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 新冠病毒疫苗接种人员信息台账
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-08-22
+ */
+@Data
+public class IcVaccinePrarmeterImportExcel {
+
+ @Excel(name = "所属网格")
+ private String gridName;
+
+ @Excel(name = "所属小区")
+ private String villageName;
+
+ @Excel(name = "所属楼宇")
+ private String buildName;
+
+ @Excel(name = "单元")
+ private String unitName;
+
+ @Excel(name = "所属家庭")
+ private String homeName;
+
+ @Excel(name = "户口性质", replace = {"户籍_0","外来_1"})
+ private String householdType;
+
+ @Excel(name = "姓名")
+ private String name;
+
+ @Excel(name = "联系电话")
+ private String mobile;
+
+ @Excel(name = "证件号")
+ private String idCard;
+
+ @Excel(name = "是否接种", replace = {"否_0","是_1"})
+ private String isVaccination;
+
+ @Excel(name = "第一次接种时间", format = "yyyy-MM-dd HH:mm:ss")
+ private String firstVacTime;
+
+ @Excel(name = "第一次接种地点")
+ private String firstVacSite;
+
+ @Excel(name = "第二次接种时间", format = "yyyy-MM-dd HH:mm:ss")
+ private String secondVacTime;
+
+ @Excel(name = "第二次接种地点")
+ private String secondVacSite;
+
+ @Excel(name = "第三次接种时间", format = "yyyy-MM-dd HH:mm:ss")
+ private String thirdVacTime;
+
+ @Excel(name = "第三次接种地点")
+ private String thirdVacSite;
+
+ @Excel(name = "原因")
+ private String reason;
+
+ @Excel(name = "备注")
+ private String note;
+
+ @ExcelIgnore
+ private Boolean addStatus = false;
+
+ @ExcelIgnore
+ private Integer num;
+
+ /**
+ * 所属网格ID
+ */
+ @ExcelIgnore
+ private String gridId;
+
+ /**
+ * 组织ID
+ */
+ @ExcelIgnore
+ private String agencyId;
+
+ /**
+ * 组织ID所有上级
+ */
+ @ExcelIgnore
+ private String pids;
+
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/IcVaccinePrarmeterImportErrorModel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/IcVaccinePrarmeterImportErrorModel.java
new file mode 100644
index 0000000000..8cce05d852
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/error/IcVaccinePrarmeterImportErrorModel.java
@@ -0,0 +1,77 @@
+package com.epmet.excel.error;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author wgf
+ * @DateTime 2022/6/21 16:57
+ * @DESC
+ */
+@Data
+public class IcVaccinePrarmeterImportErrorModel {
+
+ @Excel(name = "行号",width = 10)
+ private Integer num;
+
+
+ @Excel(name = "所属网格",width = 30)
+ private String gridName;
+
+ @Excel(name = "所属小区",width = 30)
+ private String villageName;
+
+ @Excel(name = "所属楼宇",width = 30)
+ private String buildName;
+
+ @Excel(name = "单元",width = 30)
+ private String unitName;
+
+ @Excel(name = "所属家庭",width = 30)
+ private String homeName;
+
+ @Excel(name = "户口性质", width = 30, replace = {"户籍_0","外来_1"})
+ private String householdType;
+
+ @Excel(name = "姓名",width = 30)
+ private String name;
+
+ @Excel(name = "联系电话",width = 30)
+ private String mobile;
+
+ @Excel(name = "证件号",width = 30)
+ private String idCard;
+
+ @Excel(name = "是否接种", width = 30, replace = {"否_0","是_1"})
+ private String isVaccination;
+
+ @Excel(name = "第一次接种时间",width = 30)
+ private String firstVacTime;
+
+ @Excel(name = "第一次接种地点",width = 30)
+ private String firstVacSite;
+
+ @Excel(name = "第二次接种时间",width = 30)
+ private String secondVacTime;
+
+ @Excel(name = "第二次接种地点",width = 30)
+ private String secondVacSite;
+
+ @Excel(name = "第三次接种时间",width = 30)
+ private String thirdVacTime;
+
+ @Excel(name = "第三次接种地点",width = 30)
+ private String thirdVacSite;
+
+ @Excel(name = "原因",width = 30)
+ private String reason;
+
+ @Excel(name = "备注",width = 30)
+ private String note;
+
+ @Excel(name = "错误信息", width = 200)
+ private String errorMsg;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
index be03fdfc96..dd77ffba06 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
@@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommunityInfoResultDTO;
+import com.epmet.dto.result.GridInfoByNameResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.IcHouseInfoCollectResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
@@ -74,6 +75,16 @@ public interface GovOrgFeignClient {
@PostMapping("/gov/org/customeragency/getCommunityInfo")
Result getCommunityInfo(OrgInfoPointFormDTO formDTO);
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author wgf
+ * @Description 根据网格名称查询所属网格信息
+ * @Date 2020/4/26 23:16
+ **/
+ @PostMapping("/gov/org/customeragency/getGridInfoByGridName")
+ Result getGridInfoByGridName(GridInfoVaccinePrarmeterFormDTO formDTO);
+
/**
* @param userId
* @return com.epmet.commons.tools.utils.Result
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
index 77d306b310..a89cf10924 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
@@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommunityInfoResultDTO;
+import com.epmet.dto.result.GridInfoByNameResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.IcHouseInfoCollectResultDTO;
import com.epmet.feign.GovOrgFeignClient;
@@ -46,6 +47,11 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfo",formDTO);
}
+ @Override
+ public Result getGridInfoByGridName(GridInfoVaccinePrarmeterFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfoByGridName",formDTO);
+ }
+
@Override
public Result getCommunityInfoByUserId(String userId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCommunityInfoByUserId",userId);
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java
index 435b99f213..83b08d384e 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java
@@ -135,7 +135,7 @@ public class UserBaseInfoRedis {
&& StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())){
String gridFullName = gridResult.getData().getBelongsGridName();
baseInfo.setRegisteredGridName(gridFullName);
- StringBuffer buffer = new StringBuffer(gridFullName.split(ModuleConstant.DASH)[NumConstant.ONE]).append(ModuleConstant.DASH).append(baseInfo.getSurname());
+ StringBuffer buffer = new StringBuffer(baseInfo.getSurname());
switch (baseInfo.getGender()) {
case NumConstant.ONE_STR:
buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE);
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java
index 8aaf21fe7d..70d92655a5 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java
@@ -91,8 +91,8 @@ public interface IcPointNucleicMonitoringService extends BaseService page(Map params);
+ /**
+ * 分页条件查询
+ * @param params
+ * @return
+ */
+ PageData getPhrasePage(Map params, TokenDto tokenDto);
+
/**
* 默认查询
*
@@ -75,4 +86,20 @@ public interface IcVaccinePrarmeterService extends BaseService implements IcVaccinePrarmeterService {
+@Slf4j
+public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl implements IcVaccinePrarmeterService,ResultDataResolver {
- @Autowired
+ @Resource
private IcVaccinePrarmeterRedis icVaccinePrarmeterRedis;
+ @Resource
+ private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
+
+ @Resource
+ private OssFeignClient ossFeignClient;
+
+ @Resource
+ private GovOrgFeignClient govOrgFeignClient;
+
+ @Resource
+ private IcResiUserDao icResiUserDao;
+
+ @Resource
+ private IcUserChangeRecordService icUserChangeRecordService;
+
+ @Resource
+ private IcVaccineDao icVaccineDao;
+
+ @Resource
+ private IcVaccineRelationDao icVaccineRelationDao;
+
+ @Autowired
+ private EpmetUserOpenFeignClient userOpenFeignClient;
+
+
@Override
public PageData page(Map params) {
IPage page = baseDao.selectPage(
@@ -41,6 +118,25 @@ public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl getPhrasePage(Map params, TokenDto tokenDto) {
+ params.put("customerId",tokenDto.getCustomerId());
+ // 获取工作人员缓存信息
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
+ if (null == staffInfo) {
+ throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", tokenDto.getUserId()));
+ }
+ params.put("agencyId",staffInfo.getAgencyId());
+ IPage page = getPage(params);
+ List list = baseDao.getPhrasePage(params);
+ return new PageData<>(list, page.getTotal());
+ }
+
@Override
public List list(Map params) {
List entityList = baseDao.selectList(getWrapper(params));
@@ -66,14 +162,26 @@ public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl errorInfo = new ArrayList<>();
+
+ try {
+ List list = ExcelPoiUtils.importExcel(inputStream, 0,1, IcVaccinePrarmeterImportExcel.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());
+ }
+
+ // 校验空单元格以及网格名称是否正确
+ checkInfo(list,errorInfo,tokenDto);
+
+ if (list.size() > errorInfo.size()){
+ Map groupByName = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getName, Collectors.counting()));
+ groupByName.forEach((name,count) -> {
+ if (Integer.valueOf(count.toString()).compareTo(1) != 0){
+ for (IcVaccinePrarmeterImportExcel i : list) {
+ if (name.equals(i.getName()) && !i.getAddStatus()){
+ errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
+ i.setAddStatus(true);
+ }
+ }
+ }
+ });
+ }
+ Map> groupByStatus = list.stream().collect(Collectors.groupingBy(IcVaccinePrarmeterImportExcel::getAddStatus));
+ List needInsert = groupByStatus.get(false);
+ if (CollectionUtils.isNotEmpty(needInsert)){
+ List entities = ConvertUtils.sourceToTarget(needInsert, IcVaccinePrarmeterEntity.class);
+ entities.forEach(e -> {
+ // 设置客户ID
+ e.setCustomerId(tokenDto.getCustomerId());
+ // 设置审核状态为待审核
+ e.setCheckState("0");
+ });
+ insertBatch(entities);
+ }
+ if (CollectionUtils.isNotEmpty(errorInfo)){
+ String url = importOssUpload(errorInfo, IcVaccinePrarmeterImportErrorModel.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,"");
+ }
+ }
+
+ /**
+ * 校验空单元格以及网格名称是否正确
+ * @param list
+ * @param errorInfo
+ * @param tokenDto
+ */
+ public void checkInfo(List list, List errorInfo, TokenDto tokenDto){
+ LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO();
+ form.setUserId(tokenDto.getUserId());
+ form.setClient(tokenDto.getClient());
+ form.setApp(tokenDto.getApp());
+ LoginUserDetailsResultDTO userDetailsResultDTO = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form), ServiceConstant.EPMET_USER_SERVER,
+ EpmetErrorCode.SERVER_ERROR.getCode(),
+ "获取当前登录人组织id失败",
+ null);
+
+ for (int i = 0; i < list.size(); i++) {
+ list.get(i).setNum(i+1);
+ if (StringUtils.isBlank(list.get(i).getGridName()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "所属网格不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if (StringUtils.isBlank(list.get(i).getVillageName()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "所属小区不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if (StringUtils.isBlank(list.get(i).getBuildName()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "所属楼宇不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if (StringUtils.isBlank(list.get(i).getUnitName()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "单元不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if (StringUtils.isBlank(list.get(i).getHomeName()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "门牌号不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ 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 (StringUtils.isBlank(list.get(i).getIsVaccination()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "是否接种不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if("0".equals(list.get(i).getIsVaccination())){
+ // 未接种 判断是否填写原因
+ if (StringUtils.isBlank(list.get(i).getReason()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "选择未接种时,原因不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if("其他原因".equals(list.get(i).getReason())){
+ // 未接种原因选择其他,判断是否填写备注
+ if (StringUtils.isBlank(list.get(i).getNote()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "选择其他原因时,备注不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ }
+
+ }else{
+ // 已接种 判断是否填写接种时间地点
+ if (StringUtils.isBlank(list.get(i).getFirstVacTime()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "第一次接种时间不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+ if (StringUtils.isBlank(list.get(i).getFirstVacSite()) && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "第一次接种地点不能为空",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }
+// if (StringUtils.isBlank(list.get(i).getSecondVacTime()) && !list.get(i).getAddStatus()){
+// errorInfo.add(getErrorInfo(list.get(i), "第二次接种时间不能为空",i+1));
+// list.get(i).setAddStatus(true);
+// continue;
+// }
+// if (StringUtils.isBlank(list.get(i).getSecondVacSite()) && !list.get(i).getAddStatus()){
+// errorInfo.add(getErrorInfo(list.get(i), "第二次接种地点不能为空",i+1));
+// list.get(i).setAddStatus(true);
+// continue;
+// }
+// if (StringUtils.isBlank(list.get(i).getThirdVacTime()) && !list.get(i).getAddStatus()){
+// errorInfo.add(getErrorInfo(list.get(i), "第三次接种时间不能为空",i+1));
+// list.get(i).setAddStatus(true);
+// continue;
+// }
+// if (StringUtils.isBlank(list.get(i).getThirdVacSite()) && !list.get(i).getAddStatus()){
+// errorInfo.add(getErrorInfo(list.get(i), "第三次接种地点不能为空",i+1));
+// list.get(i).setAddStatus(true);
+// continue;
+// }
+ }
+
+ // 校验所属网格通过名称能否匹配到ID
+ GridInfoVaccinePrarmeterFormDTO formDTO = new GridInfoVaccinePrarmeterFormDTO();
+ formDTO.setGridName(list.get(i).getGridName());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setAgencyId(userDetailsResultDTO.getAgencyId());
+ Result resultDTOResult = govOrgFeignClient.getGridInfoByGridName(formDTO);
+ GridInfoByNameResultDTO gridInfoByNameResultDTO = resultDTOResult.getData();
+ if(gridInfoByNameResultDTO == null && !list.get(i).getAddStatus()){
+ errorInfo.add(getErrorInfo(list.get(i), "所属网格匹配失败",i+1));
+ list.get(i).setAddStatus(true);
+ continue;
+ }else{
+ list.get(i).setGridId(gridInfoByNameResultDTO.getDeptId());
+ list.get(i).setAgencyId(gridInfoByNameResultDTO.getPid());
+ list.get(i).setPids(gridInfoByNameResultDTO.getPids());
+ }
+
+ }
+ }
+
+ /**
+ * Desc: 文件上传并返回url
+ * @param errorRows
+ * @param tClass
+ * @author wgf
+ * @date 2022/8/23 09:16
+ */
+ public String importOssUpload(Collection> errorRows, Class tClass) throws IOException {
+ Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("导入失败的数据列表","导入失败的数据列表"),
+ tClass, errorRows);
+
+ // 文件名
+ String resultDescFileName = UUID.randomUUID().toString().concat(".xls");
+
+ FileItemFactory factory = new DiskFileItemFactory(16, null);
+ FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
+ OutputStream os = fileItem.getOutputStream();
+ Result uploadResult = null;
+ try {
+ workbook.write(os);
+ uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
+ } catch (Exception e) {
+ String errormsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("上传错误描述文件:{}", errormsg);
+ } finally {
+ try {
+ os.close();
+ } catch (IOException e) {
+ String errormsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("上传错误描述文件关闭输出流:{}", errormsg);
+ }
+ try {
+ fileItem.delete();
+ } catch (Exception e) {
+ String errormsg = ExceptionUtils.getErrorStackTrace(e);
+ log.error("上传错误描述文件删除临时文件:{}", errormsg);
+ }
+ }
+
+ if (uploadResult == null || !uploadResult.success()) {
+ log.error("调用OSS上传结果描述文件失败");
+ return null;
+ }
+ return uploadResult.getData().getUrl();
+ }
+
+ /**
+ * Desc: 关闭任务
+ * @param taskId
+ * @param userId
+ * @param status
+ * @param url
+ * @author wgf
+ * @date 2022/8/23 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 wgf
+ * @date 2022/8/23 17:17
+ */
+ public IcVaccinePrarmeterImportErrorModel getErrorInfo(IcVaccinePrarmeterImportExcel dto, String info, Integer num){
+ IcVaccinePrarmeterImportErrorModel result = ConvertUtils.sourceToTarget(dto, IcVaccinePrarmeterImportErrorModel.class);
+ result.setErrorMsg(info);
+ result.setNum(num);
+ return result;
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void vaccineCheck(IcVaccineCheckFormDTO formDTO, TokenDto tokenDto) {
+
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId());
+ formDTO.setRealName(staffInfo.getRealName());
+
+ // 获取新冠病毒疫苗接种人员信息台账表信息
+ IcVaccinePrarmeterEntity icVaccinePrarmeterEntity = baseDao.selectById(formDTO.getId());
+
+ // 更新审核信息
+ icVaccinePrarmeterEntity.setCheckState(formDTO.getCheckState());
+ icVaccinePrarmeterEntity.setCheckReason(formDTO.getCheckReason());
+ icVaccinePrarmeterEntity.setVillageId(formDTO.getVillageId());
+ icVaccinePrarmeterEntity.setBuildId(formDTO.getBuildId());
+ icVaccinePrarmeterEntity.setUnitId(formDTO.getUnitId());
+ icVaccinePrarmeterEntity.setHomeId(formDTO.getHomeId());
+
+ baseDao.updateById(icVaccinePrarmeterEntity);
+
+ // 审核状态:0待审核 1未通过 2已通过
+ if("2".equals(formDTO.getCheckState())){
+
+ String icResiUserId = "";
+
+ // 根据身份证号和房屋ID获取人员信息
+ IcResiUserEntity userIdCardEntity = queryOriginUserByIdCard(icVaccinePrarmeterEntity.getIdCard(),icVaccinePrarmeterEntity.getCustomerId());
+
+ if(StringUtils.isBlank(icVaccinePrarmeterEntity.getHomeId())){
+ // 新增房屋(新增房屋操作已在审核接口之前,前端调用新增接口实现)
+ // 更新登记表房屋ID
+ icVaccinePrarmeterEntity = updateHomeId(icVaccinePrarmeterEntity,formDTO);
+
+ if(userIdCardEntity != null){
+ icResiUserId = userIdCardEntity.getId();
+ // 已存在人员 人员房屋不一致(更新人员信息和变更记录)
+ updateUserInfo(icVaccinePrarmeterEntity,true,formDTO,userIdCardEntity);
+ }else{
+ // 不存在人员
+ icResiUserId = insertUserInfo(icVaccinePrarmeterEntity,formDTO);
+ }
+ }else{
+ // 更新房屋
+ updateHouseInfo(icVaccinePrarmeterEntity);
+
+ Map userMap = queryOriginUserByHomeId(icVaccinePrarmeterEntity.getHomeId(),icVaccinePrarmeterEntity.getCustomerId());
+ if(userIdCardEntity != null){
+ icResiUserId = userIdCardEntity.getId();
+ // 已存在人员
+ if(userMap.containsKey(icVaccinePrarmeterEntity.getIdCard())){
+ // 人员房屋一致(只更新人员信息)
+ updateUserInfo(icVaccinePrarmeterEntity,false,formDTO,userIdCardEntity);
+ }else{
+ // 人员房屋不一致(更新人员信息和变更记录)
+ updateUserInfo(icVaccinePrarmeterEntity,true,formDTO,userIdCardEntity);
+ }
+ }else{
+ // 不存在人员
+ icResiUserId = insertUserInfo(icVaccinePrarmeterEntity,formDTO);
+ }
+ }
+
+ // 同步接种记录 and 疫苗接种记录关系
+ synchronizationVaccineInfo(icVaccinePrarmeterEntity,icResiUserId);
+
+
+ }
+ }
+
+ /**
+ * 同步接种记录 and 疫苗接种记录关系
+ * @param icVaccinePrarmeterEntity
+ * @param icResiUserId
+ */
+ @SneakyThrows
+ private void synchronizationVaccineInfo(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity,String icResiUserId){
+ if(!"1".equals(icVaccinePrarmeterEntity.getIsVaccination())){
+ return;
+ }
+ // 同步接种记录
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ // 处理第一次接种时间格式
+ String firstTime = icVaccinePrarmeterEntity.getFirstVacTime();
+ if(StringUtils.isBlank(firstTime)){
+ return;
+ }
+ Date firstDate = sdf.parse(firstTime);
+ icVaccinePrarmeterEntity.setFirstVacTime(sdf.format(firstDate));
+ // 查询第一次接种信息
+ List icVaccineEntityFirstList = icVaccineDao.getVaccineListByIdCard(icVaccinePrarmeterEntity.getIdCard(),sdf.format(firstDate));
+ if(icVaccineEntityFirstList.size() > 0){
+ // 更新疫苗接种记录 and 疫苗接种记录关系
+ for(IcVaccineEntity entity : icVaccineEntityFirstList){
+ updateVaccineInfo(entity,icVaccinePrarmeterEntity);
+
+ }
+
+ }else{
+ // 新增疫苗接种记录 and 疫苗接种记录关系
+ insertVaccineInfo(icVaccinePrarmeterEntity,icResiUserId,firstDate);
+
+ }
+
+ // 处理第二次接种时间格式
+ String secondTime = icVaccinePrarmeterEntity.getSecondVacTime();
+ if(StringUtils.isBlank(secondTime)){
+ return;
+ }
+ Date secondDate = sdf.parse(secondTime);
+ icVaccinePrarmeterEntity.setSecondVacTime(sdf.format(secondDate));
+ // 查询第二次接种信息
+ List icVaccineEntitySecondList = icVaccineDao.getVaccineListByIdCard(icVaccinePrarmeterEntity.getIdCard(),sdf.format(secondDate));
+ if(icVaccineEntitySecondList.size() > 0){
+ // 更新疫苗接种记录 and 疫苗接种记录关系
+ for(IcVaccineEntity entity : icVaccineEntitySecondList){
+ updateVaccineInfo(entity,icVaccinePrarmeterEntity);
+
+ }
+
+ }else{
+ // 新增疫苗接种记录 and 疫苗接种记录关系
+ insertVaccineInfo(icVaccinePrarmeterEntity,icResiUserId,firstDate);
+
+ }
+
+ // 处理第三次接种时间格式
+ String thirdTime = icVaccinePrarmeterEntity.getThirdVacTime();
+ if(StringUtils.isBlank(thirdTime)){
+ return;
+ }
+ Date thirdDate = sdf.parse(thirdTime);
+ icVaccinePrarmeterEntity.setThirdVacTime(sdf.format(thirdDate));
+ // 查询第三次接种信息
+ List icVaccineEntityThirdList = icVaccineDao.getVaccineListByIdCard(icVaccinePrarmeterEntity.getIdCard(),sdf.format(thirdDate));
+ if(icVaccineEntityThirdList.size() > 0){
+ // 更新疫苗接种记录 and 疫苗接种记录关系
+ for(IcVaccineEntity entity : icVaccineEntityThirdList){
+ updateVaccineInfo(entity,icVaccinePrarmeterEntity);
+
+ }
+
+ }else{
+ // 新增疫苗接种记录 and 疫苗接种记录关系
+ insertVaccineInfo(icVaccinePrarmeterEntity,icResiUserId,firstDate);
+
+ }
+ }
+
+ /**
+ * 更新疫苗接种记录 and 疫苗接种记录关系
+ * @param entity
+ * @param icVaccinePrarmeterEntity
+ */
+ private void updateVaccineInfo(IcVaccineEntity entity,IcVaccinePrarmeterEntity icVaccinePrarmeterEntity){
+ // 更新疫苗接种记录
+ entity.setInoculateAddress(icVaccinePrarmeterEntity.getFirstVacSite());
+ entity.setUserType("prarmeter");
+ entity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ icVaccineDao.updateById(entity);
+
+ // 更新疫苗接种记录关系
+ IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity();
+ icVaccineRelationEntity.setIcVaccineId(entity.getId());
+ icVaccineRelationEntity.setUserType("prarmeter");
+ icVaccineRelationEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ icVaccineRelationDao.updateRelationInfoByVaccineId(icVaccineRelationEntity);
+
+ }
+
+ /**
+ * 新增疫苗接种记录 and 疫苗接种记录关系
+ * @param icVaccinePrarmeterEntity
+ * @param icResiUserId
+ * @param time
+ */
+ private void insertVaccineInfo(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity,String icResiUserId,Date time){
+ IcVaccineEntity icVaccineEntity = new IcVaccineEntity();
+ icVaccineEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ icVaccineEntity.setName(icVaccinePrarmeterEntity.getName());
+ icVaccineEntity.setMobile(icVaccinePrarmeterEntity.getMobile());
+ icVaccineEntity.setIdCard(icVaccinePrarmeterEntity.getIdCard());
+ icVaccineEntity.setIsResiUser("1");
+ icVaccineEntity.setUserType("prarmeter");
+ icVaccineEntity.setUserId(icResiUserId);
+ icVaccineEntity.setInoculateTime(time);
+ icVaccineEntity.setInoculateAddress(icVaccinePrarmeterEntity.getFirstVacSite());
+ icVaccineDao.insert(icVaccineEntity);
+
+ // 新增关系
+ IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity();
+ icVaccineRelationEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ icVaccineRelationEntity.setAgencyId(icVaccinePrarmeterEntity.getAgencyId());
+ icVaccineRelationEntity.setPids(icVaccinePrarmeterEntity.getPids());
+ icVaccineRelationEntity.setIcVaccineId(icVaccineEntity.getId());
+ icVaccineRelationEntity.setUserType("prarmeter");
+ icVaccineRelationDao.insert(icVaccineRelationEntity);
+ }
+
+ /**
+ * 更新新冠病毒疫苗接种人员信息台账表房屋ID
+ * @param icVaccinePrarmeterEntity
+ * @param formDTO
+ * @return
+ */
+ private IcVaccinePrarmeterEntity updateHomeId(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity,IcVaccineCheckFormDTO formDTO){
+
+ // fegin获取房屋信息
+ GetHouseInfoToCollectFormDTO getHouseInfoToCollectFormDTO = new GetHouseInfoToCollectFormDTO();
+ getHouseInfoToCollectFormDTO.setBuildingUnitId(formDTO.getUnitId());
+ getHouseInfoToCollectFormDTO.setDoorName(formDTO.getHomeName());
+ Result resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO);
+ IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData();
+
+ // 新增房屋后需要collect更新上房屋ID
+ // log
+ icVaccinePrarmeterEntity.setHomeId(icHouseInfoCollectResultDTO.getId());
+ baseDao.updateById(icVaccinePrarmeterEntity);
+ return icVaccinePrarmeterEntity;
+
+ }
+
+ /**
+ * 更新房屋信息
+ * @param icVaccinePrarmeterEntity
+ */
+ private void updateHouseInfo(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity){
+ CollectHouseFormDTO collectHouseFormDTO = new CollectHouseFormDTO();
+ collectHouseFormDTO.setId(icVaccinePrarmeterEntity.getHomeId());
+
+
+ // fegin获取房屋信息
+ GetHouseInfoToCollectFormDTO getHouseInfoToCollectFormDTO = new GetHouseInfoToCollectFormDTO();
+ getHouseInfoToCollectFormDTO.setBuildingUnitId(icVaccinePrarmeterEntity.getUnitId());
+ getHouseInfoToCollectFormDTO.setDoorName(icVaccinePrarmeterEntity.getHomeName());
+ Result resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO);
+ IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData();
+
+ collectHouseFormDTO.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ collectHouseFormDTO.setResiNumber((icHouseInfoCollectResultDTO.getResiNumber() + 1));
+ collectHouseFormDTO.setRentFlag(icHouseInfoCollectResultDTO.getRentFlag());
+ collectHouseFormDTO.setOwnerName(icHouseInfoCollectResultDTO.getOwnerName());
+ govOrgFeignClient.updateCollect(collectHouseFormDTO);
+
+ }
+
+ /**
+ * 获取人员信息
+ * @param idCard
+ * @return
+ */
+ private IcResiUserEntity queryOriginUserByIdCard(String idCard,String customerId) {
+ LambdaQueryWrapper query = new LambdaQueryWrapper<>();
+ query.eq(IcResiUserEntity::getIdCard, idCard);
+ query.eq(IcResiUserEntity::getCustomerId, customerId);
+ IcResiUserEntity originUser = icResiUserDao.selectOne(query);
+ return originUser;
+ }
+
+ private Map queryOriginUserByHomeId(String homeId,String customerId) {
+ LambdaQueryWrapper query = new LambdaQueryWrapper<>();
+ query.eq(IcResiUserEntity::getHomeId, homeId);
+ query.eq(IcResiUserEntity::getCustomerId, customerId);
+ List originUserList = icResiUserDao.selectList(query);
+ Map memMap = originUserList.stream().collect(Collectors.toMap(IcResiUserEntity::getIdCard, Function.identity()));
+ return memMap;
+ }
+
+ /**
+ * 更新人员信息
+ * @param icVaccinePrarmeterEntity 登记信息
+ * @param isUpdateLog 是否更新记录
+ * @param formDTO 入参
+ * @param userEntity 根据身份证号查询到的user信息
+ */
+ private void updateUserInfo(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity,Boolean isUpdateLog,
+ IcVaccineCheckFormDTO formDTO,IcResiUserEntity userEntity){
+
+ userEntity.setPids(icVaccinePrarmeterEntity.getPids()); // ic_resi_user表的组织的pids 含agencyId本身
+ userEntity.setAgencyId(icVaccinePrarmeterEntity.getAgencyId());
+ userEntity.setGridId(icVaccinePrarmeterEntity.getGridId());
+ userEntity.setVillageId(icVaccinePrarmeterEntity.getVillageId());
+ userEntity.setBuildId(icVaccinePrarmeterEntity.getBuildId());
+ userEntity.setUnitId(icVaccinePrarmeterEntity.getUnitId());
+ userEntity.setHomeId(icVaccinePrarmeterEntity.getHomeId());
+ userEntity.setName(icVaccinePrarmeterEntity.getName());
+ userEntity.setMobile(icVaccinePrarmeterEntity.getMobile());
+ userEntity.setIdCard(icVaccinePrarmeterEntity.getIdCard());
+ icResiUserDao.updateById(userEntity);
+
+ // 判断是否需要更新记录
+ if(isUpdateLog){
+ //变更记录表
+ IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
+ changeRecordEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ changeRecordEntity.setOperatorId(formDTO.getUserId());
+ changeRecordEntity.setIcUserId(userEntity.getId());
+ changeRecordEntity.setOperatorName(formDTO.getRealName());
+ changeRecordEntity.setIcUserName(userEntity.getName());
+ changeRecordEntity.setType("update");
+ changeRecordEntity.setTypeName("修改");
+ changeRecordEntity.setBeforeChangeName("-");
+ changeRecordEntity.setAfterChangeName("-");
+ changeRecordEntity.setChangeTime(new java.util.Date());
+ icUserChangeRecordService.insert(changeRecordEntity);
+ }
+
+ }
+
+ /**
+ * 新增人员信息
+ * @param icVaccinePrarmeterEntity
+ * @param formDTO
+ */
+ private String insertUserInfo(IcVaccinePrarmeterEntity icVaccinePrarmeterEntity,IcVaccineCheckFormDTO formDTO){
+
+ // 新增人员
+ IcResiUserEntity userEntity = new IcResiUserEntity();
+ userEntity.setPids(icVaccinePrarmeterEntity.getPids()); // ic_resi_user表的组织的pids 含agencyId本身
+ userEntity.setAgencyId(icVaccinePrarmeterEntity.getAgencyId());
+ userEntity.setGridId(icVaccinePrarmeterEntity.getGridId());
+ userEntity.setVillageId(icVaccinePrarmeterEntity.getVillageId());
+ userEntity.setBuildId(icVaccinePrarmeterEntity.getBuildId());
+ userEntity.setUnitId(icVaccinePrarmeterEntity.getUnitId());
+ userEntity.setHomeId(icVaccinePrarmeterEntity.getHomeId());
+ userEntity.setName(icVaccinePrarmeterEntity.getName());
+ userEntity.setMobile(icVaccinePrarmeterEntity.getMobile());
+ userEntity.setIdCard(icVaccinePrarmeterEntity.getIdCard());
+ userEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ icResiUserDao.insert(userEntity);
+
+ //变更记录表
+ IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity();
+ changeRecordEntity.setCustomerId(icVaccinePrarmeterEntity.getCustomerId());
+ changeRecordEntity.setOperatorId(formDTO.getUserId());
+ changeRecordEntity.setIcUserId(userEntity.getId());
+ changeRecordEntity.setOperatorName(formDTO.getRealName());
+ changeRecordEntity.setIcUserName(userEntity.getName());
+ changeRecordEntity.setType("add");
+ changeRecordEntity.setTypeName("新增");
+ changeRecordEntity.setBeforeChangeName("-");
+ changeRecordEntity.setAfterChangeName("-");
+ changeRecordEntity.setChangeTime(new java.util.Date());
+ icUserChangeRecordService.insert(changeRecordEntity);
+
+ return userEntity.getId();
+
+ }
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
index 4cccbd7bf4..56a5f56400 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
@@ -194,16 +194,16 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl
+
+
+ select
+ *
+ from ic_vaccine
+ where DEL_FLAG = '0'
+ and ID_CARD = #{idCard}
+ and DATE_FORMAT( INOCULATE_TIME, '%Y-%m-%d' ) = #{time}
+
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml
index 363554832c..ebbebfe289 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccinePrarmeterDao.xml
@@ -39,5 +39,151 @@
+
+ select
+ ID,
+ CUSTOMER_ID,
+ GRID_ID,
+ GRID_NAME,
+ AGENCY_ID,
+ PIDS,
+ VILLAGE_ID,
+ VILLAGE_NAME,
+ BUILD_ID,
+ BUILD_NAME,
+ UNIT_ID,
+ UNIT_NAME,
+ HOME_ID,
+ HOME_NAME,
+ HOUSEHOLD_TYPE,
+ NAME,
+ MOBILE,
+ ID_CARD,
+ IS_VACCINATION,
+ FIRST_VAC_TIME,
+ FIRST_VAC_SITE,
+ SECOND_VAC_TIME,
+ SECOND_VAC_SITE,
+ THIRD_VAC_TIME,
+ THIRD_VAC_SITE,
+ REASON,
+ NOTE,
+ DEL_FLAG,
+ REVISION,
+ CREATED_BY,
+ CREATED_TIME,
+ UPDATED_BY,
+ UPDATED_TIME,
+ CHECK_STATE,
+ CHECK_REASON
+ from ic_vaccine_prarmeter
+ where DEL_FLAG = 0
+ and CUSTOMER_ID = #{customerId}
+ AND (AGENCY_ID = #{agencyId} OR PIDS LIKE CONCAT('%',#{agencyId},'%'))
+
+ and NAME like CONCAT('%' ,#{name}, '%')
+
+
+ and MOBILE like CONCAT('%', #{mobile}, '%')
+
+
+ and ID_CARD like CONCAT('%', #{idCard}, '%')
+
+
+ and IS_VACCINATION = #{isVaccination}
+
+
+ and GRID_ID = #{gridId}
+
+
+ and VILLAGE_ID = #{villageId}
+
+
+ and BUILD_ID = #{buildId}
+
+
+ and UNIT_ID = #{unitId}
+
+
+ and HOME_ID = #{homeId}
+
+ order by CREATED_TIME desc
+
-
\ No newline at end of file
+
+ select
+ ID,
+ CUSTOMER_ID,
+ GRID_ID,
+ GRID_NAME,
+ AGENCY_ID,
+ PIDS,
+ VILLAGE_ID,
+ VILLAGE_NAME,
+ BUILD_ID,
+ BUILD_NAME,
+ UNIT_ID,
+ UNIT_NAME,
+ HOME_ID,
+ HOME_NAME,
+ HOUSEHOLD_TYPE,
+ (case HOUSEHOLD_TYPE when '0' then '户籍' when '1' then '外来' else '' end) as householdTypeName,
+ NAME,
+ CONCAT(LEFT(MOBILE,3),'****',RIGHT(MOBILE ,4)) as MOBILE,
+ CONCAT(LEFT(ID_CARD,6),'********',RIGHT(ID_CARD ,4)) as ID_CARD,
+ IS_VACCINATION,
+ (case IS_VACCINATION when '0' then '否' when '1' then '是' else '' end) as isVaccinationName,
+ FIRST_VAC_TIME,
+ FIRST_VAC_SITE,
+ SECOND_VAC_TIME,
+ SECOND_VAC_SITE,
+ THIRD_VAC_TIME,
+ THIRD_VAC_SITE,
+ REASON,
+ NOTE,
+ DEL_FLAG,
+ REVISION,
+ CREATED_BY,
+ CREATED_TIME,
+ UPDATED_BY,
+ UPDATED_TIME,
+ CHECK_STATE,
+ (case CHECK_STATE when '0' then '待审核' when '1' then '审核不通过' when '2' then '审核通过' else '' end) as checkStateName,
+ CHECK_REASON
+ from ic_vaccine_prarmeter
+ where DEL_FLAG = 0
+ and CUSTOMER_ID = #{customerId}
+ AND (AGENCY_ID = #{agencyId} OR PIDS LIKE CONCAT('%',#{agencyId},'%'))
+
+ and NAME like CONCAT('%' ,#{name}, '%')
+
+
+ and MOBILE like CONCAT('%', #{mobile}, '%')
+
+
+ and ID_CARD like CONCAT('%', #{idCard}, '%')
+
+
+ and IS_VACCINATION = #{isVaccination}
+
+
+ and GRID_ID = #{gridId}
+
+
+ and VILLAGE_ID = #{villageId}
+
+
+ and BUILD_ID = #{buildId}
+
+
+ and UNIT_ID = #{unitId}
+
+
+ and HOME_ID = #{homeId}
+
+
+ order by CREATED_TIME desc
+
+
+
+
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml
index 011c1c7de1..acaf54c95f 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml
@@ -12,5 +12,10 @@
AND AGENCY_ID = #{agencyId}
+
+ update ic_vaccine_relation
+ set CUSTOMER_ID = #{customerId},USER_TYPE = #{userType}
+ where IC_VACCINE_ID = #{icVaccineId}
+
-
\ No newline at end of file
+
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
index d308058d06..8267ec45ba 100644
--- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
@@ -62,8 +62,6 @@
uri.RESI_VISIT_ID,
ubi.BUILDING_ADDRESS,
CONCAT(
- ubi.STREET,
- '-',
ubi.SURNAME,
( CASE WHEN ubi.GENDER = '1' THEN '先生' WHEN ubi.GENDER = '2' THEN '女士' ELSE '先生/女士' END )
) AS show_name,
@@ -83,8 +81,6 @@
SELECT
uri.USER_ID,
CONCAT(
- uri.STREET,
- '-',
uri.SURNAME,
( CASE WHEN uw.SEX = '1' THEN '先生' WHEN uw.SEX = '2' THEN '女士' ELSE '先生/女士' END )
) AS show_name
@@ -121,8 +117,6 @@
ubi.DISTRICT,
ubi.BUILDING_ADDRESS,
CONCAT(
- ubi.STREET,
- '-',
ubi.SURNAME,
( CASE WHEN ubi.GENDER = '1' THEN '先生' WHEN ubi.GENDER = '2' THEN '女士' ELSE '先生/女士' END )
) AS show_name,
@@ -141,8 +135,6 @@
SELECT
CONCAT(
- uri.street,
- '-',
uri.surname,
CASE
WHEN uw.sex = '1' THEN
@@ -154,8 +146,6 @@
END
) AS issueInitiator,
CONCAT(
- uri.street,
- '-',
uri.surname,
uri.NAME
) AS realUserName
@@ -171,8 +161,6 @@
SELECT
CONCAT(
- uri.street,
- '-',
uri.surname,
CASE
WHEN uri.GENDER = '1' THEN
@@ -184,8 +172,6 @@
END
) AS issueInitiator,
CONCAT(
- uri.street,
- '-',
uri.surname,
uri.NAME
) AS realUserName