|
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -87,6 +88,35 @@ public class TestController {
|
|
@Autowired
|
|
@Autowired
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
private ICtopOauthTokenService oauthTokenService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IMaterialCutFrameService cutFrameService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/createCutTask")
|
|
|
|
+ public String createCutTask(String startDate, String endDate) throws IOException {
|
|
|
|
+
|
|
|
|
+ List<MaterialInfo> materialInfos = materialInfoService.getListByDate(startDate, endDate);
|
|
|
|
+ if (!Check.isNull(materialInfos)) {
|
|
|
|
+ for (MaterialInfo materialInfo : materialInfos) {
|
|
|
|
+ if (!Check.isNull(materialInfo)) {
|
|
|
|
+ String code = materialInfo.getCode();
|
|
|
|
+ QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ parameterQueryWrapper.eq("material_id", code);
|
|
|
|
+ parameterQueryWrapper.last("limit 1");
|
|
|
|
+ MaterialParameter materialParameter = parameterService.getOne(parameterQueryWrapper);
|
|
|
|
+ if (!Check.isNull(materialParameter)) {
|
|
|
|
+ cutFrameService.getCutFrame(materialInfo.getUrl(), code, materialParameter.getSecond(), materialParameter.getHeight(), materialParameter.getWidth());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return "Success";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/getToken")
|
|
@GetMapping(value = "/getToken")
|
|
public String getToken(Long accountId, String refreshToken, Integer agentType) {
|
|
public String getToken(Long accountId, String refreshToken, Integer agentType) {
|