From 65b9d844499e67dd67e7cf13a558e9dff8d66956 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 6 Apr 2022 16:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IcVaccineController.java | 11 - .../com/epmet/service/IcVaccineService.java | 43 +--- .../service/impl/IcVaccineServiceImpl.java | 202 ++---------------- 3 files changed, 18 insertions(+), 238 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java index c567480fc6..1b097570cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccineController.java @@ -75,17 +75,6 @@ public class IcVaccineController implements ResultDataResolver { return new Result>().ok(icVaccineService.icVaccineList(formDTO)); } - /** - * @Author sun - * @Description 【核酸】核酸检测信息详情 - **/ - @NoRepeatSubmit - @PostMapping("detail") - public Result detail(@RequestBody VaccineListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, VaccineListFormDTO.Detail.class); - return new Result().ok(icVaccineService.detail(formDTO)); - } - /** * @Author sun * @Description 【核酸】核酸检测信息同步 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java index 7cef54b951..5d9341c9eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccineService.java @@ -22,12 +22,6 @@ import java.util.List; */ public interface IcVaccineService extends BaseService { - /** - * @Author sun - * @Description 核酸检测-上报核酸记录 - **/ - void add(AddIcNatFormDTO formDTO); - /** * @Author sun * @Description 核酸检测-居民端我的上报 @@ -42,30 +36,11 @@ public interface IcVaccineService extends BaseService { * @return*/ PageData icVaccineList(VaccineListFormDTO formDTO); - /** - * @Author sun - * @Description 【核酸】核酸检测信息详情 - * - * @param formDTO*/ - IcNatDTO detail(VaccineListFormDTO formDTO); - - /** - * @Author sun - * @Description 【核酸】核酸检测信息修改 - **/ - void edit(AddIcNatFormDTO formDTO); - - /** - * @Author sun - * @Description 【核酸】核酸检测信息删除/取消同步 - **/ - void del(MyNatListFormDTO formDTO); - /** * @Author sun * @Description 【核酸】核酸检测信息同步 **/ - void synchro(MyNatListFormDTO formDTO); + void synchro(VaccineListFormDTO formDTO); /** * @Author sun @@ -79,20 +54,4 @@ public interface IcVaccineService extends BaseService { */ void execAsyncExcelImport(Path filePath, String importTaskId); - /** - * 核酸检测信息 - * @Param idCard - * @Return {@link List} - * @Author zhaoqifeng - * @Date 2022/3/29 16:29 - */ - List getNatList(String customerId, String idCard); - - /** - * desc:根据用户id 更新核酸中是否居民状态 - * @param customerId - * @param icResiUserId 如果为空则更新全部 - * @return - */ - Integer updateIsResiFlag(String customerId, String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java index e3456cb1b8..11a0183606 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccineServiceImpl.java @@ -88,55 +88,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - SendNoticeFormDTO dto = new SendNoticeFormDTO(); - List userList = new ArrayList<>(); - userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); - dto.setCustomerId(formDTO.getCustomerId()); - dto.setUserList(userList); - dto.setChannel(formDTO.getChannel()); - dto.setOrigin("2"); - dto.setContent(formDTO.getContent()); - dto.setStaffId(formDTO.getStaffId()); - icNoticeService.sendNotice(dto); - } - - } - - /** - * @Author sun - * @Description 核酸检测-居民端我的上报 + * @Description 疫苗接种-居民端我的上报 **/ @Override public List myNatList(MyNatListFormDTO formDTO) { @@ -152,7 +104,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl%s", formDTO.getIcNatId())); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "核酸记录修改失败"); - } - //修改只涉及到基础信息的修改 不会修改关系数据 关系表不涉及更新 - - //3.新增通知表信息 - if (CollectionUtils.isNotEmpty(formDTO.getChannel())) { - SendNoticeFormDTO dto = new SendNoticeFormDTO(); - List userList = new ArrayList<>(); - userList.add(ConvertUtils.sourceToTarget(formDTO, SendNoticeFormDTO.UserListBean.class)); - dto.setCustomerId(formDTO.getCustomerId()); - dto.setUserList(userList); - dto.setChannel(formDTO.getChannel()); - dto.setOrigin("2"); - dto.setContent(formDTO.getContent()); - dto.setStaffId(formDTO.getStaffId()); - icNoticeService.sendNotice(dto); - } - } - - /** - * @Author sun - * @Description 【核酸】核酸检测信息删除/取消同步 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public void del(MyNatListFormDTO formDTO) { - //1.确定删除则需要删除基础数据以及所有可能存在的关系数据,物理删除业务数据 - if (baseDao.delById(formDTO.getIcNatId()) < NumConstant.ONE) { - log.error(String.format("数据删除失败,核酸记录Id->%s", formDTO.getIcNatId())); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据删除失败"); - } - //关系数据删除 - icNatRelationDao.delRelation(formDTO.getIcNatId(), null); - } - - /** - * @Author sun - * @Description 【核酸】核酸检测信息同步 + * @Author zxc + * @Description 【疫苗】疫苗接种信息同步 **/ @Override @Transactional(rollbackFor = Exception.class) - public void synchro(MyNatListFormDTO formDTO) { - //1.检验核酸基础信息是否存在 - IcVaccineEntity entity = baseDao.selectById(formDTO.getIcNatId()); + public void synchro(VaccineListFormDTO formDTO) { + //1.检验疫苗基础信息是否存在 + IcVaccineEntity entity = baseDao.selectById(formDTO.getIcVaccineId()); if (null == entity) { - log.error(String.format("核酸记录数据不存在同步失败,核酸记录Id->%s", formDTO.getIcNatId())); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,核酸记录数据不存在"); + log.error(String.format("疫苗记录数据不存在同步失败,疫苗记录Id->%s", formDTO.getIcVaccineId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "数据同步失败,疫苗记录数据不存在"); } //获取工作人员缓存数据 CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); @@ -277,7 +152,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl%s", formDTO.getIcNatId())); + log.error(String.format("数据取消同步失败,疫苗记录Id->%s", formDTO.getIcNatId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消同步操作失败"); } } @@ -370,11 +245,11 @@ public class IcVaccineServiceImpl extends BaseServiceImpl} - * @Author zhaoqifeng - * @Date 2022/3/29 16:29 - */ - @Override - public List getNatList(String customerId, String idCard) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcVaccineEntity::getCustomerId, customerId); - wrapper.eq(IcVaccineEntity::getIdCard, idCard); - wrapper.orderByDesc(IcVaccineEntity::getNatTime); - List list = baseDao.selectList(wrapper); - if (CollectionUtils.isEmpty(list)) { - return Collections.emptyList(); - } - return list.stream().map(item -> { - NatListDTO dto = new NatListDTO(); - dto.setAddress(item.getNatAddress()); - dto.setTestTime(DateUtils.format(item.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); - switch (item.getNatResult()) - { - case NumConstant.ZERO_STR: - dto.setResult("阴性"); - break; - case NumConstant.ONE_STR: - dto.setResult("阳性"); - break; - default: - dto.setResult("未知"); - } - return dto; - }).collect(Collectors.toList()); - } - - @Override - public Integer updateIsResiFlag(String customerId, String icResiUserId) { - return baseDao.updateIsResiFlag(customerId,icResiUserId); - } - /** * 批量持久化 * @param entities @@ -491,7 +323,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl 0) { String fieldsStr = String.join(",", changedFieldNames); - String message = "该次核酸检测记录已存在,执行更新动作," + fieldsStr + "已成功更新"; + String message = "该次疫苗接种记录已存在,执行更新动作," + fieldsStr + "已成功更新"; IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); errorRow.setName(name); errorRow.setMobile(mobile);