Преглед изворни кода

修改添加百胜人脸定时任务接口

liu пре 2 година
родитељ
комит
bc13ed1184

+ 1 - 5
.idea/workspace.xml

@@ -5,10 +5,6 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="6c5cf517-721b-44b7-afae-e7b1b913b988" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -474,7 +470,7 @@
       <workItem from="1712651727692" duration="462000" />
       <workItem from="1712655825486" duration="5533000" />
       <workItem from="1712732614869" duration="205000" />
-      <workItem from="1712732829320" duration="4356000" />
+      <workItem from="1712732829320" duration="4658000" />
     </task>
     <servers />
   </component>

+ 14 - 6
src/main/java/com/template/services/impl/SmartCarAccessServiceImpl.java

@@ -8,14 +8,17 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.common.utils.CommonUtil;
 import com.template.common.utils.RequestUtils;
 import com.template.config.ParkConfig;
+import com.template.config.ScheduleConfig;
 import com.template.model.pojo.SmartCarAccess;
 import com.template.mapper.SmartCarAccessMapper;
 import com.template.services.SmartCarAccessService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
@@ -33,18 +36,23 @@ public class SmartCarAccessServiceImpl extends ServiceImpl<SmartCarAccessMapper,
     @Autowired
     ParkConfig parkConfig;
 
+    @Resource
+    private ScheduleConfig scheduleConfig;
+
     private Integer page = 0;
     private Integer size = 20;
 
     @Scheduled(cron = "0 0/45 * * * ? ")
+    @Async
     public void car() {
-        try {
-            getEnterCar(page, size);
-            getOutCar(page, size);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
+        if(scheduleConfig.getIsOpen().equals("1")) {
+            try {
+                getEnterCar(page, size);
+                getOutCar(page, size);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
         }
-
     }
 
 

+ 1 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -467,6 +467,7 @@ com\template\services\SmartIdentityService.class
 com\template\api\SmartBuildMeterControllerAPI.class
 com\template\model\evaluate\teacher\SimpleScoreDetailList.class
 com\template\controller\SmartIdentityController.class
+META-INF\spring-configuration-metadata.json
 com\template\model\seewo\StudentServiceRemoveClassStudentsParam$UnbindStudentQuery.class
 com\template\common\utils\MyX509TrustManager.class
 com\template\common\utils\StrUtils.class

BIN
target/mybatis_plus-0.0.1-SNAPSHOT.jar.original