liu 2 лет назад
Родитель
Сommit
ec729803e9

+ 3 - 0
src/main/java/com/template/api/SmartAttendanceControllerAPI.java

@@ -88,4 +88,7 @@ public interface SmartAttendanceControllerAPI {
     @ApiOperation(value = "学生考勤纪律", notes = "学生考勤纪律", httpMethod = "GET")
     CommonResult queryPage(@RequestParam int currentPage, @RequestParam int pageCount,Integer gradeId,Integer classId,String status,String studentNo ,String name,String startTime,String endTime);
 
+    @GetMapping(value = "/verification")
+    @ApiOperation(value = "核销", notes = "核销", httpMethod = "GET")
+    CommonResult verification(@RequestParam String id);
 }

+ 16 - 0
src/main/java/com/template/controller/SmartAttendanceController.java

@@ -30,6 +30,7 @@ import com.template.services.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.validation.BindingResult;
@@ -376,6 +377,21 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
         return CommonResult.ok(result);
     }
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult verification(String id) {
+        SmartAttendance attendance = smartAttendanceService.getById(id);
+        if (ObjectUtils.isEmpty(attendance)) {
+            return CommonResult.fail("该id不存在");
+        }
+        attendance.setIfVerification(1);
+        boolean update = smartAttendanceService.updateById(attendance);
+        if (update) {
+            return CommonResult.ok();
+        }
+        return CommonResult.fail();
+    }
+
     public PersonalLeaveListSchoolPeriodRecordsResult getXwAttendance(String startDate, String endDate, Integer currentPage, Integer pageSize) {
         //初始化客户端
         SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));