|
@@ -10,9 +10,11 @@ import com.template.api.SmartFaceDiscernControllerAPI;
|
|
|
import com.template.common.utils.*;
|
|
import com.template.common.utils.*;
|
|
|
import com.template.config.ControlConfig;
|
|
import com.template.config.ControlConfig;
|
|
|
import com.template.model.pojo.SmartFaceDiscern;
|
|
import com.template.model.pojo.SmartFaceDiscern;
|
|
|
|
|
+import com.template.model.pojo.SmartQrcode;
|
|
|
import com.template.model.pojo.SmartUser;
|
|
import com.template.model.pojo.SmartUser;
|
|
|
import com.template.model.result.CommonResult;
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.services.SmartFaceDiscernService;
|
|
import com.template.services.SmartFaceDiscernService;
|
|
|
|
|
+import com.template.services.SmartQrcodeService;
|
|
|
import com.template.services.SmartUserService;
|
|
import com.template.services.SmartUserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -44,6 +46,9 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
|
|
|
@Autowired
|
|
@Autowired
|
|
|
SmartFaceDiscernService smartFaceDiscernService;
|
|
SmartFaceDiscernService smartFaceDiscernService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ SmartQrcodeService smartQrcodeService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public CommonResult track(Integer id,int dateTime) {
|
|
public CommonResult track(Integer id,int dateTime) {
|
|
@@ -57,6 +62,41 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
|
|
|
return CommonResult.ok(smartFaceDiscerns);
|
|
return CommonResult.ok(smartFaceDiscerns);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult access() {
|
|
|
|
|
+
|
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
+
|
|
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
|
|
+ for (int i = 0; i < 30; i++) {
|
|
|
|
|
+ LocalDateTime stateTime = now.minusDays(i+1);
|
|
|
|
|
+ LocalDateTime endTime = now.minusDays(i);
|
|
|
|
|
+ String dateTime = endTime.format(dateTimeFormatter);
|
|
|
|
|
+ LambdaQueryWrapper<SmartFaceDiscern> faceDiscernWrapper=new LambdaQueryWrapper<>();
|
|
|
|
|
+ faceDiscernWrapper.between(SmartFaceDiscern::getDateTime,stateTime,endTime)
|
|
|
|
|
+ .ne(SmartFaceDiscern::getType,"人脸比对");
|
|
|
|
|
+ int faceDiscernCount = smartFaceDiscernService.count(faceDiscernWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ LambdaQueryWrapper<SmartQrcode> qrcodeWrapper=new LambdaQueryWrapper<>();
|
|
|
|
|
+ qrcodeWrapper.between(SmartQrcode::getCreateTime,stateTime,endTime);
|
|
|
|
|
+ int qrcodeCount = smartQrcodeService.count(qrcodeWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+ jsonObject.put("date",dateTime);
|
|
|
|
|
+ jsonObject.put("face",faceDiscernCount);
|
|
|
|
|
+ jsonObject.put("code",qrcodeCount);
|
|
|
|
|
+ jsonArray.add(jsonObject);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(jsonArray);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public static JSONObject getDate(Integer date){
|
|
public static JSONObject getDate(Integer date){
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
|
@@ -74,8 +114,15 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
- JSONObject date = getDate(1);
|
|
|
|
|
- System.out.println("date = " + date);
|
|
|
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
+ for (int i = 1; i <= 30; i++) {
|
|
|
|
|
+ LocalDateTime endTime = now.minusDays(i);
|
|
|
|
|
+ String dateTime = endTime.format(dateTimeFormatter);
|
|
|
|
|
+ System.out.println("dateTime = " + dateTime);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|