|
|
@@ -1,5 +1,6 @@
|
|
|
package com.ruoyi.web.service;
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
@@ -175,13 +176,15 @@ public class SysRegisterService
|
|
|
if (!userService.checkPhoneUnique(upUser)) {
|
|
|
throw new ValidationException("保存用户'" + upUser.getNickName() + "'失败,注册手机已存在" + cardUserBody.getMobile());
|
|
|
}
|
|
|
- JSONObject directed = cardUserBody.getDirectionStudy().getJSONObject(0);
|
|
|
- Long planId = directed.getLongValue("majorId");
|
|
|
- Long universityId = directed.getLongValue("universityId");
|
|
|
- directed.put("notice", learnTeacherService.updateDirected(userId, universityId, planId));
|
|
|
- cardUserBody.getDirectionStudy().set(0, directed);
|
|
|
- upUser.setDirectedStudy(cardUserBody.getDirectionStudy().toJSONString());
|
|
|
-
|
|
|
+ JSONArray directList = cardUserBody.getDirectionStudy();
|
|
|
+ if (null != directList && !directList.isEmpty()) {
|
|
|
+ JSONObject directed = directList.getJSONObject(0);
|
|
|
+ Long planId = directed.getLongValue("majorId");
|
|
|
+ Long universityId = directed.getLongValue("universityId");
|
|
|
+ directed.put("notice", learnTeacherService.updateDirected(userId, universityId, planId));
|
|
|
+ cardUserBody.getDirectionStudy().set(0, directed);
|
|
|
+ upUser.setDirectedStudy(cardUserBody.getDirectionStudy().toJSONString());
|
|
|
+ }
|
|
|
DzCards upCard = new DzCards();
|
|
|
upCard.setCardId(card.getCardId());
|
|
|
upCard.setSchoolId(cardUserBody.getSchoolId());
|