diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java index 7a720caa..dda4ce5e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageDto.java @@ -104,4 +104,8 @@ public class InstrumentManageDto { /** 备注 */ private String remarks; + // 手动添加 getter 方法 + public Integer getInstrumentTypeEnum() { + return instrumentTypeEnum; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java index 1aaef7a0..44ec6e33 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentManageInitDto.java @@ -18,6 +18,19 @@ public class InstrumentManageInitDto { private List InstrumentTypeList; private List InstrumentStatusEnumList; + // 手动添加 setter 方法 + public void setStatusFlagOptions(List statusFlagOptions) { + this.statusFlagOptions = statusFlagOptions; + } + + public void setInstrumentTypeList(List InstrumentTypeList) { + this.InstrumentTypeList = InstrumentTypeList; + } + + public void setInstrumentStatusEnumList(List InstrumentStatusEnumList) { + this.InstrumentStatusEnumList = InstrumentStatusEnumList; + } + /** * 状态 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java index 85190ebb..78715ce8 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/InstrumentStatusRequest.java @@ -13,4 +13,13 @@ import java.util.List; public class InstrumentStatusRequest { private List ids; private String type; + + // 手动添加 getter 方法 + public String getType() { + return type; + } + + public List getIds() { + return ids; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java index be03ef97..98c9fafc 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageDto.java @@ -28,4 +28,36 @@ public class LisConfigManageDto { private List activityDefSpecimenDefs; + // 手动添加 getter 和 setter 方法 + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public List getActivityDefDeviceDefs() { + return activityDefDeviceDefs; + } + + public void setActivityDefDeviceDefs(List activityDefDeviceDefs) { + this.activityDefDeviceDefs = activityDefDeviceDefs; + } + + public List getActivityDefObservationDefs() { + return activityDefObservationDefs; + } + + public void setActivityDefObservationDefs(List activityDefObservationDefs) { + this.activityDefObservationDefs = activityDefObservationDefs; + } + + public List getActivityDefSpecimenDefs() { + return activityDefSpecimenDefs; + } + + public void setActivityDefSpecimenDefs(List activityDefSpecimenDefs) { + this.activityDefSpecimenDefs = activityDefSpecimenDefs; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java index d597daa1..d37c0f98 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/LisConfigManageInitDto.java @@ -23,4 +23,16 @@ public class LisConfigManageInitDto { private List specimenDefs; + // 手动添加 setter 方法 + public void setDeviceDefs(List deviceDefs) { + this.deviceDefs = deviceDefs; + } + + public void setObservationDefs(List observationDefs) { + this.observationDefs = observationDefs; + } + + public void setSpecimenDefs(List specimenDefs) { + this.specimenDefs = specimenDefs; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java index 5e41183b..27500493 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageDto.java @@ -44,7 +44,16 @@ public class ObservationDefManageDto { /** 删除状态) */ private String deleteFlag; + // 手动添加 getter 方法 + public Long getInstrumentId() { + return instrumentId; + } + public Integer getStatusEnum() { + return statusEnum; + } - + public Integer getObservationTypeEnum() { + return observationTypeEnum; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java index 7715c1d3..dd38a56e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefManageInitDto.java @@ -18,6 +18,19 @@ public class ObservationDefManageInitDto { private List ObservationTypeList; private List instrumentEnumOptionList; + // 手动添加 setter 方法 + public void setStatusFlagOptions(List statusFlagOptions) { + this.statusFlagOptions = statusFlagOptions; + } + + public void setObservationTypeList(List ObservationTypeList) { + this.ObservationTypeList = ObservationTypeList; + } + + public void setInstrumentEnumOptionList(List instrumentEnumOptionList) { + this.instrumentEnumOptionList = instrumentEnumOptionList; + } + /** * 状态 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java index d72af4a8..e3b0a487 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ObservationDefStatusRequest.java @@ -13,4 +13,13 @@ import java.util.List; public class ObservationDefStatusRequest { private List ids; private String type; + + // 手动添加 getter 方法 + public String getType() { + return type; + } + + public List getIds() { + return ids; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java index 02378857..cf0813f6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/ReportResultManageDto.java @@ -32,4 +32,8 @@ public class ReportResultManageDto { private String authoredTime; // 开单时间 + // 手动添加 getter 方法 + public Integer getGenderEnum() { + return genderEnum; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java index f189c075..45921310 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectManageDto.java @@ -40,4 +40,12 @@ public class SampleCollectManageDto { private String authoredTime; // 开单时间 + // 手动添加 getter 方法 + public Integer getGenderEnum() { + return genderEnum; + } + + public Integer getCollectionStatusEnum() { + return collectionStatusEnum; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java index f15d8cc5..f57813de 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SampleCollectStatusRequest.java @@ -13,4 +13,13 @@ import java.util.List; public class SampleCollectStatusRequest { private List ids; private String type; + + // 手动添加 getter 方法 + public String getType() { + return type; + } + + public List getIds() { + return ids; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java index 3f225baf..055d5d0c 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageDto.java @@ -59,4 +59,12 @@ public class SpecimenDefManageDto { private Integer statusEnum; private String statusEnumText; + // 手动添加 getter 方法 + public Integer getSpecimenTypeEnum() { + return specimenTypeEnum; + } + + public Integer getStatusEnum() { + return statusEnum; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java index e8f4fa3d..446ecdb5 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefManageInitDto.java @@ -18,6 +18,15 @@ public class SpecimenDefManageInitDto { private List statusFlagOptions; private List SpecimenTypeList; + // 手动添加 setter 方法 + public void setStatusFlagOptions(List statusFlagOptions) { + this.statusFlagOptions = statusFlagOptions; + } + + public void setSpecimenTypeList(List SpecimenTypeList) { + this.SpecimenTypeList = SpecimenTypeList; + } + /** * 状态 */ diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java index 909e4abd..f136a89e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/Inspection/dto/SpecimenDefStatusRequest.java @@ -13,4 +13,13 @@ import java.util.List; public class SpecimenDefStatusRequest { private List ids; private String type; + + // 手动添加 getter 方法 + public String getType() { + return type; + } + + public List getIds() { + return ids; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/AdjustPriceDataVo.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/AdjustPriceDataVo.java index 2c632ec0..67286cd4 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/AdjustPriceDataVo.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/adjustprice/dto/AdjustPriceDataVo.java @@ -69,4 +69,13 @@ public class AdjustPriceDataVo { private Long locationId; private BigDecimal finalTotalQuantity; + + // 手动添加 getter 方法 + public Long getItemId() { + return itemId; + } + + public Integer getCategoryType() { + return categoryType; + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/ICardManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/ICardManageAppService.java index 36b27d09..7232c1b8 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/ICardManageAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/ICardManageAppService.java @@ -93,4 +93,75 @@ public interface ICardManageAppService { * @return 科室树数据 */ R getDeptTree(); + + /** + * 获取医生个人报卡统计数据 + * + * @return 统计数据 + */ + DoctorCardStatisticsDto getDoctorCardStatistics(); + + /** + * 分页查询医生个人报卡列表 + * + * @param queryParams 查询参数 + * @return 分页数据 + */ + R getDoctorCardPage(DoctorCardQueryDto queryParams); + + /** + * 提交报卡 + * + * @param cardNo 卡片编号 + * @return 结果 + */ + R submitCard(String cardNo); + + /** + * 撤回报卡 + * + * @param cardNo 卡片编号 + * @return 结果 + */ + R withdrawCard(String cardNo); + + /** + * 删除报卡(状态变为作废) + * + * @param cardNo 卡片编号 + * @return 结果 + */ + R deleteCard(String cardNo); + + /** + * 批量提交报卡 + * + * @param cardNos 卡片编号列表 + * @return 结果 + */ + R batchSubmitCards(List cardNos); + + /** + * 批量删除报卡 + * + * @param cardNos 卡片编号列表 + * @return 结果 + */ + R batchDeleteCards(List cardNos); + + /** + * 导出报卡为Word文档 + * + * @param cardNo 卡片编号 + * @param response 响应 + */ + void exportCardToWord(String cardNo, HttpServletResponse response); + + /** + * 更新医生报卡 + * + * @param updateDto 更新参数 + * @return 结果 + */ + R updateDoctorCard(DoctorCardUpdateDto updateDto); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java index d0b565b8..6c22aef9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java @@ -308,15 +308,340 @@ public class CardManageAppServiceImpl implements ICardManageAppService { return R.ok(new ArrayList<>()); } - /** - * 转换为DTO - */ - private InfectiousCardDto convertToDto(InfectiousCard card) { - InfectiousCardDto dto = new InfectiousCardDto(); - BeanUtils.copyProperties(card, dto); + @Override + public DoctorCardStatisticsDto getDoctorCardStatistics() { + Long doctorId = SecurityUtils.getUserId(); + + DoctorCardStatisticsDto dto = new DoctorCardStatisticsDto(); + dto.setTotalCount(infectiousCardMapper.countByDoctorId(doctorId)); + dto.setPendingFailedCount(infectiousCardMapper.countPendingFailedByDoctorId(doctorId)); + dto.setReportedCount(infectiousCardMapper.countReportedByDoctorId(doctorId)); return dto; } + @Override + public R getDoctorCardPage(DoctorCardQueryDto queryParams) { + Long doctorId = SecurityUtils.getUserId(); + + Page page = new Page<>(queryParams.getPageNo(), queryParams.getPageSize()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + + // 只查询当前医生的报卡 + wrapper.eq(InfectiousCard::getDoctorId, doctorId); + + // 状态筛选 + if (StringUtils.hasText(queryParams.getStatus())) { + wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus()); + } + + // 时间范围筛选 + if (StringUtils.hasText(queryParams.getStartDate())) { + LocalDateTime startDateTime = LocalDateTime.parse(queryParams.getStartDate() + "T00:00:00"); + wrapper.ge(InfectiousCard::getCreateTime, startDateTime); + } + if (StringUtils.hasText(queryParams.getEndDate())) { + LocalDateTime endDateTime = LocalDateTime.parse(queryParams.getEndDate() + "T23:59:59"); + wrapper.le(InfectiousCard::getCreateTime, endDateTime); + } + + // 关键词搜索(患者姓名或报卡名称) + if (StringUtils.hasText(queryParams.getKeyword())) { + wrapper.and(w -> w + .like(InfectiousCard::getPatName, queryParams.getKeyword()) + .or() + .like(InfectiousCard::getDiseaseName, queryParams.getKeyword()) + ); + } + + // 按创建时间倒序 + wrapper.orderByDesc(InfectiousCard::getCreateTime); + + IPage result = infectiousCardMapper.selectPage(page, wrapper); + + // 转换为DTO + List list = result.getRecords().stream() + .map(this::convertToDoctorCardListDto) + .collect(Collectors.toList()); + + Map resultMap = new HashMap<>(); + resultMap.put("list", list); + resultMap.put("total", result.getTotal()); + return R.ok(resultMap); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R submitCard(String cardNo) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) { + return R.fail("报卡不存在"); + } + + // 验证权限:只能提交自己的报卡 + if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + return R.fail("无权操作此报卡"); + } + + // 验证状态:只有暂存状态可以提交 + if (!"0".equals(card.getStatus())) { + return R.fail("只能提交暂存状态的报卡"); + } + + // 更新状态为已提交 + card.setStatus("1"); + card.setUpdateTime(new Date()); + infectiousCardMapper.updateById(card); + + return R.ok("提交成功"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R withdrawCard(String cardNo) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) { + return R.fail("报卡不存在"); + } + + // 验证权限:只能撤回自己的报卡 + if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + return R.fail("无权操作此报卡"); + } + + // 验证状态:只有已提交状态可以撤回 + if (!"1".equals(card.getStatus())) { + return R.fail("只能撤回已提交状态的报卡"); + } + + // 更新状态为暂存 + card.setStatus("0"); + card.setUpdateTime(new Date()); + infectiousCardMapper.updateById(card); + + return R.ok("撤回成功"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R deleteCard(String cardNo) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) { + return R.fail("报卡不存在"); + } + + // 验证权限:只能删除自己的报卡 + if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + return R.fail("无权操作此报卡"); + } + + // 验证状态:只有暂存状态可以删除 + if (!"0".equals(card.getStatus())) { + return R.fail("只能删除暂存状态的报卡"); + } + + // 更新状态为作废 + card.setStatus("6"); + card.setUpdateTime(new Date()); + infectiousCardMapper.updateById(card); + + return R.ok("删除成功"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R batchSubmitCards(List cardNos) { + if (cardNos == null || cardNos.isEmpty()) { + return R.fail("请选择要提交的报卡"); + } + + Long doctorId = SecurityUtils.getUserId(); + int successCount = 0; + + for (String cardNo : cardNos) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) continue; + + // 验证权限:只能提交自己的报卡 + if (!card.getDoctorId().equals(doctorId)) continue; + + // 验证状态:只有暂存状态可以提交 + if (!"0".equals(card.getStatus())) continue; + + // 更新状态为已提交 + card.setStatus("1"); + card.setUpdateTime(new Date()); + infectiousCardMapper.updateById(card); + successCount++; + } + + if (successCount == 0) { + return R.fail("没有可提交的报卡,只能提交暂存状态的报卡"); + } + + return R.ok("批量提交成功,共提交" + successCount + "条"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R batchDeleteCards(List cardNos) { + if (cardNos == null || cardNos.isEmpty()) { + return R.fail("请选择要删除的报卡"); + } + + Long doctorId = SecurityUtils.getUserId(); + int successCount = 0; + + for (String cardNo : cardNos) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) continue; + + // 验证权限:只能删除自己的报卡 + if (!card.getDoctorId().equals(doctorId)) continue; + + // 验证状态:只有暂存状态可以删除 + if (!"0".equals(card.getStatus())) continue; + + // 更新状态为作废 + card.setStatus("6"); + card.setUpdateTime(new Date()); + infectiousCardMapper.updateById(card); + successCount++; + } + + if (successCount == 0) { + return R.fail("没有可删除的报卡,只能删除暂存状态的报卡"); + } + + return R.ok("批量删除成功,共删除" + successCount + "条"); + } + + @Override + public R updateDoctorCard(DoctorCardUpdateDto updateDto) { + // 获取当前登录用户信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long currentUserId = loginUser.getUserId(); + + // 查询报卡 + InfectiousCard card = infectiousCardMapper.selectByCardNo(updateDto.getCardNo()); + if (card == null) { + return R.fail("报卡不存在"); + } + + // 验证是否当前医生的报卡 - 根据doctorId字段验证 + if (!currentUserId.equals(card.getDoctorId())) { + return R.fail("只能修改自己的报卡"); + } + + // 验证状态是否允许修改(只能修改暂存状态的报卡) + if (!"0".equals(card.getStatus())) { + return R.fail("只能修改暂存状态的报卡"); + } + + // 更新字段 + card.setPhone(updateDto.getPhone()); + card.setOnsetDate(updateDto.getOnsetDate()); + card.setDiagDate(updateDto.getDiagDate()); + card.setDiseaseType(updateDto.getDiseaseType()); // 使用diseaseType字段 + card.setAddressProv(updateDto.getAddressProv()); + card.setAddressCity(updateDto.getAddressCity()); + card.setAddressCounty(updateDto.getAddressCounty()); + card.setAddressHouse(updateDto.getAddressHouse()); + card.setUpdateTime(LocalDateTime.now()); + card.setUpdateBy(loginUser.getUsername()); // 使用username作为更新者 + + int rows = infectiousCardMapper.updateById(card); + if (rows > 0) { + return R.ok("更新成功"); + } + return R.fail("更新失败"); + } + + // 验证是否当前医生的报卡 + // 使用createBy字段验证(通常是创建人),如果使用了其他字段则需调整 + if (!currentUserId.equals(card.getCreateBy())) { + return R.fail("只能修改自己的报卡"); + } + + // 验证状态是否允许修改(只能修改暂存状态的报卡) + if (!"0".equals(card.getStatus())) { + return R.fail("只能修改暂存状态的报卡"); + } + + // 更新字段 + card.setPhone(updateDto.getPhone()); + card.setOnsetDate(updateDto.getOnsetDate()); + card.setDiagDate(updateDto.getDiagDate()); + card.setAddressProv(updateDto.getAddressProv()); + card.setAddressCity(updateDto.getAddressCity()); + card.setAddressCounty(updateDto.getAddressCounty()); + card.setAddressHouse(updateDto.getAddressHouse()); + card.setUpdateTime(LocalDateTime.now()); + card.setUpdateBy(currentUserId); + + int rows = infectiousCardMapper.updateById(card); + if (rows > 0) { + return R.ok("更新成功"); + } + return R.fail("更新失败"); + } + + @Override + public void exportCardToWord(String cardNo, HttpServletResponse response) { + InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); + if (card == null) { + return; + } + + // 验证权限:只能导出自己的报卡 + if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + return; + } + + // 验证状态:只有已上报状态可以导出 + if (!"3".equals(card.getStatus())) { + return; + } + + try { + // TODO: 实现Word导出逻辑,使用Apache POI或其他库 + // 这里简化为返回文本内容 + response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + response.setHeader("Content-Disposition", "attachment;filename=" + + URLEncoder.encode("传染病报告卡-" + cardNo + ".docx", StandardCharsets.UTF_8)); + + // 实际应生成Word文档内容 + response.getWriter().write("报卡编号:" + cardNo); + } catch (IOException e) { + log.error("导出报卡失败", e); + } + } + + /** + * 转换为医生报卡列表DTO + */ + private DoctorCardListDto convertToDoctorCardListDto(InfectiousCard card) { + DoctorCardListDto dto = new DoctorCardListDto(); + BeanUtils.copyProperties(card, dto); + dto.setCardName(getCardName(card.getCardNameCode())); + dto.setSubmitTime(card.getCreateTime() != null ? + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(card.getCreateTime()) : null); + return dto; + } + + /** + * 获取报卡名称 + */ + private String getCardName(Integer cardNameCode) { + if (cardNameCode == null) return "中华人民共和国传染病报告卡"; + switch (cardNameCode) { + case 1: return "中华人民共和国传染病报告卡"; + case 2: return "甲类传染病报告卡"; + case 3: return "乙类传染病报告卡"; + case 4: return "丙类传染病报告卡"; + default: return "中华人民共和国传染病报告卡"; + } + } + /** * 转换审核记录为DTO */ @@ -327,6 +652,16 @@ public class CardManageAppServiceImpl implements ICardManageAppService { return dto; } + /** + * 转换为报卡DTO + */ + private InfectiousCardDto convertToDto(InfectiousCard card) { + InfectiousCardDto dto = new InfectiousCardDto(); + BeanUtils.copyProperties(card, dto); + dto.setStatusText(getStatusText(card.getStatus())); + return dto; + } + /** * 创建审核记录 */ @@ -355,11 +690,12 @@ public class CardManageAppServiceImpl implements ICardManageAppService { private String getStatusText(String status) { switch (status) { case "0": return "暂存"; - case "1": return "待审核"; + case "1": return "已提交"; case "2": return "审核通过"; case "3": return "已上报"; case "4": return "失败"; case "5": return "审核失败"; + case "6": return "作废"; default: return "未知"; } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/controller/CardManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/controller/CardManageController.java index 01c95cf3..06314365 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/controller/CardManageController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/controller/CardManageController.java @@ -134,4 +134,104 @@ public class CardManageController { public R getDeptTree() { return cardManageAppService.getDeptTree(); } + + // ==================== 医生个人报卡管理 ==================== + + /** + * 获取医生个人报卡统计数据 + * + * @return 统计数据 + */ + @GetMapping("/doctor/statistics") + public R getDoctorCardStatistics() { + return R.ok(cardManageAppService.getDoctorCardStatistics()); + } + + /** + * 分页查询医生个人报卡列表 + * + * @param queryParams 查询参数 + * @return 分页数据 + */ + @GetMapping("/doctor/page") + public R getDoctorCardPage(DoctorCardQueryDto queryParams) { + return cardManageAppService.getDoctorCardPage(queryParams); + } + + /** + * 提交报卡 + * + * @param cardNo 卡片编号 + * @return 结果 + */ + @PostMapping("/doctor/submit/{cardNo}") + public R submitCard(@PathVariable String cardNo) { + return cardManageAppService.submitCard(cardNo); + } + + /** + * 撤回报卡 + * + * @param cardNo 卡片编号 + * @return 结果 + */ + @PostMapping("/doctor/withdraw/{cardNo}") + public R withdrawCard(@PathVariable String cardNo) { + return cardManageAppService.withdrawCard(cardNo); + } + + /** + * 删除报卡(状态变为作废) + * + * @param cardNo 卡片编号 + * @return 结果 + */ + @DeleteMapping("/doctor/{cardNo}") + public R deleteCard(@PathVariable String cardNo) { + return cardManageAppService.deleteCard(cardNo); + } + + /** + * 批量提交报卡 + * + * @param cardNos 卡片编号列表 + * @return 结果 + */ + @PostMapping("/doctor/batch-submit") + public R batchSubmitCards(@RequestBody List cardNos) { + return cardManageAppService.batchSubmitCards(cardNos); + } + + /** + * 批量删除报卡 + * + * @param cardNos 卡片编号列表 + * @return 结果 + */ + @PostMapping("/doctor/batch-delete") + public R batchDeleteCards(@RequestBody List cardNos) { + return cardManageAppService.batchDeleteCards(cardNos); + } + + /** + * 更新医生报卡 + * + * @param updateDto 更新参数 + * @return 结果 + */ + @PostMapping("/doctor/update") + public R updateDoctorCard(@RequestBody DoctorCardUpdateDto updateDto) { + return cardManageAppService.updateDoctorCard(updateDto); + } + + /** + * 导出报卡为Word文档 + * + * @param cardNo 卡片编号 + * @param response 响应 + */ + @GetMapping("/doctor/export-word/{cardNo}") + public void exportCardToWord(@PathVariable String cardNo, HttpServletResponse response) { + cardManageAppService.exportCardToWord(cardNo, response); + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java new file mode 100644 index 00000000..0677f4d8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java @@ -0,0 +1,46 @@ +/* + * Copyright ©2026 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.cardmanagement.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; + +/** + * 医生个人报卡列表DTO + * + * @author system + * @date 2026-03-08 + */ +@Data +public class DoctorCardListDto { + + /** 卡片ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** 卡片编号 */ + private String cardNo; + + /** 患者姓名 */ + private String patName; + + /** 身份证号 */ + private String idNo; + + /** 联系电话 */ + private String phone; + + /** 就诊卡号(暂时不展示,字段保留) */ + private String visitCardNo; + + /** 报卡名称 */ + private String cardName; + + /** 提交时间 */ + private String submitTime; + + /** 状态 */ + private String status; +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java new file mode 100644 index 00000000..c2915ebd --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java @@ -0,0 +1,34 @@ +/* + * Copyright ©2026 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.cardmanagement.dto; + +import lombok.Data; + +/** + * 医生个人报卡查询参数 + * + * @author system + * @date 2026-03-08 + */ +@Data +public class DoctorCardQueryDto { + + /** 页码 */ + private Integer pageNo = 1; + + /** 每页数量 */ + private Integer pageSize = 10; + + /** 开始日期 */ + private String startDate; + + /** 结束日期 */ + private String endDate; + + /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回) */ + private String status; + + /** 患者姓名或报卡名称 */ + private String keyword; +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardStatisticsDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardStatisticsDto.java new file mode 100644 index 00000000..e7e357dc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardStatisticsDto.java @@ -0,0 +1,25 @@ +/* + * Copyright ©2026 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.cardmanagement.dto; + +import lombok.Data; + +/** + * 医生个人报卡统计数据 + * + * @author system + * @date 2026-03-08 + */ +@Data +public class DoctorCardStatisticsDto { + + /** 总报卡数 */ + private Integer totalCount; + + /** 待处理失败数 */ + private Integer pendingFailedCount; + + /** 已成功上报数 */ + private Integer reportedCount; +} \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java index 490e9220..5e7ce7ac 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java @@ -113,6 +113,9 @@ public class InfectiousCardDto { /** 状态 */ private String status; + /** 状态文本 */ + private String statusText; + /** 报卡名称代码 */ private Integer cardNameCode; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java index 4ce47653..4d67cc8b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java @@ -47,4 +47,22 @@ public interface InfectiousCardMapper extends BaseMapper { */ @Select("SELECT * FROM infectious_card WHERE card_no = #{cardNo}") InfectiousCard selectByCardNo(@Param("cardNo") String cardNo); + + /** + * 统计医生个人总报卡数 + */ + @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId}") + Integer countByDoctorId(@Param("doctorId") Long doctorId); + + /** + * 统计医生待处理失败数(状态为0暂存或4失败) + */ + @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status IN ('0', '4')") + Integer countPendingFailedByDoctorId(@Param("doctorId") Long doctorId); + + /** + * 统计医生已成功上报数(状态为3已上报) + */ + @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status = '3'") + Integer countReportedByDoctorId(@Param("doctorId") Long doctorId); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ProductDetailPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ProductDetailPageDto.java index 8de503fd..7b4801f0 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ProductDetailPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/dto/ProductDetailPageDto.java @@ -288,4 +288,286 @@ public class ProductDetailPageDto { this.salePriceStatistics = BigDecimal.ZERO; this.purchasePriceStatistics = BigDecimal.ZERO; } + + // 手动添加 getter 和 setter 方法(Lombok 注解处理器未正常工作) + + public Integer getInventoryStatusEnum() { + return inventoryStatusEnum; + } + + public void setInventoryStatusEnum(Integer inventoryStatusEnum) { + this.inventoryStatusEnum = inventoryStatusEnum; + } + + public Long getInventoryId() { + return inventoryId; + } + + public void setInventoryId(Long inventoryId) { + this.inventoryId = inventoryId; + } + + public Integer getChrgitmLv() { + return chrgitmLv; + } + + public void setChrgitmLv(Integer chrgitmLv) { + this.chrgitmLv = chrgitmLv; + } + + public String getDevCategoryCode() { + return devCategoryCode; + } + + public void setDevCategoryCode(String devCategoryCode) { + this.devCategoryCode = devCategoryCode; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getBusNo() { + return busNo; + } + + public void setBusNo(String busNo) { + this.busNo = busNo; + } + + public String getMedCategoryCode() { + return medCategoryCode; + } + + public void setMedCategoryCode(String medCategoryCode) { + this.medCategoryCode = medCategoryCode; + } + + public String getItemTable() { + return itemTable; + } + + public void setItemTable(String itemTable) { + this.itemTable = itemTable; + } + + public Long getLocationId() { + return locationId; + } + + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public Long getLocationStoreId() { + return locationStoreId; + } + + public void setLocationStoreId(Long locationStoreId) { + this.locationStoreId = locationStoreId; + } + + public String getLocationStoreName() { + return locationStoreName; + } + + public void setLocationStoreName(String locationStoreName) { + this.locationStoreName = locationStoreName; + } + + public String getManufacturerText() { + return manufacturerText; + } + + public void setManufacturerText(String manufacturerText) { + this.manufacturerText = manufacturerText; + } + + public String getMinUnitCode() { + return minUnitCode; + } + + public void setMinUnitCode(String minUnitCode) { + this.minUnitCode = minUnitCode; + } + + public BigDecimal getPartPercent() { + return partPercent; + } + + public void setPartPercent(BigDecimal partPercent) { + this.partPercent = partPercent; + } + + public BigDecimal getPurchasePrice() { + return purchasePrice; + } + + public void setPurchasePrice(BigDecimal purchasePrice) { + this.purchasePrice = purchasePrice; + } + + public Date getProductionDate() { + return productionDate; + } + + public void setProductionDate(Date productionDate) { + this.productionDate = productionDate; + } + + public Date getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + public BigDecimal getQuantity() { + return quantity; + } + + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + public BigDecimal getSalePrice() { + return salePrice; + } + + public void setSalePrice(BigDecimal salePrice) { + this.salePrice = salePrice; + } + + public BigDecimal getTotalPurchasePrice() { + return totalPurchasePrice; + } + + public void setTotalPurchasePrice(BigDecimal totalPurchasePrice) { + this.totalPurchasePrice = totalPurchasePrice; + } + + public BigDecimal getTotalSalePrice() { + return totalSalePrice; + } + + public void setTotalSalePrice(BigDecimal totalSalePrice) { + this.totalSalePrice = totalSalePrice; + } + + public String getTotalVolume() { + return totalVolume; + } + + public void setTotalVolume(String totalVolume) { + this.totalVolume = totalVolume; + } + + public String getUnitCode() { + return unitCode; + } + + public void setUnitCode(String unitCode) { + this.unitCode = unitCode; + } + + public String getWbStr() { + return wbStr; + } + + public void setWbStr(String wbStr) { + this.wbStr = wbStr; + } + + public String getPyStr() { + return pyStr; + } + + public void setPyStr(String pyStr) { + this.pyStr = pyStr; + } + + public Long getSupplierId() { + return supplierId; + } + + public void setSupplierId(Long supplierId) { + this.supplierId = supplierId; + } + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public Integer getRemainingDays() { + return remainingDays; + } + + public void setRemainingDays(Integer remainingDays) { + this.remainingDays = remainingDays; + } + + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public BigDecimal getRemainder() { + return remainder; + } + + public void setRemainder(BigDecimal remainder) { + this.remainder = remainder; + } + + public String getYbNo() { + return ybNo; + } + + public void setYbNo(String ybNo) { + this.ybNo = ybNo; + } + + public String getApprovalNumber() { + return approvalNumber; + } + + public void setApprovalNumber(String approvalNumber) { + this.approvalNumber = approvalNumber; + } + + public String getLotNumber() { + return lotNumber; + } + + public void setLotNumber(String lotNumber) { + this.lotNumber = lotNumber; + } }