|
|
@@ -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);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 统计学习卡数据
|