|
@@ -2,10 +2,15 @@ package com.fdkk.sxz.webApi.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import com.fdkk.sxz.base.BaseController;
|
|
import com.fdkk.sxz.base.BaseController;
|
|
|
|
+import com.fdkk.sxz.base.Result;
|
|
|
|
+import com.fdkk.sxz.entity.RenovationPartsDetailEntity;
|
|
|
|
+import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
|
|
import com.fdkk.sxz.entity.custuom.CustomProductFirstclassifyEntity;
|
|
import com.fdkk.sxz.entity.custuom.CustomProductFirstclassifyEntity;
|
|
import com.fdkk.sxz.util.OkHttpUtils;
|
|
import com.fdkk.sxz.util.OkHttpUtils;
|
|
import com.fdkk.sxz.util.RedisUtil;
|
|
import com.fdkk.sxz.util.RedisUtil;
|
|
-import com.fdkk.sxz.base.Result;
|
|
|
|
|
|
+import com.fdkk.sxz.util.UploadToOssUtil;
|
|
|
|
+import com.fdkk.sxz.webApi.service.IRenovationPartsDetailService;
|
|
|
|
+import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
|
|
import com.fdkk.sxz.webApi.service.custom.ICustomProductFirstclassifyService;
|
|
import com.fdkk.sxz.webApi.service.custom.ICustomProductFirstclassifyService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -18,7 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@RestController
|
|
@RestController
|
|
@@ -35,6 +40,41 @@ public class testController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private CacheChannel cacheChannel;
|
|
private CacheChannel cacheChannel;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRenovationPartsDetailService renovationPartsDetailService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private UploadToOssUtil uploadToOssUtil;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICustomComponentService customComponentService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 替换所有为空的路径
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("cleanMviewPath")
|
|
|
|
+ @RequestMapping(value = "/cleanMviewPath", method = RequestMethod.POST)
|
|
|
|
+
|
|
|
|
+ public Result cleanMviewPath() {
|
|
|
|
+ List<RenovationPartsDetailEntity> list = renovationPartsDetailService.list();
|
|
|
|
+ for (RenovationPartsDetailEntity renovationPartsDetailEntity : list) {
|
|
|
|
+ if (!uploadToOssUtil.existFileToOSS(renovationPartsDetailEntity.getMviewPath(), "4d-tjw")) {
|
|
|
|
+ renovationPartsDetailEntity.setMviewPath(null);
|
|
|
|
+ renovationPartsDetailService.updateById(renovationPartsDetailEntity);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<CustomComponentEntity> list1 = customComponentService.list();
|
|
|
|
+ for (CustomComponentEntity customComponentEntity : list1) {
|
|
|
|
+ if (!uploadToOssUtil.existFileToOSS(customComponentEntity.getMviewPath(), "4d-tjw")) {
|
|
|
|
+ customComponentEntity.setMviewPath(null);
|
|
|
|
+ customComponentService.updateById(customComponentEntity);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return success();
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 测试redis
|
|
* 测试redis
|
|
@@ -52,6 +92,7 @@ public class testController extends BaseController {
|
|
redisUtil.set(key, val);
|
|
redisUtil.set(key, val);
|
|
return success(redisUtil.get(key));
|
|
return success(redisUtil.get(key));
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 测试redis
|
|
* 测试redis
|
|
*
|
|
*
|
|
@@ -65,19 +106,20 @@ public class testController extends BaseController {
|
|
@RequestMapping(value = "/jetcache", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/jetcache", method = RequestMethod.POST)
|
|
public Result jetcache(Long id) {
|
|
public Result jetcache(Long id) {
|
|
CustomProductFirstclassifyEntity byId = customProductFirstclassifyService.findById(id);
|
|
CustomProductFirstclassifyEntity byId = customProductFirstclassifyService.findById(id);
|
|
- byId.setName(byId.getName()+"1");
|
|
|
|
- cacheChannel.get("CustomProductFirstclassifyEntity","3CustomProductFirstclassifyEntity");
|
|
|
|
|
|
+ byId.setName(byId.getName() + "1");
|
|
|
|
+ cacheChannel.get("CustomProductFirstclassifyEntity", "3CustomProductFirstclassifyEntity");
|
|
|
|
|
|
|
|
|
|
- CustomProductFirstclassifyEntity byId1 = customProductFirstclassifyService.findById(id+1);
|
|
|
|
|
|
+ CustomProductFirstclassifyEntity byId1 = customProductFirstclassifyService.findById(id + 1);
|
|
|
|
|
|
- customProductFirstclassifyService.updateById(byId);
|
|
|
|
|
|
+ customProductFirstclassifyService.updateById(byId);
|
|
|
|
|
|
// customProductFirstclassifyService.removeById(byId.getId());
|
|
// customProductFirstclassifyService.removeById(byId.getId());
|
|
- cacheChannel.set("asd", "AAA",123);
|
|
|
|
|
|
+ cacheChannel.set("asd", "AAA", 123);
|
|
|
|
|
|
return success(CollUtil.newArrayList(byId, byId1));
|
|
return success(CollUtil.newArrayList(byId, byId1));
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 测试redis
|
|
* 测试redis
|
|
*
|
|
*
|