Просмотр исходного кода

Merge branch 'master' of http://49.234.186.218:9000/root/ieplus

jinxia.mo 1 месяц назад
Родитель
Сommit
367c03f7d2

+ 25 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/dz/DzCardsController.java

@@ -6,7 +6,9 @@ import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ValidationException;
 
+import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.collect.Lists;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.enums.ExamType;
 import com.ruoyi.common.enums.UserRegStatus;
@@ -26,10 +28,10 @@ import com.ruoyi.web.service.SysRegisterService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
@@ -248,6 +250,28 @@ public class DzCardsController extends BaseController
         return AjaxResult.success();
     }
 
+    @GetMapping(value = "/cardUser/{cardId}")
+    @ApiOperation("卡用户详情")
+    public AjaxResult getCardUser(@PathVariable("cardId") Long cardId)
+    {
+        CardUserBody cardUserBody = new CardUserBody();
+        DzCards dzCards = dzCardsService.selectDzCardsByCardId(cardId);
+        if(null == dzCards) {
+            throw new ValidationException("卡号无效");
+        }
+        List<SysUser> sysUserList = sysUserService.selectUserByCardIds(Lists.newArrayList(cardId));
+        if(CollectionUtils.isEmpty(sysUserList)) {
+            throw new ValidationException("卡用户无效");
+        }
+        SysUser sysUser = sysUserList.get(0);
+        BeanUtils.copyProperties(sysUser, cardUserBody, "password", "schoolId", "classId");
+        cardUserBody.setMobile(sysUser.getPhonenumber());
+        if (null != sysUser.getDirectedStudy()) {
+            cardUserBody.setDirectionStudy(JSONArray.parse(sysUser.getDirectedStudy()));
+        }
+        BeanUtils.copyProperties(dzCards, cardUserBody, "password", "nickName", "location", "examType", "endYear");
+        return success(cardUserBody);
+    }
 
     /**
      * 统计学习卡数据

+ 1 - 0
ie-system/src/main/java/com/ruoyi/dz/service/impl/DzCardsServiceImpl.java

@@ -250,6 +250,7 @@ public class DzCardsServiceImpl implements IDzCardsService
             dzCards.setDistributeStatus(CardDistributeStatus.Assign.getVal());
             dzCards.setPayStatus(PayStatus.UnPay.getVal()); // TODO 暂时分配即开卡
             dzCards.setStatus(CardStatus.Open.getVal());
+            dzCards.setOpenTime(DateUtils.getNowDate());
             dzCards.setDays(days);
             dzCardsMapper.updateDzCards(dzCards);
         });

+ 1 - 1
ie-system/src/main/java/com/ruoyi/learn/domain/PaperVO.java

@@ -104,7 +104,7 @@ public class PaperVO {
                     if(CollectionUtils.isEmpty(answers)) {
                         return 4;
                     }
-                    List<String> stdAnswers = StringUtils.charStr2List(answer1); // 多选的 answer1 无逗号分隔
+                    List<String> stdAnswers = StringUtils.charStr2List(std.answer1); // 多选的 answer1 无逗号分隔
                     return stdAnswers.size() == answers.size() && CollectionUtils.intersection(stdAnswers, answers).size() == answers.size() ? 1 : 2;
                 } else {
                     if(CollectionUtils.isEmpty(answers)) {