|
@@ -1,4 +1,5 @@
|
|
|
package com.fdkankan.manage.test;
|
|
|
+import com.fdkankan.manage.vo.request.ModelingLevelParam;
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -18,6 +19,7 @@ import com.fdkankan.manage.util.ExcelUtil;
|
|
|
import com.fdkankan.manage.util.RsaUtils;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -224,4 +226,33 @@ public class TestController {
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IMqCameraLevelService mqCameraLevelService;
|
|
|
+ @Autowired
|
|
|
+ IMqNumLevelService mqNumLevelService;
|
|
|
+
|
|
|
+ @PostMapping("/updateModelingLevel")
|
|
|
+ public ResultData updateModelingLevel(@RequestBody ModelingLevelParam param){
|
|
|
+ if(param.getConfigId() == null && (param.getCameraId() == null || StringUtils.isBlank(param.getNum()))){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ if(param.getCameraId() != null){
|
|
|
+ MqCameraLevel cameraLevel = mqCameraLevelService.getByCameraId(param.getCameraId());
|
|
|
+ if(cameraLevel == null){
|
|
|
+ mqCameraLevelService.saveEntity(param.getCameraId(),param.getConfigId());
|
|
|
+ }else {
|
|
|
+ mqCameraLevelService.updateLevelById(cameraLevel.getId(),param.getConfigId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(param.getNum())){
|
|
|
+ MqNumLevel mqNumLevel = mqNumLevelService.getByNum(param.getNum());
|
|
|
+ if(mqNumLevel == null){
|
|
|
+ mqNumLevelService.saveEntity(param.getNum(),param.getConfigId());
|
|
|
+ }else {
|
|
|
+ mqNumLevelService.updateLevelById(mqNumLevel.getId(),param.getConfigId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
}
|