| | |
| | | package cn.huge.module.ctuser.service; |
| | | |
| | | import cn.huge.base.common.bo.R; |
| | | import cn.huge.base.common.bo.ReturnBO; |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.*; |
| | |
| | | import cn.huge.module.ctuser.domain.po.*; |
| | | import cn.huge.module.ctuser.dto.*; |
| | | import cn.huge.module.cust.constant.UserBaseConsts; |
| | | import cn.huge.module.rsoper.domain.po.RsRole; |
| | | import cn.huge.module.sys.dto.GridTokenBaseDTO; |
| | | import cn.huge.module.sys.dto.GridUserBaseDTO; |
| | | import cn.huge.module.sys.dto.GridUserRoleDTO; |
| | | import cn.huge.module.sys.vo.GridRoleMenuVo; |
| | | import cn.huge.module.sys.vo.GridUserRoleVo; |
| | | import cn.huge.module.utils.JwtUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | |
| | | CtUnit ctUnit = ctUnitService.getById(ctUser.getUnitId()); |
| | | if (ObjectUtils.isNotEmpty(ctUnit)) { |
| | | if (ctUnit.getUnitGrade() == UserBaseConsts.UNIT_GRADE_3 && ctUnit.getUnitType() == UserBaseConsts.UNIT_TYPE_102) { |
| | | userLoginDTO.setUnit(ctUnit.getUnitDes()); |
| | | userLoginDTO.setUnit(ctUnit.getUnitName()); |
| | | userLoginDTO.setUnitType(ctUnit.getUnitType()); |
| | | // CtUnit parentCtUnit = ctUnitService.getById(ctUnit.getParentId()); |
| | | // if (ObjectUtils.isNotEmpty(parentCtUnit)) {1 |
| | | // userLoginDTO.setUnit(parentCtUnit.getUnitName()); |
| | |
| | | // } |
| | | } else { |
| | | userLoginDTO.setUnit(ctUnit.getUnitName()); |
| | | userLoginDTO.setUnitType(ctUnit.getUnitType()); |
| | | } |
| | | } else { |
| | | userLoginDTO.setUnit(ctUser.getUnitName()); |
| | |
| | | log.info("xsdctUnit:{}", ctUnit); |
| | | ctUnitService.saveCtUnit(ctUnit); |
| | | userLoginDTO.setUnit(ctUnit.getUnitName()); |
| | | userLoginDTO.setUnitType(ctUnit.getUnitType()); |
| | | ctUser.setUnitName(ctUnit.getUnitName()); |
| | | ctUser.setUnitId(ctUnit.getId()); |
| | | ctUserService.updateCtUser(ctUser); |
| | |
| | | } else if (parts.length >= 4) { |
| | | return parts[0] + parts[1] + parts[2] + "-" + parts[3]; |
| | | } else if (parts.length >= 5) { |
| | | return parts[0] + parts[1] + parts[2] + "-" + parts[3]+"-" + parts[4]; |
| | | return parts[0] + parts[1] + parts[2] + "-" + parts[3] + "-" + parts[4]; |
| | | } else { |
| | | return input; // 或抛出异常 |
| | | } |
| | |
| | | userLoginDTO.setUserId(ctUser.getId()); |
| | | userLoginDTO.setTrueName(ctUser.getTrueName()); |
| | | userLoginDTO.setUnit(ctUser.getUnitName()); |
| | | CtUnit byId = ctUnitService.getById(ctUser.getUnitId()); |
| | | if (byId != null) { |
| | | userLoginDTO.setUnitType(byId.getUnitType()); |
| | | } |
| | | userLoginDTO.setDept(ctUser.getDeptName()); |
| | | userLoginDTO.setPhone(ctUser.getMobile()); |
| | | userLoginDTO.setCustId(ctUser.getCustId()); |
| | |
| | | GridUserRoleVo gridUserRoleVo = new GridUserRoleVo(); |
| | | gridUserRoleVo.setUserId(userId); |
| | | GridUserRoleDTO userRoleDTO = sysClient.getUserRoleList(gridUserRoleVo); |
| | | if (StringUtils.isEmpty(userRoleDTO.getRoleName()) || !userRoleDTO.getRoleName().contains("(M)")) { |
| | | if (StringUtils.isEmpty(userRoleDTO.getRoleName()) || (!userRoleDTO.getRoleName().contains("(M)") && !userRoleDTO.getRoleName().contains("领导") && !userRoleDTO.getRoleName().contains("调度干部"))) { |
| | | return ReturnFailUtils.getRepInfo("该用户没有矛调系统的权限"); |
| | | } |
| | | CtUserole ctUserole = new CtUserole(); |
| | |
| | | switch (grade) { |
| | | case 1: |
| | | //市级级 |
| | | ctUnit.setLevel(grade ); |
| | | ctUnit.setLevel(grade); |
| | | ctUnit.setUnitGrade(grade); |
| | | ctUnit.setUnitType(UserBaseConsts.UNIT_TYPE_102); |
| | | ctUnit.setParentId("2024000000000001"); |