@ -12,10 +12,7 @@ import org.springblade.common.constant.BusinessConstant;
import org.springblade.common.utils.CommonDateUtil ;
import org.springblade.core.secure.BladeUser ;
import org.springblade.core.secure.utils.AuthUtil ;
import org.springblade.core.tool.utils.BeanUtil ;
import org.springblade.core.tool.utils.DateUtil ;
import org.springblade.core.tool.utils.Func ;
import org.springblade.core.tool.utils.StringUtil ;
import org.springblade.core.tool.utils.* ;
import org.springblade.modules.business.dto.ApmRecordCountDTO ;
import org.springblade.modules.business.entity.ApmConfig ;
import org.springblade.modules.business.entity.ApmRecord ;
@ -158,6 +155,7 @@ public class ApmConfigServiceImpl extends ServiceImpl<ApmConfigMapper, ApmConfig
List < Map < String , Object > > detailList = new ArrayList < > ( ) ;
for ( ApmConfig config : configList ) {
Map < String , Object > detail = new HashMap < > ( ) ;
detail . put ( BusinessConstant . MAP_KEY_APM_CONFIG_LIST_ID , config . getId ( ) ) ;
detail . put ( BusinessConstant . MAP_KEY_APM_CONFIG_LIST_PERIOD , config . getPeriod ( ) ) ;
detail . put ( BusinessConstant . MAP_KEY_APM_CONFIG_LIST_TIME_FRAME , config . getTimeFrame ( ) ) ;
detail . put ( BusinessConstant . MAP_KEY_APM_CONFIG_LIST_NUMBER_NUM , config . getNumberNum ( ) ) ;
@ -377,6 +375,19 @@ public class ApmConfigServiceImpl extends ServiceImpl<ApmConfigMapper, ApmConfig
saveBatch ( configList ) ;
}
@Override
public String cancel ( String ids ) {
// 1. 先验证要取消的放号是否已有预约, 若有预约, 不允许取消
List < ApmRecord > records = recordMapper . getByApmConfig ( Func . toLongList ( ids ) ) ;
if ( Func . isNotEmpty ( records ) ) {
return "本次放号设置已有预约, 无法取消!" ;
}
// 2. 按照ids, 将放号记录标记删除
baseMapper . deleteBatchIds ( Func . toLongList ( ids ) ) ;
return null ;
}
private void deleteConfig ( Long createDept , List < String > apmDayList , List < String > projectList ) {
String apmDayStr = "('" + String . join ( "', '" , apmDayList ) + "')" ;
String projectStr = "('" + String . join ( "', '" , projectList ) + "')" ;