|
@@ -8,12 +8,10 @@ import cn.com.ctop.common.module.utils.StatusCode;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -31,6 +29,9 @@ public class FileController {
|
|
|
@Autowired
|
|
|
private IMaterialImageInfoService materialImageInfoService;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("file/check")
|
|
|
public Map<String, Object> chenckFile(String code, Long projectId) {
|
|
|
return materialInfoService.checkMaterialInfo(code, projectId);
|
|
@@ -51,21 +52,21 @@ public class FileController {
|
|
|
|
|
|
@PostMapping("/insertV3")
|
|
|
public Map<String, Object> insertV3(@RequestBody JSONObject data) {
|
|
|
- Map<String,Object>result = new HashMap<>();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
Long projectId = data.getLong("projectId");
|
|
|
JSONArray array = data.getJSONArray("videoArray");
|
|
|
//校验重复code逻辑
|
|
|
JSONArray checkArray = materialInfoService.checkArrayCode(array);
|
|
|
- if(null!=checkArray&&!checkArray.isEmpty()){
|
|
|
- for (int i=0;i<array.size();i++){
|
|
|
+ if (null != checkArray && !checkArray.isEmpty()) {
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject json = array.getJSONObject(i);
|
|
|
json.put("userId", user.getId());
|
|
|
- json.put("projectId",projectId);
|
|
|
+ json.put("projectId", projectId);
|
|
|
materialInfoService.correlationUploadV2(json);
|
|
|
}
|
|
|
}
|
|
|
- ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
|