| | |
| | | return msg; |
| | | } |
| | | @GetMapping("/company/user/list") |
| | | @ApiOperation(value = "获取企业用户数据",response = Msg.class) |
| | | @ApiOperation(value = "获取企业用户数据-分页",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | |
| | | if (StringUtils.isNotBlank(job)){ |
| | | condition.put("job",job.trim()); |
| | | } |
| | | Integer type = getUser().getType(); |
| | | if(type.equals(3)){ |
| | | condition.put("companyid",getUser().getCompanyid()); |
| | | } |
| | | |
| | | condition.put("roleId",35l); |
| | | pageInfo.setCondition(condition); |
| | | userService.selectCompanyUserDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | | @GetMapping("/supervise/user/list") |
| | | @ApiOperation(value = "获取监管用户数据",response = Msg.class) |
| | | @ApiOperation(value = "获取监管用户数据-分页",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | |
| | | @ApiImplicitParam(name = "company",value = "单位名称"), |
| | | @ApiImplicitParam(name = "realname",value = "姓名"), |
| | | @ApiImplicitParam(name = "idcard",value = "身份证号"), |
| | | @ApiImplicitParam(name = "province",value = "省"), |
| | | @ApiImplicitParam(name = "city",value = "市"), |
| | | @ApiImplicitParam(name = "county",value = "县"), |
| | | }) |
| | | public Msg getSuperviseUserInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order, |
| | | String username,String company,String realname, String idcard){ |
| | | String username,String company,String realname, String idcard, String province,String city,String county){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | |
| | | if (StringUtils.isNotBlank(idcard)){ |
| | | condition.put("idcard",idcard.trim()); |
| | | } |
| | | if (StringUtils.isNotBlank(province)){ |
| | | condition.put("province",province.trim()); |
| | | |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getProvince())){ |
| | | condition.put("province", userInfoCurrent.getProvince()); |
| | | if(StringUtils.isNotBlank(city)){ |
| | | condition.put("city", city); |
| | | } |
| | | if(StringUtils.isNotBlank(county)){ |
| | | condition.put("county", county); |
| | | } |
| | | |
| | | }else { |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getProvince())){ |
| | | condition.put("province", userInfoCurrent.getProvince()); |
| | | } |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getCity())){ |
| | | condition.put("city", userInfoCurrent.getCity()); |
| | | } |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getCounty())){ |
| | | condition.put("county", userInfoCurrent.getCounty()); |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getCity())){ |
| | | condition.put("city", userInfoCurrent.getCity()); |
| | | } |
| | | if(StringUtils.isNotBlank(userInfoCurrent.getCounty())){ |
| | | condition.put("county", userInfoCurrent.getCounty()); |
| | | } |
| | | condition.put("roleId",38l); |
| | | |
| | | |
| | | |
| | | pageInfo.setCondition(condition); |
| | | userService.selectSuperviseUserDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | |
| | | } |
| | | |
| | | @GetMapping("/expert/user/list") |
| | | @ApiOperation(value = "获取监管用户数据",response = Msg.class) |
| | | @ApiOperation(value = "获取专家用户数据-分页",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageIndex",value = "当前页码"), |
| | | @ApiImplicitParam(name = "pageSize",value = "每页行数"), |
| | |
| | | condition.put("idcard",idcard.trim()); |
| | | } |
| | | |
| | | condition.put("roleId",36l); |
| | | |
| | | pageInfo.setCondition(condition); |
| | | userService.selectExpertUserDataGrid(pageInfo); |
| | | msg.setResult(pageInfo); |
| | |
| | | userInfo.setProfessionalLevel(professionalLevel); |
| | | userInfo.setJob(jsonObject.getString("job")); |
| | | userInfo.setStatus((byte)1); |
| | | userInfo.setType(3); |
| | | userInfo.setType(4); |
| | | userInfo.setCreatedby(getUser().getRealname()); |
| | | userInfo.setRealname(realname); |
| | | userInfo.setCreateddate(new Date()); |
| | |
| | | } |
| | | String password = jsonObject.getString("password"); |
| | | String PW_PATTERN = "(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[~!@#$%^&*_.]).{8,}"; |
| | | if (!password.matches(PW_PATTERN)){ |
| | | msg.setCode(ErrorCode.ERROR_10004.getCode()); |
| | | msg.setMessage("密码必须8位以上,并且包含大小写字母、数字、特殊符号三种以上"); |
| | | return msg; |
| | | }else { |
| | | userInfo.setPassword(MD5Utils.encode(password)); |
| | | if (StringUtils.isNotBlank(password)){ |
| | | if (!password.matches(PW_PATTERN)){ |
| | | msg.setCode(ErrorCode.ERROR_10004.getCode()); |
| | | msg.setMessage("密码必须8位以上,并且包含大小写字母、数字、特殊符号三种以上"); |
| | | return msg; |
| | | }else { |
| | | userInfo.setPassword(MD5Utils.encode(password)); |
| | | } |
| | | } |
| | | String username = jsonObject.getString("username"); |
| | | if (StringUtils.isNotBlank(username) && username.length() == 11){ |
| | |
| | | msg.setMessage("专业不存在"); |
| | | return msg; |
| | | } |
| | | List<UserInfo> userInfoExist = userService.selectUserInfo(userInfo.getId(),userInfo.getUsername()); |
| | | if (userInfoExist.size() > 0){ |
| | | msg.setCode(ErrorCode.ERROR_10004.getCode()); |
| | | msg.setMessage("用户名重复"); |
| | | return msg; |
| | | } |
| | | |
| | | userInfo.setCompany(jsonObject.getString("company")); |
| | | userInfo.setEmail(jsonObject.getString("email")); |
| | |
| | | userInfo.setProfessionalLevel(professionalLevel); |
| | | userInfo.setJob(jsonObject.getString("job")); |
| | | userInfo.setStatus((byte)1); |
| | | userInfo.setType(3); |
| | | userInfo.setCreatedby(getUser().getRealname()); |
| | | userInfo.setRealname(realname); |
| | | userInfo.setCreateddate(new Date()); |
| | |
| | | userInfo.setLastmodifieddate(new Date()); |
| | | userInfo.setIsdel((byte)0); |
| | | userInfo.setIsupload((byte)0); |
| | | List<UserInfo> userInfoExist = userService.selectUserInfo(null,userInfo.getUsername()); |
| | | if (userInfoExist.size() > 0){ |
| | | msg.setCode(ErrorCode.ERROR_10004.getCode()); |
| | | msg.setMessage("用户名重复"); |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | int userSize = userService.selectUserSize(); |
| | | int sli = (userSize + 1) % sliceSize; |
| | | userInfo.setSlice(sli + ""); |
| | | if (sli == 0) |
| | | userInfo.setSlice(sliceSize + ""); |
| | | userService.save(userInfo); |
| | | userService.updateById(userInfo); |
| | | return msg; |
| | | } |
| | | /** |
| | |
| | | msg.setMessage("省(自治区)不能为空"); |
| | | return msg; |
| | | } |
| | | |
| | | String city = jsonObject.getString("city"); |
| | | if (executiveLevel == 2 && StringUtils.isBlank(city)){ |
| | | msg.setCode(ErrorCode.ERROR_10004.getCode()); |
| | |
| | | }else { |
| | | userInfo.setCounty(county); |
| | | } |
| | | //非超管 或者 管理员 |
| | | if(!userInfoCurrent.getType().equals(1) && !userInfoCurrent.getType().equals(2)){ |
| | | if(userInfoCurrent.getType().equals(3) || userInfoCurrent.getType().equals(4)){ |
| | | msg.setCode(ErrorCode.ERROR_70001.getCode()); |
| | | msg.setMessage("专家或企业用户无权限新增监管用户信息"); |
| | | return msg; |
| | | } |
| | | //管理员(监管) |
| | | if(userInfoCurrent.getType().equals(2)){ |
| | | //判断当前用户是否有权限新增其管辖下监管机构用户 |
| | | Integer currentUserExLevl = userInfoCurrent.getExecutiveLevel(); |
| | | if(currentUserExLevl < executiveLevel){ |
| | |
| | | userInfo.setCompany(companyName); |
| | | userInfo.setJob(jsonObject.getString("job")); |
| | | userInfo.setStatus((byte)1); |
| | | userInfo.setType(3); |
| | | userInfo.setType(2); |
| | | userInfo.setCreatedby(getUser().getRealname()); |
| | | userInfo.setRealname(realname); |
| | | userInfo.setCreateddate(new Date()); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/put/supervise/user") |
| | | @ApiOperation(value = "修改企业用户数据",response = Msg.class) |
| | | @ApiOperation(value = "修改监管用户数据",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id",value = "用户id",required = true), |
| | | @ApiImplicitParam(name = "username",value = "手机号",required = true), |
| | | @ApiImplicitParam(name = "password",value = "密码",required = true), |
| | | @ApiImplicitParam(name = "password",value = "密码"), |
| | | @ApiImplicitParam(name = "email",value = "邮箱"), |
| | | @ApiImplicitParam(name = "job",value = "职务"), |
| | | @ApiImplicitParam(name = "realname",value = "姓名"), |
| | |
| | | return msg; |
| | | } |
| | | userInfo.setId(id); |
| | | //非超管、 管理员 、自己可以修改 |
| | | if((!userInfoCurrent.getType().equals(1)) && (!userInfoCurrent.getType().equals(2)) && (!id .equals(userInfoCurrent.getId()))){ |
| | | |
| | | if(userInfoCurrent.getType().equals(3) || userInfoCurrent.getType().equals(4)){ |
| | | msg.setCode(ErrorCode.ERROR_70001.getCode()); |
| | | msg.setMessage("专家或企业用户无权限新增监管用户信息"); |
| | | return msg; |
| | | } |
| | | //监管用户 、自己要验证 |
| | | if(userInfoCurrent.getType().equals(2) && (!id .equals(userInfoCurrent.getId()))){ |
| | | //判断当前用户是否有权限新增其管辖下监管机构用户 |
| | | Integer currentUserExLevl = userInfoCurrent.getExecutiveLevel(); |
| | | if(currentUserExLevl < executiveLevel){ |
| | |
| | | if (StringUtils.isNotBlank(company)) { |
| | | condition.put("company", company.trim()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(province)) { |
| | | if(getUser().getType() == 3){ |
| | | condition.put("companyid", getUser().getCompanyid()); |
| | | } |
| | | if(getUser().getType() == 2){ |
| | | condition.put("province", getUser().getProvince()); |
| | | condition.put("city", getUser().getCity()); |
| | | condition.put("area", getUser().getCounty()); |
| | | } |
| | | /*if (StringUtils.isNotBlank(province)) { |
| | | condition.put("province", province.trim()); |
| | | } |
| | | |
| | |
| | | |
| | | if (StringUtils.isNotBlank(community)) { |
| | | condition.put("community", community.trim()); |
| | | } |
| | | UserInfo userInfo = userService.selectByUser(getUser().getUsername()); |
| | | }*/ |
| | | /*UserInfo userInfo = userService.selectByUser(getUser().getUsername()); |
| | | if (!companyService.isMain(userInfo.getCompany())){ |
| | | condition.put("company",userInfo.getCompany()); |
| | | } |
| | | }*/ |
| | | //是系统菜单下的就显示主体,否则非主体 |
| | | // if (isMain) { |
| | | // condition.put("isMain", 1); |
| | |
| | | // } |
| | | pageInfo.setCondition(condition); |
| | | companyService.selectDataGrid(pageInfo); |
| | | if(getUser().getType() ==4 ){ |
| | | pageInfo.setResult(new ArrayList()); |
| | | } |
| | | msg.setResult(pageInfo); |
| | | return msg; |
| | | } |
| | |
| | | * 获取专家用户列表 |
| | | */ |
| | | @GetMapping("/expert/list") |
| | | @ApiOperation(value = "获取监管用户数据",response = Msg.class) |
| | | @ApiOperation(value = "获取专家用户数据",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "realname",value = "姓名"), |
| | | }) |
| | |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | HashMap<String, Object> condition = new HashMap<String, Object>(); |
| | | |
| | | if (StringUtils.isNotBlank(realname)){ |
| | | condition.put("realname",realname.trim()); |
| | | } |
| | | |
| | | condition.put("roleId",36l); |
| | | msg.setResult(userService.selectExpertList(realname)); |
| | | return msg; |
| | | } |
| | | |
| | | /** |
| | | * 获取监管辖区内的企业 |
| | | */ |
| | | @GetMapping("/company/list") |
| | | @ApiOperation(value = "获取监管辖区企业数据",response = Msg.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "companyName",value = "企业名称"), |
| | | }) |
| | | public Msg getCompanyList(String companyName){ |
| | | Msg msg = new Msg(); |
| | | msg.setCode("200"); |
| | | msg.setMessage("success"); |
| | | msg.setResult(companyService.selectCompanyList(companyName,getUser())); |
| | | return msg; |
| | | } |
| | | } |