|
@@ -3,14 +3,12 @@ package com.fdkankan.scene.service.impl;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
-import com.fdkankan.common.constant.CommonOperStatus;
|
|
|
|
-import com.fdkankan.common.constant.CommonStatus;
|
|
|
|
-import com.fdkankan.common.constant.SceneAsynFuncType;
|
|
|
|
-import com.fdkankan.common.constant.SceneAsynModuleType;
|
|
|
|
-import com.fdkankan.common.constant.SceneAsynOperType;
|
|
|
|
|
|
+import com.fdkankan.common.constant.*;
|
|
|
|
+import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.scene.entity.SceneAsynOperLog;
|
|
import com.fdkankan.scene.entity.SceneAsynOperLog;
|
|
import com.fdkankan.scene.mapper.ISceneAsynOperLogMapper;
|
|
import com.fdkankan.scene.mapper.ISceneAsynOperLogMapper;
|
|
@@ -19,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fdkankan.scene.vo.SceneAsynOperLogParamVO;
|
|
import com.fdkankan.scene.vo.SceneAsynOperLogParamVO;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -31,7 +30,7 @@ import org.springframework.stereotype.Service;
|
|
* 服务实现类
|
|
* 服务实现类
|
|
* </p>
|
|
* </p>
|
|
*
|
|
*
|
|
- * @author
|
|
|
|
|
|
+ * @author
|
|
* @since 2022-12-07
|
|
* @since 2022-12-07
|
|
*/
|
|
*/
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -115,4 +114,37 @@ public class SceneAsynOperLogServiceImpl extends ServiceImpl<ISceneAsynOperLogMa
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void checkSceneAsynOper(String num, String operType, String module, String function) {
|
|
|
|
+ LambdaQueryWrapper<SceneAsynOperLog> queryWrapper =
|
|
|
|
+ new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
|
|
+ .eq(SceneAsynOperLog::getNum,num)
|
|
|
|
+ .eq(SceneAsynOperLog::getState, CommonOperStatus.WAITING.code());
|
|
|
|
+ if(StrUtil.isNotEmpty(operType)){
|
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getOperType, operType);
|
|
|
|
+ }
|
|
|
|
+ if(StrUtil.isNotEmpty(module)){
|
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getModule, module);
|
|
|
|
+ }
|
|
|
|
+ if(StrUtil.isNotEmpty(function)){
|
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getFunc, function);
|
|
|
|
+ }
|
|
|
|
+ List<SceneAsynOperLog> waittingLogList = this.list(queryWrapper);
|
|
|
|
+ if(CollUtil.isNotEmpty(waittingLogList)){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5066);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void cleanLog(String num, String moduleType, String funcType, String... operTypes) {
|
|
|
|
+ LambdaQueryWrapper<SceneAsynOperLog> wrapper = new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
|
|
+ .eq(SceneAsynOperLog::getNum, num)
|
|
|
|
+ .eq(SceneAsynOperLog::getModule, moduleType)
|
|
|
|
+ .eq(SceneAsynOperLog::getFunc, funcType);
|
|
|
|
+ if(ArrayUtil.isNotEmpty(operTypes)){
|
|
|
|
+ wrapper.in(SceneAsynOperLog::getOperType, operTypes);
|
|
|
|
+ }
|
|
|
|
+ this.remove(wrapper);
|
|
|
|
+ }
|
|
}
|
|
}
|