|
|
|
@ -14,9 +14,12 @@ import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.modules.business.dto.ApmRecordCountDTO; |
|
|
|
import org.springblade.modules.business.dto.ApmRecordCountDTO; |
|
|
|
|
|
|
|
import org.springblade.modules.business.entity.ApmConfig; |
|
|
|
import org.springblade.modules.business.entity.ApmRecord; |
|
|
|
import org.springblade.modules.business.entity.ApmRecord; |
|
|
|
import org.springblade.modules.business.entity.Blacklist; |
|
|
|
import org.springblade.modules.business.entity.Blacklist; |
|
|
|
|
|
|
|
import org.springblade.modules.business.mapper.ApmConfigMapper; |
|
|
|
import org.springblade.modules.business.mapper.ApmRecordMapper; |
|
|
|
import org.springblade.modules.business.mapper.ApmRecordMapper; |
|
|
|
|
|
|
|
import org.springblade.modules.business.service.IApmConfigService; |
|
|
|
import org.springblade.modules.business.service.IApmRecordService; |
|
|
|
import org.springblade.modules.business.service.IApmRecordService; |
|
|
|
import org.springblade.modules.business.service.IBlacklistService; |
|
|
|
import org.springblade.modules.business.service.IBlacklistService; |
|
|
|
import org.springblade.modules.business.vo.ApmRecordDetailVO; |
|
|
|
import org.springblade.modules.business.vo.ApmRecordDetailVO; |
|
|
|
@ -37,6 +40,7 @@ import java.util.*; |
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class ApmRecordServiceImpl extends BaseServiceImpl<ApmRecordMapper, ApmRecord> implements IApmRecordService { |
|
|
|
public class ApmRecordServiceImpl extends BaseServiceImpl<ApmRecordMapper, ApmRecord> implements IApmRecordService { |
|
|
|
private final IBlacklistService blacklistService; |
|
|
|
private final IBlacklistService blacklistService; |
|
|
|
|
|
|
|
private final ApmConfigMapper configMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<ApmRecordListVO> selectDistinctRecordPage(IPage<ApmRecordVO> page, Long createDept, String startTime, String endTime, String cupCardNo, String project, String status) { |
|
|
|
public IPage<ApmRecordListVO> selectDistinctRecordPage(IPage<ApmRecordVO> page, Long createDept, String startTime, String endTime, String cupCardNo, String project, String status) { |
|
|
|
@ -154,6 +158,35 @@ public class ApmRecordServiceImpl extends BaseServiceImpl<ApmRecordMapper, ApmRe |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证放号总数及预约总数
|
|
|
|
|
|
|
|
for (ApmRecord record : apmRecordList) { |
|
|
|
|
|
|
|
// 1.获取所属的放号
|
|
|
|
|
|
|
|
ApmConfig config = configMapper.selectOne(Wrappers.<ApmConfig>lambdaQuery() |
|
|
|
|
|
|
|
.eq(ApmConfig::getCreateDept, record.getCreateDept()) |
|
|
|
|
|
|
|
.eq(ApmConfig::getApmDay, record.getApmDay()) |
|
|
|
|
|
|
|
.eq(ApmConfig::getProject, record.getProject()) |
|
|
|
|
|
|
|
.eq(ApmConfig::getPeriod, record.getPeriod()) |
|
|
|
|
|
|
|
.eq(ApmConfig::getTimeFrame, record.getTimeFrame()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
// 2. 获取该放号的预约总数
|
|
|
|
|
|
|
|
List<ApmRecord> records = list(Wrappers.<ApmRecord>lambdaQuery() |
|
|
|
|
|
|
|
.eq(ApmRecord::getCreateDept, record.getCreateDept()) |
|
|
|
|
|
|
|
.eq(ApmRecord::getApmDay, record.getApmDay()) |
|
|
|
|
|
|
|
.eq(ApmRecord::getProject, record.getProject()) |
|
|
|
|
|
|
|
.eq(ApmRecord::getPeriod, record.getPeriod()) |
|
|
|
|
|
|
|
.eq(ApmRecord::getTimeFrame, record.getTimeFrame()) |
|
|
|
|
|
|
|
.eq(ApmRecord::getApmStatus, BusinessConstant.RECORD_STATUS_UNREGISTER) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
// 3 判断已预约总数是否 < 放号数, 若是, 可预约, 否则不可预约
|
|
|
|
|
|
|
|
if (Func.isEmpty(config)) { |
|
|
|
|
|
|
|
return "预约失败, 未找到对应放号记录"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Func.isEmpty(records) && records.size() >= config.getNumberNum()) { |
|
|
|
|
|
|
|
return "预约失败, 该项目已无余号"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ""; |
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|