|
@@ -43,6 +43,7 @@ import com.zhongzheng.modules.exam.domain.ExamNumber;
|
|
|
import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
|
|
|
import com.zhongzheng.modules.exam.mapper.ExamBeforeMapper;
|
|
|
import com.zhongzheng.modules.exam.mapper.ExamNumberMapper;
|
|
|
+import com.zhongzheng.modules.exam.service.IExamApplyService;
|
|
|
import com.zhongzheng.modules.exam.service.IExamSiteService;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamApplyVo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
|
|
@@ -103,6 +104,7 @@ import com.zhongzheng.modules.user.vo.*;
|
|
|
import com.zhongzheng.modules.wisdom.service.IWisdomService;
|
|
|
import com.zhongzheng.modules.wisdom.vo.CenterVo;
|
|
|
import com.zhongzheng.modules.wisdom.vo.ExamineesVo;
|
|
|
+import com.zhongzheng.modules.wisdom.vo.WisdomResultVo;
|
|
|
import com.zhongzheng.modules.wisdom.vo.WisdomRoomVo;
|
|
|
import com.zhongzheng.modules.wx.service.IWxLoginService;
|
|
|
import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
|
|
@@ -143,6 +145,8 @@ public class WisdomServiceImpl implements IWisdomService {
|
|
|
|
|
|
private String batchUserUrl = "/exam/api/center-examinees";
|
|
|
|
|
|
+ private String examStatusUrl = "/exam/api/status";
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
@@ -152,6 +156,9 @@ public class WisdomServiceImpl implements IWisdomService {
|
|
|
@Autowired
|
|
|
private IUserSubscribeService iUserSubscribeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IExamApplyService iExamApplyService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private OssService ossService;
|
|
|
|
|
@@ -345,8 +352,9 @@ public class WisdomServiceImpl implements IWisdomService {
|
|
|
objectLambdaUpdateWrapper.set(UserSubscribe::getRoomId, vo.getRoomId());
|
|
|
success++;
|
|
|
}else{
|
|
|
+ String reason = Validator.isNotEmpty(vo.getFailureReason())?vo.getFailureReason():"";
|
|
|
objectLambdaUpdateWrapper.set(UserSubscribe::getSyncStatus, 2);
|
|
|
- objectLambdaUpdateWrapper.set(UserSubscribe::getSyncResult, "同步失败:"+vo.getFailureReason()+DateUtils.getTime());
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getSyncResult, "同步失败:"+reason+DateUtils.getTime());
|
|
|
fail++;
|
|
|
}
|
|
|
objectLambdaUpdateWrapper.set(UserSubscribe::getUpdateTime,DateUtils.getNowTime());
|
|
@@ -361,4 +369,56 @@ public class WisdomServiceImpl implements IWisdomService {
|
|
|
}
|
|
|
return mapResult;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void syncExamStatus(Long applyId,Integer pageNo) {
|
|
|
+ ExamApplyVo applyVo = iExamApplyService.queryById(applyId);
|
|
|
+ String auth_code = authorization();
|
|
|
+ Map<String, Object> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("examCode",applyVo.getCode());
|
|
|
+ paramMap.put("pageNo",pageNo);
|
|
|
+ paramMap.put("pageSize",20);
|
|
|
+ try{
|
|
|
+ String url = host + examStatusUrl;
|
|
|
+ String signature = SignatureUtil.createSignature(paramMap, appid);
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("examCode",applyVo.getCode());
|
|
|
+ obj.put("pageNo",pageNo);
|
|
|
+ obj.put("pageSize",20);
|
|
|
+ Map<String, String> hearders = new HashMap<>();
|
|
|
+ hearders.put("auth_code", auth_code);
|
|
|
+ hearders.put("appid", appid);
|
|
|
+ hearders.put("sign", signature);
|
|
|
+ String result = HttpUtils.sendPostHeader(url,obj,hearders);
|
|
|
+ System.out.println(result);
|
|
|
+ JSONObject userInfoJSON = null;
|
|
|
+ userInfoJSON = JSON.parseObject(result);
|
|
|
+ if (userInfoJSON.containsKey("code")&&"200".equals(String.valueOf(userInfoJSON.get("code")))) {
|
|
|
+ Integer page = Integer.valueOf(userInfoJSON.getJSONObject("result").get("pages").toString());
|
|
|
+ JSONArray jsonArray = userInfoJSON.getJSONObject("result").getJSONArray("records");
|
|
|
+ List<WisdomResultVo> list=jsonArray.toJavaList(WisdomResultVo.class);
|
|
|
+ for (WisdomResultVo vo : list){
|
|
|
+ LambdaUpdateWrapper<UserSubscribe> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ objectLambdaUpdateWrapper.eq(UserSubscribe::getExamineeCode, vo.getExamineeCode());
|
|
|
+ if(vo.getDistributionStatus()==0){
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getWisdomTemperature,vo.getTemperature());
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getWisdomExamStatus,vo.getExamStatus());
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getWisdomReportTime,DateUtils.dateTimeSec(DateUtils.YYYY_MM_DD_HH_MM_SS,vo.getReportTime()));
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getSyncExamResult, "同步结果成功"+DateUtils.getTime());
|
|
|
+ }
|
|
|
+ if(vo.getDistributionStatus()==1){
|
|
|
+ String reason = Validator.isNotEmpty(vo.getFailureReason())?vo.getFailureReason():"";
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getSyncExamResult, "同步结果失败"+reason+DateUtils.getTime());
|
|
|
+ }
|
|
|
+ objectLambdaUpdateWrapper.set(UserSubscribe::getUpdateTime,DateUtils.getNowTime());
|
|
|
+ iUserSubscribeService.update(null, objectLambdaUpdateWrapper);
|
|
|
+ }
|
|
|
+ if(page>pageNo){
|
|
|
+ syncExamStatus(applyId,pageNo++);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new CustomException("获取考生考试状态信息失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|