diff --git a/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java index 23f76ae..71df31d 100644 --- a/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java +++ b/src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java @@ -26,4 +26,10 @@ public interface ActivityDetectionMapper extends BaseMapper * 获取今天成功次数 */ int todayCnt(Long classId, Long memberId, Integer checkType, Integer status); + + /** + * 人脸识别更新时间 + */ + void updateTime(ActivityDetectionDO activityDetectionDO); + } diff --git a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java index 6f0b2bc..0764bc9 100644 --- a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java @@ -123,6 +123,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl() + .lambda() + .eq(ActivityDetectionDO::getFaceCheckId,imageCheckRecordDO.getId())); try { imageCheckRecordDO.setPhoto(OSSUtils.uploadOneFile(resultVO.getPhotoList().get(resultVO.getPhotoList().size() - 1))); if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 50)) { @@ -299,15 +324,14 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl epidemicSituationClassBasics = new ArrayList<>(); //查找前一天产生数据的班级 -// List classIds = renSheJuMapper.newClasses("0"); - - List classIds = new ArrayList<>(); - classIds.add(404L); + List classIds = renSheJuMapper.newClasses("0"); try { if (classIds.size() > 0) { @@ -202,28 +199,28 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); -// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); -// -// Request request = new Request.Builder() -// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") -// .method("POST", body) -// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") -// .addHeader("Content-Type", "application/json") -// .build(); -// Response response = client.newCall(request).execute(); -// -// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); -// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); -// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); -// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); -// if (200 == response.code()) { -// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); -// } else { -// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); -// } -// renshejuHistoryMapper.insert(renshejuHistoryDO); -// return rensheResponseVO; - return null; + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); + + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + return rensheResponseVO; +// return null; } catch (Exception e) { e.printStackTrace(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); @@ -330,29 +327,29 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadChapterBehaviorDTO)); -// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); -// Request request = new Request.Builder() -// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadChapterBehavior") -// .method("POST", body) -// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") -// .addHeader("Content-Type", "application/json") -// .build(); -// Response response = client.newCall(request).execute(); -// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); -// System.out.println(rensheResponseVO); -// if (200 == response.code()) { -// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); -// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); -// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); -// if (200 == response.code()) { -// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); -// } else { -// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); -// } -// renshejuHistoryMapper.insert(renshejuHistoryDO); -// } -// return rensheResponseVO; - return null; + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadChapterBehavior") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + System.out.println(rensheResponseVO); + if (200 == response.code()) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return rensheResponseVO; +// return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); @@ -420,28 +417,28 @@ public class RenSheJuServiceImpl implements RenSheJuService { uploadClassAnswerQuestionBehaviorDTO.setAnswerBasic(answerBasics); System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadClassAnswerQuestionBehaviorDTO)); -// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); -// Request request = new Request.Builder() -// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassAnswerQuestionBehavior") -// .method("POST", body) -// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") -// .addHeader("Content-Type", "application/json") -// .build(); -// Response response = client.newCall(request).execute(); -// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); -// System.out.println(rensheResponseVO); -// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); -// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5); -// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); -// if (200 == response.code()) { -// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); -// } else { -// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); -// } -// renshejuHistoryMapper.insert(renshejuHistoryDO); -// -// return rensheResponseVO; - return null; + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassAnswerQuestionBehavior") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + System.out.println(rensheResponseVO); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + + return rensheResponseVO; +// return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5); @@ -530,22 +527,22 @@ public class RenSheJuServiceImpl implements RenSheJuService { if (imageDetailLists.size() > 0) { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage)); -// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); -// Request request = new Request.Builder() -// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage") -// .method("POST", body) -// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") -// .addHeader("Content-Type", "application/json") -// .build(); -// Response response = client.newCall(request).execute(); -// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); -// -// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); -// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6); -// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); -// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); -// renshejuHistoryMapper.insert(renshejuHistoryDO); -// rensheResponseVOS.add(rensheResponseVO); + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + renshejuHistoryMapper.insert(renshejuHistoryDO); + rensheResponseVOS.add(rensheResponseVO); System.out.println(111); } else { RenshejuHistoryDO renshejuHistoryDO1 = new RenshejuHistoryDO(); diff --git a/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java b/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java index 9c7304d..a13d539 100644 --- a/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java @@ -38,9 +38,6 @@ public class ShehuihuaServiceImpl implements ShehuihuaService { private RenSheConfig renSheConfig; @Autowired - private ClassDictMapper classDictMapper; - - @Autowired RenshejuHistoryMapper renshejuHistoryMapper; @Autowired @@ -160,6 +157,7 @@ public class ShehuihuaServiceImpl implements ShehuihuaService { } } catch (Exception e) { + e.printStackTrace(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_3); renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); @@ -593,7 +591,7 @@ public class ShehuihuaServiceImpl implements ShehuihuaService { renshejuHistoryDO1.setOutputParam(RenSheJuConstant.NO_DATA); renshejuHistoryMapper.insert(renshejuHistoryDO1); } - +// return null; } catch (Exception e) { e.printStackTrace(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); diff --git a/src/main/resources/mapper/ActivityDetectionMapper.xml b/src/main/resources/mapper/ActivityDetectionMapper.xml index 23ec0b4..b140a5c 100644 --- a/src/main/resources/mapper/ActivityDetectionMapper.xml +++ b/src/main/resources/mapper/ActivityDetectionMapper.xml @@ -46,4 +46,10 @@ AND t.`status` = #{status} AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT(NOW(),'%Y-%m-%d') + + + update activity_detection t + set t.order_no = #{orderNo} where t.id = #{id} + + diff --git a/src/main/resources/mapper/OprAdmDictMapper.xml b/src/main/resources/mapper/OprAdmDictMapper.xml index eba47cb..6ba7e01 100644 --- a/src/main/resources/mapper/OprAdmDictMapper.xml +++ b/src/main/resources/mapper/OprAdmDictMapper.xml @@ -70,7 +70,7 @@ FROM opr_adm_dict WHERE - create_date < (NOW() - INTERVAL 10 DAY) + create_date < (NOW() - INTERVAL 1 DAY) diff --git a/src/main/resources/mapper/OprMemDictMapper.xml b/src/main/resources/mapper/OprMemDictMapper.xml index 0ab3b1d..5ca5c51 100644 --- a/src/main/resources/mapper/OprMemDictMapper.xml +++ b/src/main/resources/mapper/OprMemDictMapper.xml @@ -52,7 +52,7 @@ FROM opr_mem_dict WHERE - create_date < (NOW() - INTERVAL 10 DAY) + create_date < (NOW() - INTERVAL 1 DAY) SELECT t1.result AS access, - UNIX_TIMESTAMP( t1.update_date )* 1000 AS activityTime + UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime FROM image_check_record t1 WHERE @@ -386,7 +386,7 @@ left join class_dict t2 on t.class_id = t2.id WHERE t.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( t.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -444,7 +444,7 @@ t2.user_name AS studentName, t2.id_card AS identity, t2.telephone AS phone, - UNIX_TIMESTAMP( t1.update_date )* 1000 AS activityTime + UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime FROM image_check_record t1 LEFT JOIN member t2 ON t1.member_id = t2.id @@ -468,7 +468,7 @@ t2.user_name AS studentName, t2.id_card AS identity, t2.telephone AS phone, - UNIX_TIMESTAMP( t1.update_date )* 1000 AS activityTime + UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime FROM image_check_record t1 LEFT JOIN member t2 ON t1.member_id = t2.id