| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.Role; |
| | | import com.example.erp.entity.userInfo.User; |
| | | import com.example.erp.mapper.pp.ProductionSchedulingMapper; |
| | | import com.example.erp.mapper.userInfo.*; |
| | | import com.example.erp.tools.TokenTools; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | private final PermissionRoleMapper permissionRoleMapper; |
| | | private final ProductionSchedulingMapper productionSchedulingMapper; |
| | | |
| | | @Autowired |
| | | LogService logService; |
| | | |
| | | public UserService(UserMapper userMapper, RoleMapper roleMapper, PermissionRoleMapper permissionRoleMapper, UserRoleMapper userRoleMapper, ProductionSchedulingMapper productionSchedulingMapper) { |
| | | this.userMapper = userMapper; |
| | |
| | | userDTO.setToken(StpUtil.getTokenValue()); |
| | | Boolean userIsAdmin= userRoleMapper.getUserIsAdmin(user.getId()); |
| | | userDTO.setPermissions(permissionRoleMapper.getUserEditPermission(user.getId(),userIsAdmin)); |
| | | |
| | | Log log = new Log(); |
| | | log.setOperator(user.getUserName()); |
| | | log.setOperatorId(userDTO.getUserId()); |
| | | log.setContent(userDTO.toString()); |
| | | log.setFunction("用户登录"); |
| | | logService.saveLog(log); |
| | | return userDTO; |
| | | }else{ |
| | | return null; |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Object getUserLog() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", userMapper.getUserLog()); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //查询用户优化参数 |
| | | public String getOptimizeParms(String username) { |