|
@@ -6,6 +6,7 @@ import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.content.VistorContextHolder;
|
|
import com.ruoyi.common.core.content.VistorContextHolder;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.domain.model.LoginBody;
|
|
import com.ruoyi.common.core.domain.model.LoginBody;
|
|
|
import com.ruoyi.common.core.domain.model.LoginCard;
|
|
import com.ruoyi.common.core.domain.model.LoginCard;
|
|
@@ -17,12 +18,14 @@ import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.enums.ExamType;
|
|
import com.ruoyi.common.enums.ExamType;
|
|
|
import com.ruoyi.common.utils.NumberUtils;
|
|
import com.ruoyi.common.utils.NumberUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
+import com.ruoyi.dz.domain.DzAgent;
|
|
|
import com.ruoyi.dz.domain.DzCards;
|
|
import com.ruoyi.dz.domain.DzCards;
|
|
|
import com.ruoyi.dz.domain.DzClasses;
|
|
import com.ruoyi.dz.domain.DzClasses;
|
|
|
import com.ruoyi.dz.domain.DzControl;
|
|
import com.ruoyi.dz.domain.DzControl;
|
|
|
import com.ruoyi.dz.domain.DzSchool;
|
|
import com.ruoyi.dz.domain.DzSchool;
|
|
|
import com.ruoyi.dz.mapper.DzClassesMapper;
|
|
import com.ruoyi.dz.mapper.DzClassesMapper;
|
|
|
import com.ruoyi.dz.mapper.DzSchoolMapper;
|
|
import com.ruoyi.dz.mapper.DzSchoolMapper;
|
|
|
|
|
+import com.ruoyi.dz.service.IDzAgentService;
|
|
|
import com.ruoyi.dz.service.IDzCardsService;
|
|
import com.ruoyi.dz.service.IDzCardsService;
|
|
|
import com.ruoyi.dz.service.IDzClassesService;
|
|
import com.ruoyi.dz.service.IDzClassesService;
|
|
|
import com.ruoyi.dz.service.IDzControlService;
|
|
import com.ruoyi.dz.service.IDzControlService;
|
|
@@ -33,6 +36,7 @@ import com.ruoyi.enums.UserTypeEnum;
|
|
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
|
import com.ruoyi.framework.web.service.TokenService;
|
|
import com.ruoyi.framework.web.service.TokenService;
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
|
|
+import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
import com.ruoyi.web.service.CommService;
|
|
import com.ruoyi.web.service.CommService;
|
|
|
import com.ruoyi.web.service.SysLoginService;
|
|
import com.ruoyi.web.service.SysLoginService;
|
|
@@ -65,8 +69,10 @@ public class UserController extends BaseController {
|
|
|
private final IDzClassesService dzClassesService;
|
|
private final IDzClassesService dzClassesService;
|
|
|
private final DzSchoolMapper dzSchoolMapper;
|
|
private final DzSchoolMapper dzSchoolMapper;
|
|
|
private final DzClassesMapper dzClassesMapper;
|
|
private final DzClassesMapper dzClassesMapper;
|
|
|
|
|
+ private final IDzAgentService agentService;
|
|
|
|
|
+ private final ISysDeptService deptService;
|
|
|
|
|
|
|
|
- public UserController(IDzControlService dzControlService, SysLoginService loginService, ISysUserService userService, SysPermissionService permissionService, TokenService tokenService, CommService commService, ISysConfigService configService, IDzCardsService dzCardsService, IDzSchoolService dzSchoolService, IDzClassesService dzClassesService, DzSchoolMapper dzSchoolMapper, DzClassesMapper dzClassesMapper) {
|
|
|
|
|
|
|
+ public UserController(IDzControlService dzControlService, SysLoginService loginService, ISysUserService userService, SysPermissionService permissionService, TokenService tokenService, CommService commService, ISysConfigService configService, IDzCardsService dzCardsService, IDzSchoolService dzSchoolService, IDzClassesService dzClassesService, DzSchoolMapper dzSchoolMapper, DzClassesMapper dzClassesMapper, IDzAgentService agentService, ISysDeptService deptService) {
|
|
|
this.dzControlService = dzControlService;
|
|
this.dzControlService = dzControlService;
|
|
|
this.loginService = loginService;
|
|
this.loginService = loginService;
|
|
|
this.userService = userService;
|
|
this.userService = userService;
|
|
@@ -79,6 +85,8 @@ public class UserController extends BaseController {
|
|
|
this.dzClassesService = dzClassesService;
|
|
this.dzClassesService = dzClassesService;
|
|
|
this.dzSchoolMapper = dzSchoolMapper;
|
|
this.dzSchoolMapper = dzSchoolMapper;
|
|
|
this.dzClassesMapper = dzClassesMapper;
|
|
this.dzClassesMapper = dzClassesMapper;
|
|
|
|
|
+ this.agentService = agentService;
|
|
|
|
|
+ this.deptService = deptService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = "provinces")
|
|
@GetMapping(value = "provinces")
|
|
@@ -239,6 +247,58 @@ public class UserController extends BaseController {
|
|
|
ajax.put("isDefaultModifyPwd", commService.initPasswordIsModify(user.getPwdUpdateDate()));
|
|
ajax.put("isDefaultModifyPwd", commService.initPasswordIsModify(user.getPwdUpdateDate()));
|
|
|
ajax.put("isPasswordExpired", commService.passwordIsExpiration(user.getPwdUpdateDate()));
|
|
ajax.put("isPasswordExpired", commService.passwordIsExpiration(user.getPwdUpdateDate()));
|
|
|
|
|
|
|
|
|
|
+ // 添加组织信息.卡号/邀请码开始找:再逐步找到 代理商-机构
|
|
|
|
|
+ Long agentId = null;
|
|
|
|
|
+ if(null != user.getCardId()) {
|
|
|
|
|
+ DzCards cards = dzCardsService.selectDzCardsByCardId(user.getCardId());
|
|
|
|
|
+ if(null != cards) {
|
|
|
|
|
+ agentId = cards.getAgentId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if (null != user.getInviteCode()) {
|
|
|
|
|
+ String inviteCode = user.getInviteCode();
|
|
|
|
|
+ // 如果邀请码全部是数字,则转换为Long
|
|
|
|
|
+ if (NumberUtils.isNumeric(inviteCode)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ agentId = Long.parseLong(inviteCode);
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ // 如果转换失败,保持为null
|
|
|
|
|
+ agentId = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 通过代理商查询机构信息
|
|
|
|
|
+ Long deptId = null;
|
|
|
|
|
+ if (null != agentId) {
|
|
|
|
|
+ DzAgent agent = agentService.selectDzAgentByAgentId(agentId);
|
|
|
|
|
+ if(null != agent && null != agent.getDeptId()) {
|
|
|
|
|
+ deptId = agent.getDeptId();
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //默认使用单招一卡通
|
|
|
|
|
+ deptId = 101L;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 构建组织信息对象
|
|
|
|
|
+ // 查询机构信息
|
|
|
|
|
+ SysDept dept = deptService.selectDeptById(deptId);
|
|
|
|
|
+ JSONObject org = new JSONObject();
|
|
|
|
|
+ if(null != dept) {
|
|
|
|
|
+ // 优先使用机构中的信息
|
|
|
|
|
+ if(StringUtils.isNotBlank(dept.getLogo())) {
|
|
|
|
|
+ org.put("logo", dept.getLogo());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotBlank(dept.getDeptName())) {
|
|
|
|
|
+ org.put("orgName", dept.getDeptName());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotBlank(dept.getContactPhone())) {
|
|
|
|
|
+ org.put("contactPhone", dept.getContactPhone());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ajax.put("org", org);
|
|
|
|
|
+
|
|
|
//获取app的配置文件
|
|
//获取app的配置文件
|
|
|
String type = request.getHeader("type");
|
|
String type = request.getHeader("type");
|
|
|
//H5 wechat frontApp均需要菜单
|
|
//H5 wechat frontApp均需要菜单
|