|
@@ -1184,6 +1184,48 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public UserNewGoodsVo getOldGoodsRedirect(Long userId) {
|
|
|
+ UserNewGoodsVo vo = new UserNewGoodsVo();
|
|
|
+ User user = iUserService.getById(userId);
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ SysTenant tenant = iSysTenantService.getById(user.getTenantId());
|
|
|
+ if (tenant.getExamRoom() != 1){
|
|
|
+ //不需要祥粤考场
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String idCard = EncryptHandler.decrypt(user.getIdCard());
|
|
|
+ String telPhone = EncryptHandler.decrypt(user.getTelphone());
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(idCard+telPhone+nowTime + "pubilc2022");
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("idNum", idCard);
|
|
|
+ params.put("passwordSign", "2");
|
|
|
+ params.put("telphone",telPhone);
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(OLD_GOODS, params);
|
|
|
+ if (!respone.contains("\"code\":200")) {
|
|
|
+ throw new CustomException("旧系统用户跳转接口错误");
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(respone);
|
|
|
+ Object data = jsonObject.get("data");
|
|
|
+ if (ObjectUtils.isNotNull(data)){
|
|
|
+ vo = JSONObject.parseObject(JSONObject.toJSONString(data), UserNewGoodsVo.class);
|
|
|
+ }else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new CustomException("旧系统用户跳转接口错误");
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
private Long liveTime(Long nowTime, Integer day) {
|
|
|
for (Integer i = 0; i < day; i++) {
|
|
|
Long dayAfter = DateUtils.getDayAfter(nowTime, 1);
|