| | |
| | | secureRegistry.excludePathPatterns("/chat-records/**"); |
| | | secureRegistry.excludePathPatterns("/chatgroup/**"); |
| | | secureRegistry.excludePathPatterns("/chatgroupc/**"); |
| | | secureRegistry.excludePathPatterns("/zc/**"); |
| | | return secureRegistry; |
| | | } |
| | | |
| | |
| | | import org.springblade.modules.auth.provider.TokenParameter; |
| | | import org.springblade.modules.auth.utils.TokenUtil; |
| | | import org.springblade.modules.system.entity.UserInfo; |
| | | import org.springblade.modules.zc.service.IZcService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | private final BladeRedis bladeRedis; |
| | | private final JwtProperties jwtProperties; |
| | | private final IZcService iZcService; |
| | | |
| | | @ApiLog("登录用户验证") |
| | | @PostMapping("/oauth/token") |
| | |
| | | @ApiParam(value = "密码", required = true) @RequestParam(required = false) String password) { |
| | | |
| | | Kv authInfo = Kv.create(); |
| | | String s = iZcService.selectType(username); |
| | | |
| | | String grantType = WebUtil.getRequest().getParameter("grant_type"); |
| | | String refreshToken = WebUtil.getRequest().getParameter("refresh_token"); |
| | |
| | | ITokenGranter granter = TokenGranterBuilder.getGranter(grantType); |
| | | UserInfo userInfo = granter.grant(tokenParameter); |
| | | |
| | | if (userInfo == null || userInfo.getUser() == null) { |
| | | if (userInfo == null || userInfo.getUser() == null && s.equals("0")) { |
| | | return authInfo.set("error_description", "用户未审核"); |
| | | } |
| | | if (userInfo == null || userInfo.getUser() == null && s.equals("2")) { |
| | | return authInfo.set("error_description", "审核不通过"); |
| | | } |
| | | if (userInfo == null || userInfo.getUser() == null ) { |
| | | return authInfo.set("error_code", HttpServletResponse.SC_BAD_REQUEST).set("error_description", "用户名或密码不正确"); |
| | | } |
| | | |
| | |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | List<DeptVO> selectInfo(); |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | @Param("deptId") Long deptId, |
| | | @Param("jurisdiction")String jurisdiction); |
| | | |
| | | List<DeptVO> selectInfo(); |
| | | } |
| | |
| | | <result column="has_children" property="hasChildren"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="lazyList" resultMap="deptVOResultMap"> |
| | | SELECT |
| | | dept.* , |
| | |
| | | <insert id="add" parameterType="org.springblade.modules.system.entity.Dept" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into blade_dept(tenant_id, parent_id,ancestors,dept_category,dept_name) values(#{tenantId}, #{parentId}, #{ancestors}, #{deptCategory}, #{deptName}) |
| | | </insert> |
| | | <select id="selectInfo" resultType="java.util.HashMap"> |
| | | <select id="selectInfo" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | DISTINCT |
| | | dept.id, |
| | |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | List<String> selectIn(); |
| | | List<DeptVO> selectInfo(); |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNodes> lazyTreeUsers(Integer type,Long deptId); |
| | | |
| | | List<DeptVO> selectInfo(); |
| | | } |
| | |
| | | return ForestNodeMerger.merge(baseMapper.securityLazyTree(jurisdiction, parentId)); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectIn() { |
| | | return baseMapper.selectIn(); |
| | | } |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | |
| | | @Override |
| | | public List<DeptVO> selectInfo() { |
| | | return baseMapper.selectInfo(); |
| | | return ForestNodeMerger.merge(baseMapper.selectInfo()); |
| | | } |
| | | } |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入zc") |
| | | public R update(@Valid @RequestBody Zc zc) { |
| | | String type = zc.getType(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String times = df.format(new Date()); |
| | | zc.setZctime(times); |
| | | if (type.equals("1")){ |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | | user.setRealName(zc.getSname()); |
| | | user.setCardid(zc.getCardid()); |
| | | user.setRoleId("1433232531179704321"); |
| | | user.setDeptId(zc.getDeptid()); |
| | | iUserService.saveOrUpdate(user); |
| | | } |
| | | return R.status(zcService.updateById(zc)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入zc") |
| | | public R submit(@Valid @RequestBody Zc zc) { |
| | | String type = zc.getType(); |
| | | if (type.equals("1")){ |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | | user.setRealName(zc.getSname()); |
| | | user.setSex(Integer.valueOf(zc.getSex())); |
| | | user.setPhone(zc.getPhone()); |
| | | user.setDeptId(zc.getDeptid()); |
| | | user.setRoleId(zc.getParentId()); |
| | | iUserService.saveOrUpdate(user); |
| | | } |
| | | return R.status(zcService.saveOrUpdate(zc)); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String sname; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String phone; |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String cardid; |
| | | |
| | | /** |
| | | * 注册时间 |
| | |
| | | @ApiModelProperty(value = "审核状态") |
| | | private String type; |
| | | private String deptid; |
| | | private String parentId; |
| | | |
| | | |
| | | } |
| | |
| | | <result column="zctime" property="zctime"/> |
| | | <result column="type" property="type"/> |
| | | <result column="deptid" property="deptid"/> |
| | | <result column="parentId" property="parentId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectZcPage" resultMap="zcResultMap"> |
| | | select * from act_zc where is_deleted = 0 |
| | | SELECT |
| | | z.id, |
| | | z.username, |
| | | z.sname, |
| | | z.cardid, |
| | | z.type, |
| | | d.dept_name AS deptid |
| | | FROM |
| | | act_zc z |
| | | LEFT JOIN blade_dept d ON d.id = z.deptid where 1=1 |
| | | <if test="zc.type!=null and zc.type!=''"> |
| | | and z.type=#{zc.type} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--注册新增--> |
| | | <insert id="inster"> |
| | | insert into act_zc(username,password,sname,sex,phone,zctime,deptid) values(#{username},#{password},#{sname},#{sex},#{phone},#{zctime},#{deptid}) |
| | | </insert> |
| | | <insert id="inster"> |
| | | insert into act_zc(username, password, sname, cardid, zctime, deptid) |
| | | values (#{username}, #{password}, #{sname}, #{cardid}, #{zctime}, #{deptid}) |
| | | </insert> |
| | | |
| | | <select id="selectType" resultType="String"> |
| | | select type from act_zc where username=#{param1} |
| | | select type |
| | | from act_zc |
| | | where username = #{param1} |
| | | </select> |
| | | |
| | | </mapper> |