瀏覽代碼

抽帧历史文件

yumeng 5 年之前
父節點
當前提交
d660ae6416

+ 30 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -87,6 +88,35 @@ public class TestController {
     @Autowired
     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")
     public String getToken(Long accountId, String refreshToken, Integer agentType) {

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -94,7 +94,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url:  url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java

@@ -34,4 +34,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
     MaterialInfo getMaterialInfoByCode(@Param("code") String code);
 
     Long getProjectIdByAccountId(@Param("accountId") Long accountId);
+
+    List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
 }

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -130,5 +130,13 @@
         limit 1
     </select>
 
+    <select id="getListByDate" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
+        select  *  from
+        ctop_material_info
+        where  1 = 1
+        and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= #{startDate}
+        and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endDate}
+    </select>
+
 
 </mapper>

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -64,4 +64,5 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     List<String> getEffiCode();
 
+    List<MaterialInfo> getListByDate(String startDate, String endDate);
 }

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -603,6 +603,11 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
         return materialInfoList;
     }
+
+    @Override
+    public List<MaterialInfo> getListByDate(String startDate, String endDate) {
+        return materialInfoMapper.getListByDate(startDate, endDate);
+    }
 }