diff --git a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml index d76b87c..6ad400f 100644 --- a/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml +++ b/src/main/java/org/springblade/modules/business/mapper/ApmRecordMapper.xml @@ -77,7 +77,7 @@ select DATE_FORMAT(apm_day, '%Y-%m-%d') apmDay, project, period, time_frame timeFrame, count(id) apmNum from ca_apm_record - where is_deleted = 0 + where is_deleted = 0 and apm_status = 2 and create_dept = #{createDept} diff --git a/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java b/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java index dd67870..cfc5bcf 100644 --- a/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java +++ b/src/main/java/org/springblade/modules/business/service/impl/ApmConfigServiceImpl.java @@ -89,8 +89,8 @@ public class ApmConfigServiceImpl extends ServiceImpl configList = baseMapper.selectConfigList(vo.getCreateDept(), DateUtil.format(vo.getApmDay(), DateUtil.PATTERN_DATETIME), vo.getProject()); - // 获取该天的所有预约统计 - List apmCountList = recordService.countAmpNum(createDept, DateUtil.format(vo.getApmDay(), DateUtil.PATTERN_DATETIME)); + // 获取该天的所有已预约统计 + List recordCountList = recordService.countAmpNum(createDept, DateUtil.format(vo.getApmDay(), DateUtil.PATTERN_DATETIME)); List> detailList = new ArrayList<>(); for (ApmConfig config : configList) { @@ -100,11 +100,11 @@ public class ApmConfigServiceImpl extends ServiceImpl currentApmList = recordService.list(Wrappers.lambdaQuery() .eq(ApmRecord::getCupCardNo, cupCardNo) + .eq(ApmRecord::getApmStatus, BusinessConstant.RECORD_STATUS_UNREGISTER) .eq(ApmRecord::getApmDay, apmDay)); Map cupApmMap = currentApmList.stream().collect(Collectors.toMap(ApmRecord::getProject, Function.identity())); @@ -159,19 +160,19 @@ public class ApmConfigServiceImpl extends ServiceImpl apmNum ? BusinessConstant.BOOLEAN_INT_TRUE : BusinessConstant.BOOLEAN_INT_FALSE); + totalApmNum += cupApm; + detail.put(BusinessConstant.MAP_KEY_APM_CONFIG_LIST_APM_NUM, cupApm); + detail.put(BusinessConstant.MAP_KEY_APM_CONFIG_LIST_RESIDUE_NUM, config.getNumberNum() - cupApm); + detail.put(BusinessConstant.MAP_KEY_APM_CONFIG_LIST_ENABLE_APM, !cupApmMap.containsKey(project) && config.getNumberNum() > cupApm ? BusinessConstant.BOOLEAN_INT_TRUE : BusinessConstant.BOOLEAN_INT_FALSE); detailList.add(detail); } diff --git a/src/main/java/org/springblade/modules/business/service/impl/ApmRecordServiceImpl.java b/src/main/java/org/springblade/modules/business/service/impl/ApmRecordServiceImpl.java index 0a56c79..94ef711 100644 --- a/src/main/java/org/springblade/modules/business/service/impl/ApmRecordServiceImpl.java +++ b/src/main/java/org/springblade/modules/business/service/impl/ApmRecordServiceImpl.java @@ -87,6 +87,7 @@ public class ApmRecordServiceImpl extends BaseServiceImpl currentApmList = list(Wrappers.lambdaQuery() .eq(ApmRecord::getCupCardNo, cupCardNo) + .eq(ApmRecord::getApmStatus, BusinessConstant.RECORD_STATUS_UNREGISTER) .eq(ApmRecord::getApmDay, apmDay)); // 若用户在该天有预约, 1. 判断预约医院是否相同, 2. 判断预约项目是否重复 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 00c5577..2a7317c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,7 +1,6 @@ #服务器配置 server: # 服务器host, 用于文件上传 - host: 127.0.0.1 port: 80 undertow: threads: