Commit 589d1251 by 涂亚平

社会化学徒制数据推送

1 parent 1177d0df
......@@ -26,4 +26,10 @@ public interface ActivityDetectionMapper extends BaseMapper<ActivityDetectionDO>
* 获取今天成功次数
*/
int todayCnt(Long classId, Long memberId, Integer checkType, Integer status);
/**
* 人脸识别更新时间
*/
void updateTime(ActivityDetectionDO activityDetectionDO);
}
......@@ -123,6 +123,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO.setBizSeqNo(RandomUtil.randomOrderNumber());
imageCheckRecordMapper.insert(imageCheckRecordDO);
ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
activityDetectionDO.setClassId(classId);
if (null == paperId){
activityDetectionDO.setCheckType(1);
}else {
activityDetectionDO.setCheckType(2);
}
activityDetectionDO.setMemberId(memberDO.getId());
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
activityDetectionMapper.insert(activityDetectionDO);
//获取signTicket
IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken());
//生成签名
......@@ -196,6 +207,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO.setBizSeqNo(RandomUtil.randomOrderNumber());
imageCheckRecordMapper.insert(imageCheckRecordDO);
ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
activityDetectionDO.setClassId(classId);
if (null == paperId){
activityDetectionDO.setCheckType(1);
}else {
activityDetectionDO.setCheckType(2);
}
activityDetectionDO.setMemberId(memberDO.getId());
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
activityDetectionMapper.insert(activityDetectionDO);
//获取signTicket
IdCardTicketsVO idCardTicketsVO = this.signTickets(getLatestAccessToken());
......@@ -271,11 +293,14 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
.eq(ImageCheckRecordDO::getBizSeqNo, checkResultDTO.getId()));
if (!StringUtils.isEmpty(resultVO.getSimilarity())) {
BeanUtils.copyProperties(resultVO, imageCheckRecordDO);
ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
activityDetectionDO.setClassId(imageCheckRecordDO.getClassId());
activityDetectionDO.setMemberId(imageCheckRecordDO.getMemberId());
activityDetectionDO.setCheckType(1);
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
// ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
// activityDetectionDO.setClassId(imageCheckRecordDO.getClassId());
// activityDetectionDO.setMemberId(imageCheckRecordDO.getMemberId());
// activityDetectionDO.setCheckType(1);
// activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
ActivityDetectionDO activityDetectionDO = activityDetectionMapper.selectOne(new QueryWrapper<ActivityDetectionDO>()
.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<ImageCheckRecordMap
}
} catch (Exception e) {
imageCheckRecordDO.setResult(0);
imageCheckRecordDO.setResult(0);
activityDetectionDO.setStatus(0);
e.printStackTrace();
}
if (null != imageCheckRecordDO.getPaperId()) {
activityDetectionDO.setCheckType(2);
}
activityDetectionMapper.insert(activityDetectionDO);
// if (null != imageCheckRecordDO.getPaperId()) {
// activityDetectionDO.setCheckType(2);
// }
activityDetectionMapper.updateById(activityDetectionDO);
imageCheckRecordMapper.updateById(imageCheckRecordDO);
}
return imageCheckRecordDO;
......
......@@ -59,10 +59,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List<EpidemicSituationClassBasic> epidemicSituationClassBasics = new ArrayList<>();
//查找前一天产生数据的班级
// List<Long> classIds = renSheJuMapper.newClasses("0");
List<Long> classIds = new ArrayList<>();
classIds.add(404L);
List<Long> 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();
......
......@@ -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();
......
......@@ -46,4 +46,10 @@
AND t.`status` = #{status}
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT(NOW(),'%Y-%m-%d')
</select>
<update id="updateTime" parameterType="com.subsidy.model.ActivityDetectionDO">
update activity_detection t
set t.order_no = #{orderNo} where t.id = #{id}
</update>
</mapper>
......@@ -70,7 +70,7 @@
FROM
opr_adm_dict
WHERE
create_date &lt; (NOW() - INTERVAL 10 DAY)
create_date &lt; (NOW() - INTERVAL 1 DAY)
</select>
</mapper>
......@@ -52,7 +52,7 @@
FROM
opr_mem_dict
WHERE
create_date &lt; (NOW() - INTERVAL 10 DAY)
create_date &lt; (NOW() - INTERVAL 1 DAY)
</select>
<select id="getLatestLoginInfo" parameterType="long" resultType="com.subsidy.model.OprMemDictDO">
......
......@@ -188,7 +188,7 @@
<select id="examActivities" resultType="com.subsidy.vo.renshe.ExamActivitiesVO">
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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!