| | |
| | | |
| | | import java.util.Map; |
| | | |
| | | import com.aliyuncs.exceptions.ClientException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.course.util.RedisUtil; |
| | | import com.dsh.course.util.UUIDUtil; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.dataScope.DataScope; |
| | | import com.dsh.guns.modular.system.controller.util.ALiSendSms; |
| | | import com.dsh.guns.modular.system.model.UserListVO; |
| | | import com.dsh.guns.modular.system.model.UserQuery; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.User; |
| | |
| | | */ |
| | | @Service |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService { |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Override |
| | | public int setStatus(Integer userId, int status) { |
| | |
| | | |
| | | @Override |
| | | public User getByAccount(String account) { |
| | | System.out.println("=====account===="+account); |
| | | return this.baseMapper.getByAccount(account); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserListPage(Page<Map<String, Object>> page, DataScope dataScope, String name, String beginTime, String endTime, Integer deptid) { |
| | | List<Map<String, Object>> userListPage = this.baseMapper.getUserListPage(page, dataScope, name, beginTime, endTime, deptid); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | List<Map<String, Object>> userListPage = this.baseMapper.getUserListPage(page, dataScope, name, beginTime, endTime, deptid,objectType,objectId); |
| | | return userListPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserListVO> searchUsers(UserQuery userQuery) { |
| | | return this.baseMapper.searchUsers(userQuery); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil getSMSCode(String phone) { |
| | | |
| | | String numberRandom = UUIDUtil.getNumberRandom(6); |
| | | String templateCode = ""; |
| | | templateCode = "SMS_160960014"; |
| | | |
| | | try { |
| | | aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + numberRandom + "\"}"); |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | redisUtil.setStrValue(phone, numberRandom, 300); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |