| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.YamlProperties; |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.DocUserMapper; |
| | | import com.whyc.pojo.DocDepart; |
| | |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.system.ApplicationHome; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import static com.whyc.util.ActionUtil.createFilefolderIFNotExist; |
| | | |
| | |
| | | wrapper.set("depart_id",docUser.getDepartId()); |
| | | wrapper.set("face_id",faceId); |
| | | wrapper.set("role_id",docUser.getRoleId()); |
| | | wrapper.set("dload_flag",docUser.getDloadFlag()); |
| | | wrapper.set("mail",docUser.getMail()); |
| | | wrapper.eq("id",docUser.getId()); |
| | | int bl=mapper.update(null,wrapper); |
| | | return new Response().set(1,bl>0); |
| | |
| | | return response.set(1,false,"密码错误"); |
| | | } |
| | | //登录成功 |
| | | ServletContext servletContext = request.getServletContext(); |
| | | servletContext.setAttribute(name, request.getSession().getId()); |
| | | //Session存储当前用户及权限组列表 |
| | | DocUser userDB = (DocUser) subject.getPrincipal(); |
| | | userDB.setSnId(null); |
| | |
| | | List<DocUser> list=mapper.getAllDocUser(); |
| | | return new Response().setII(1,list!=null,list,"数据返回"); |
| | | } |
| | | |
| | | public Response readUserByRoleIds(Integer[] roleIds) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | List<Integer> integers = Arrays.asList(roleIds); |
| | | wrapper.in("role_id",integers); |
| | | wrapper.select("id","name","role_id"); |
| | | List<DocUser> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0,list,"返回数据"); |
| | | } |
| | | |
| | | public boolean checkExists(String userName) { |
| | | QueryWrapper<DocUser> query = Wrappers.query(); |
| | | query.eq("name",userName).last(" limit 1"); |
| | | DocUser docUser = mapper.selectOne(query); |
| | | return docUser != null; |
| | | } |
| | | } |