2022-09-16 15:07:17 +08:00
|
|
|
package com.rzyc.controller;
|
|
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
import com.common.utils.model.Code;
|
|
|
|
|
import com.common.utils.model.Message;
|
2022-09-26 09:22:06 +08:00
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.common.utils.StringUtils;
|
|
|
|
|
import com.common.utils.encryption.PasswdFactory;
|
|
|
|
|
import com.common.utils.jwt.JwtUtil;
|
2022-09-16 15:07:17 +08:00
|
|
|
import com.common.utils.model.SingleResult;
|
2022-11-14 17:51:04 +08:00
|
|
|
import com.rzyc.bean.user.dto.AppLoginDto;
|
2022-09-26 09:22:06 +08:00
|
|
|
import com.rzyc.bean.user.dto.LoginDto;
|
2022-10-11 15:21:09 +08:00
|
|
|
import com.rzyc.config.MethodAnnotation;
|
2022-10-17 17:40:17 +08:00
|
|
|
import com.rzyc.config.RedisUtil;
|
2022-11-11 19:57:18 +08:00
|
|
|
import com.rzyc.model.*;
|
2022-10-11 17:35:01 +08:00
|
|
|
import com.rzyc.model.dto.*;
|
2022-11-07 17:47:41 +08:00
|
|
|
import com.rzyc.model.ent.EntPost;
|
2022-09-30 09:41:48 +08:00
|
|
|
import com.rzyc.model.ent.EntUser;
|
|
|
|
|
import com.rzyc.service.PcBusinessService;
|
|
|
|
|
import com.rzyc.service.UserLoginService;
|
2022-09-26 09:22:06 +08:00
|
|
|
import com.rzyc.bean.user.dto.WeChartLoginDto;
|
|
|
|
|
import com.rzyc.model.ent.SysEnterprise;
|
|
|
|
|
import com.rzyc.model.user.SysUser;
|
2022-09-16 15:07:17 +08:00
|
|
|
import io.swagger.annotations.Api;
|
2022-09-30 09:41:48 +08:00
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
2022-09-16 15:07:17 +08:00
|
|
|
import io.swagger.annotations.ApiOperation;
|
2022-11-07 17:47:41 +08:00
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
2022-09-30 09:41:48 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2022-11-07 17:47:41 +08:00
|
|
|
import org.springframework.context.annotation.Bean;
|
2022-09-30 09:41:48 +08:00
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
2022-10-12 17:32:06 +08:00
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
2022-09-16 15:07:17 +08:00
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
2022-09-26 09:22:06 +08:00
|
|
|
import javax.validation.Valid;
|
2022-10-12 17:32:06 +08:00
|
|
|
import java.util.ArrayList;
|
2022-09-30 09:41:48 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
2022-09-26 09:22:06 +08:00
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
/**
|
|
|
|
|
* 个人中心系统
|
|
|
|
|
* @author dong
|
2022-10-11 17:35:01 +08:00
|
|
|
* @author Xuwanxin
|
2022-09-16 15:07:17 +08:00
|
|
|
* @date 2022-09-16 14:19
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
*/
|
|
|
|
|
@Api(tags = "个人中心系统")
|
|
|
|
|
@CrossOrigin("*")
|
|
|
|
|
@RequestMapping("personal")
|
|
|
|
|
@RestController
|
|
|
|
|
@Validated
|
|
|
|
|
public class PersonalController extends BaseController{
|
|
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
UserLoginService userLoginService;
|
|
|
|
|
|
|
|
|
|
PcBusinessService pcBusinessService;
|
|
|
|
|
|
2022-10-17 17:40:17 +08:00
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
2022-10-18 11:36:52 +08:00
|
|
|
@Autowired
|
|
|
|
|
public PersonalController(UserLoginService userLoginService, PcBusinessService pcBusinessService, RedisUtil redisUtil) {
|
|
|
|
|
this.userLoginService = userLoginService;
|
|
|
|
|
this.pcBusinessService = pcBusinessService;
|
|
|
|
|
this.redisUtil = redisUtil;
|
|
|
|
|
}
|
2022-10-17 17:40:17 +08:00
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
/**
|
|
|
|
|
* 用户登录
|
|
|
|
|
* @version v1.0
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "用户登录", notes = "用户登录")
|
|
|
|
|
@PostMapping(value = "/login")
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<EntUser> login(@Valid LoginDto loginDto)throws Exception{
|
|
|
|
|
SingleResult<EntUser> result = new SingleResult<>();
|
2022-09-30 09:41:48 +08:00
|
|
|
|
|
|
|
|
String generateCode = request.getSession().getAttribute(constantsConfigure.getGenerateCodeKey())+"";
|
|
|
|
|
//验证码只能使用一次
|
|
|
|
|
request.getSession().removeAttribute(constantsConfigure.getGenerateCodeKey());
|
|
|
|
|
|
|
|
|
|
if(loginDto.getGenerateCode().equals(generateCode)) {
|
2022-11-07 17:47:41 +08:00
|
|
|
EntUser loginResult = userLoginService.login(loginDto.sysusername, loginDto.getSyspassword());
|
2022-09-30 09:41:48 +08:00
|
|
|
if (Objects.isNull(loginResult)) {
|
|
|
|
|
result.setCode(Code.PASSWORD_OR_ACCOUNT_ERROR.getCode());
|
|
|
|
|
result.setMessage(Message.PASSWORD_OR_ACCOUNT_ERROR);
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("登陆成功");
|
|
|
|
|
result.setData(loginResult);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
result.setCode(Code.CODE_ERROT.getCode());
|
|
|
|
|
result.setMessage(Message.CODE_ERROT);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-14 17:51:04 +08:00
|
|
|
/**
|
|
|
|
|
* 小程序用户登录
|
|
|
|
|
* @version v1.0
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "小程序用户登录", notes = "小程序用户登录")
|
|
|
|
|
@PostMapping(value = "/appLogin")
|
|
|
|
|
public SingleResult<EntUser> appLogin(@Valid AppLoginDto appLoginDto)throws Exception{
|
|
|
|
|
SingleResult<EntUser> result = new SingleResult<>();
|
|
|
|
|
if(null != appLoginDto.sysusername && null != appLoginDto.getSyspassword()) {
|
|
|
|
|
EntUser loginResult = userLoginService.login(appLoginDto.sysusername, appLoginDto.getSyspassword());
|
|
|
|
|
if (Objects.isNull(loginResult)) {
|
|
|
|
|
result.setCode(Code.PASSWORD_OR_ACCOUNT_ERROR.getCode());
|
|
|
|
|
result.setMessage(Message.PASSWORD_OR_ACCOUNT_ERROR);
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("登陆成功");
|
|
|
|
|
result.setData(loginResult);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
result.setCode(Code.CODE_ERROT.getCode());
|
|
|
|
|
result.setMessage(Message.CODE_ERROT);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-07 17:47:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
/**
|
2022-09-26 09:22:06 +08:00
|
|
|
* 企业登录
|
|
|
|
|
* @param loginDto
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
2022-09-16 15:07:17 +08:00
|
|
|
*/
|
2022-09-26 09:22:06 +08:00
|
|
|
@ApiOperation(value = "企业登录", notes = "企业登录")
|
|
|
|
|
@PostMapping(value = "/entlogin")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<SysUser> applogin(@Valid WeChartLoginDto loginDto)throws Exception{
|
|
|
|
|
SingleResult<SysUser> result = new SingleResult<>();
|
|
|
|
|
System.out.println("loginDto -> "+JSONArray.toJSONString(loginDto));
|
|
|
|
|
String sysusername = loginDto.getSysusername();
|
|
|
|
|
String syspassword = loginDto.getSyspassword();
|
|
|
|
|
System.out.println("sessionid -> "+request.getSession().getId());
|
|
|
|
|
SysUser sysUser = sysUserMapper.findBySysUserName(sysusername);
|
|
|
|
|
if(null != sysUser && StringUtils.isNotBlank(sysUser.getUsertype())){
|
|
|
|
|
if("企业用户".equals(sysUser)){
|
|
|
|
|
//如果企业被禁用 直接返回登录失败
|
|
|
|
|
SysEnterprise sysEnterprise = sysEnterpriseMapper.selectByPrimaryKey(sysUser.getSysunitorentid());
|
|
|
|
|
if(null == sysEnterprise){
|
|
|
|
|
result.setCode(Code.TOKEN_EXPIRE.getCode());
|
|
|
|
|
result.setMessage(Message.TOKEN_EXPIRE);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String ps = PasswdFactory.encryptPasswd(sysUser.getSysuserid(), sysusername, syspassword);
|
|
|
|
|
if(sysUser.getSyspassword().equals(ps) || "guest".equals(sysUser.getUsertype())){
|
|
|
|
|
sysUser.setSyspassword("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sysUser.setSyspassword("");
|
|
|
|
|
|
|
|
|
|
//获取职务
|
|
|
|
|
sysUser = getUserDuty(sysUser);
|
|
|
|
|
|
|
|
|
|
// if(StringUtils.isNotBlank())
|
|
|
|
|
|
|
|
|
|
//通过角色判断是否为安办 或者 部门管理员
|
|
|
|
|
if(StringUtils.isNotBlank(sysUser.getUserroles())){
|
|
|
|
|
Integer userRole = this.getUserRole(sysUser.getUserroles());
|
|
|
|
|
sysUser.setUserRole(userRole);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户权限
|
|
|
|
|
userAuth(sysUser);
|
|
|
|
|
|
|
|
|
|
this.addLogAuth(sysUser.getSysuserid(),"登录","成功","");
|
|
|
|
|
String userToken = JwtUtil.createToken(sysUser.getSysuserid());
|
|
|
|
|
sysUser.setUserToken(userToken);
|
|
|
|
|
result.setData(sysUser);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.addLogAuth(sysUser.getSysuserid(),"登录","失败","");
|
|
|
|
|
result.setCode(Code.PASSWORD_ERROR.getCode());
|
|
|
|
|
result.setMessage(Message.PASSWORD_ERROR);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
result.setCode(Code.PASSWORD_ERROR.getCode());
|
|
|
|
|
result.setMessage(Message.PASSWORD_ERROR);
|
|
|
|
|
}
|
2022-09-16 15:07:17 +08:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业用户组织树
|
|
|
|
|
* @param enterpriseId 企业id
|
|
|
|
|
* @param postId 企业用户id
|
|
|
|
|
* @return 企业用户树
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户组织树", notes = "企业用户组织树")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "postId", value = "企业用户岗位id",required = false, dataType = "string"),
|
|
|
|
|
})
|
2022-10-08 17:33:31 +08:00
|
|
|
@GetMapping(value = "/entUserTree")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserTree','entUserTree:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserTree","entUserTree:update"},name = "企业用户组织树")
|
2022-09-30 09:41:48 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<List<EntPost>> entUserTree(@RequestParam(required = true) String enterpriseId, String postId)throws Exception{
|
2022-09-30 09:41:48 +08:00
|
|
|
return pcBusinessService.entUserTree(enterpriseId,postId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-10-08 17:33:31 +08:00
|
|
|
/**
|
|
|
|
|
* 企业用户工作要务
|
2022-10-11 17:35:01 +08:00
|
|
|
* @param entUserPostListDto 企业用户工作要务
|
2022-10-08 17:33:31 +08:00
|
|
|
* @return 企业用户工作要务
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户工作要务", notes = "企业用户工作要务")
|
2022-11-07 17:47:41 +08:00
|
|
|
@PostMapping(value = "/entUserPostList")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserPostList','entUserPostList:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserPostList","entUserPostList:update"},name = "企业用户工作要务")
|
2022-10-08 17:33:31 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<List<EntPostList>> entUserPostList(@RequestBody EntUserPostListDto entUserPostListDto)throws Exception{
|
2022-11-08 18:09:46 +08:00
|
|
|
SingleResult singleResult = new SingleResult();
|
2022-11-07 17:47:41 +08:00
|
|
|
singleResult.setData(pcBusinessService.entUserPostList(entUserPostListDto));
|
|
|
|
|
return singleResult;
|
2022-10-08 17:33:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业用户工作清单
|
|
|
|
|
* @return 企业用户工作清单
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2022-11-07 17:47:41 +08:00
|
|
|
@ApiOperation(value = "企业用户日常工作清单", notes = "企业用户日常工作清单")
|
|
|
|
|
@PostMapping(value = "/entUserPostTask")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserPostTask','entUserPostTask:update')")
|
2022-11-07 17:47:41 +08:00
|
|
|
@MethodAnnotation(authorizations = {"entUserPostTask","entUserPostTask:update"},name = "企业用户日常工作清单")
|
2022-10-08 17:33:31 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<List<EntPostTask>> entUserPostTask(@RequestBody EntUserPostTaskDto entUserPostTaskDto)throws Exception{
|
2022-11-08 18:09:46 +08:00
|
|
|
SingleResult singleResult = new SingleResult();
|
2022-11-07 17:47:41 +08:00
|
|
|
singleResult.setData(pcBusinessService.entUserPostTask(entUserPostTaskDto));
|
|
|
|
|
return singleResult;
|
2022-10-08 17:33:31 +08:00
|
|
|
}
|
|
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
|
2022-10-09 17:33:16 +08:00
|
|
|
/**
|
|
|
|
|
* 企业用户岗位职责
|
2022-10-11 17:35:01 +08:00
|
|
|
* @param entUserPostDutyDto 企业用户岗位职责参数对象
|
2022-10-09 17:33:16 +08:00
|
|
|
* @return 企业用户岗位职责
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户岗位职责", notes = "企业用户岗位职责")
|
2022-11-07 17:47:41 +08:00
|
|
|
@PostMapping(value = "/entUserPostDuty")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserPostDuty','entUserPostDuty:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserPostDuty","entUserPostDuty:update"},name = "企业用户岗位职责")
|
2022-10-09 17:33:16 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<List<EntPostDuty>> entUserPostDuty(@RequestBody EntUserPostDutyDto entUserPostDutyDto)throws Exception{
|
2022-11-08 18:09:46 +08:00
|
|
|
SingleResult singleResult = new SingleResult();
|
2022-11-07 17:47:41 +08:00
|
|
|
singleResult.setData(pcBusinessService.entUserPostDuty(entUserPostDutyDto));
|
|
|
|
|
return singleResult;
|
2022-10-09 17:33:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业用户证照表
|
|
|
|
|
* @param entUserId 企业用户id
|
|
|
|
|
* @return 企业用户证照表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户证照表", notes = "企业用户证照表")
|
|
|
|
|
@ApiImplicitParams({
|
2022-11-18 17:44:17 +08:00
|
|
|
@ApiImplicitParam(name = "entUserId", value = "企业用户id",required = false, dataType = "string"),
|
2022-10-11 17:35:01 +08:00
|
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"),
|
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
|
2022-11-17 18:06:12 +08:00
|
|
|
@ApiImplicitParam(name = "credentialState", value = "证件过期 1.未过期 2.已超时",required = false, dataType = "int"),
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
|
2022-10-09 17:33:16 +08:00
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entUserCredential")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表")
|
2022-10-09 17:33:16 +08:00
|
|
|
@ResponseBody
|
2022-11-17 18:06:12 +08:00
|
|
|
public SingleResult<List<EntUserCredential>> entUserCredential(@RequestParam(required = true) String entUserId, @RequestParam(required = true) Integer page, @RequestParam(required = true)Integer pageSize,Integer credentialState,String enterpriseId)throws Exception{
|
|
|
|
|
return pcBusinessService.entUserCredential(enterpriseId,entUserId,page,pageSize,credentialState);
|
2022-10-09 17:33:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业用户证照表-新增,修改
|
|
|
|
|
* @param entUserCredentialUpdateDto 企业用户证件对象
|
|
|
|
|
* @return 成功或失败
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户证照表-新增,修改", notes = "企业用户证照表-新增,修改")
|
|
|
|
|
@PostMapping(value = "/entUserCredentialUpdate")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserCredentialUpdate:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserCredentialUpdate:update"},name = "企业用户证照表-新增,修改")
|
2022-10-09 17:33:16 +08:00
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult entUserCredentialUpdate(@RequestBody EntUserCredentialUpdateDto entUserCredentialUpdateDto)throws Exception{
|
2022-11-07 17:47:41 +08:00
|
|
|
List<EntUserCredentialUpdateDto>entUserCredentialUpdateDtoList= new ArrayList<>();
|
|
|
|
|
entUserCredentialUpdateDtoList.add(entUserCredentialUpdateDto);
|
|
|
|
|
return pcBusinessService.entUserCredentialUpdate(entUserCredentialUpdateDtoList);
|
2022-10-09 17:33:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业用户证照表-删除
|
|
|
|
|
* @param credentialId 企业用户证件表删除
|
|
|
|
|
* @return 成功或失败
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业用户证照表-删除", notes = "企业用户证照表-删除")
|
|
|
|
|
@ApiImplicitParams({
|
2022-10-10 15:57:14 +08:00
|
|
|
@ApiImplicitParam(name = "credentialId", value = "证件照id",required = true, dataType = "string"),
|
2022-10-09 17:33:16 +08:00
|
|
|
})
|
|
|
|
|
@PostMapping(value = "/entUserCredentialDelete")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserCredentialDelete')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserCredentialDelete"},name = "企业用户证照表-删除")
|
2022-10-09 17:33:16 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult entUserCredentialDelete(@RequestParam(required = true) String credentialId)throws Exception{
|
2022-10-09 17:33:16 +08:00
|
|
|
return pcBusinessService.entUserCredentialDelete(credentialId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-11-07 17:47:41 +08:00
|
|
|
* 企业岗位人员总体信息列表
|
2022-10-09 17:33:16 +08:00
|
|
|
* @param keyContent
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2022-11-07 17:47:41 +08:00
|
|
|
@ApiOperation(value = "企业岗位人员总体信息列表", notes = "企业岗位人员总体信息列表")
|
2022-10-10 15:57:14 +08:00
|
|
|
@ApiImplicitParams({
|
2022-11-14 17:51:04 +08:00
|
|
|
@ApiImplicitParam(name = "keyContent", value = "搜索关键字",required = false, dataType = "string"),
|
2022-10-11 17:35:01 +08:00
|
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"),
|
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
|
2022-11-14 17:51:04 +08:00
|
|
|
@ApiImplicitParam(name = "postId", value = "岗位id",required = false, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
|
2022-10-10 15:57:14 +08:00
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entUserList")
|
2022-10-11 15:21:09 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')")
|
2022-11-07 17:47:41 +08:00
|
|
|
@MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位人员总体信息列表")
|
2022-10-10 15:57:14 +08:00
|
|
|
@ResponseBody
|
2022-11-14 17:51:04 +08:00
|
|
|
public SingleResult<List<EntUser>> entUserList(@RequestParam(required = false) String keyContent,
|
2022-11-07 17:47:41 +08:00
|
|
|
@RequestParam(required = false) String postId,
|
2022-11-18 17:44:17 +08:00
|
|
|
@RequestParam(required = true) Integer page,
|
|
|
|
|
@RequestParam(required = true) Integer pageSize,
|
|
|
|
|
@RequestParam(required = false) String enterpriseId,
|
|
|
|
|
@RequestParam(required = false) Integer userType)throws Exception{
|
|
|
|
|
return pcBusinessService.entUserList(keyContent,page,pageSize,postId,enterpriseId,userType);
|
2022-10-10 15:57:14 +08:00
|
|
|
}
|
2022-10-09 17:33:16 +08:00
|
|
|
|
|
|
|
|
|
2022-11-18 17:44:17 +08:00
|
|
|
/**
|
|
|
|
|
* 企业岗位人员不分页
|
|
|
|
|
* @param name
|
|
|
|
|
* @param enterpriseId
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业岗位人员不分页", notes = "企业岗位人员不分页")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "name", value = "姓名",required = false, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = false, dataType = "string"),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entUserListNoPage")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位人员不分页")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<List<EntUser>> entUserList(@RequestParam(required = false) String name,
|
|
|
|
|
@RequestParam(required = true) String enterpriseId)throws Exception{
|
|
|
|
|
return pcBusinessService.entUserListNoPage(name,enterpriseId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-17 17:40:17 +08:00
|
|
|
/**
|
2022-10-11 17:35:01 +08:00
|
|
|
* 新增和修改公司岗位人员
|
|
|
|
|
* @param addOrUpdateEntUserDto
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "新增和修改公司岗位人员", notes = "新增和修改公司岗位人员")
|
|
|
|
|
@PostMapping(value = "/addOrUpdateEntUser")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('addOrUpdateEntUser:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"addOrUpdateEntUser:update"},name = "新增和修改公司岗位人员")
|
|
|
|
|
@ResponseBody
|
2022-10-12 17:32:06 +08:00
|
|
|
@Transactional(rollbackFor = Exception.class)
|
2022-11-08 18:09:46 +08:00
|
|
|
public SingleResult addOrUpdateEntUser(@RequestBody @Valid AddOrUpdateEntUserDto addOrUpdateEntUserDto)throws Exception{
|
2022-10-11 17:35:01 +08:00
|
|
|
return pcBusinessService.addOrUpdateEntUser(addOrUpdateEntUserDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
|
2022-11-18 17:44:17 +08:00
|
|
|
|
|
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
/**
|
|
|
|
|
* 手动企业分配任务
|
|
|
|
|
* @param listDto
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "手动企业分配任务", notes = "手动企业分配任务")
|
|
|
|
|
@PostMapping(value = "/manualAssignmentTask")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entUserPostTask:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserPostTask:update"},name = "手动企业分配任务")
|
|
|
|
|
@ResponseBody
|
2022-11-11 19:57:18 +08:00
|
|
|
@Transactional
|
|
|
|
|
public SingleResult manualAssignmentTask(@RequestBody@Valid AddOrUpdateEntUserPostListDto listDto)throws Exception{
|
2022-10-31 17:33:15 +08:00
|
|
|
return pcBusinessService.manualAssignmentTask(listDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-19 17:37:21 +08:00
|
|
|
/**
|
|
|
|
|
* 新增和修改公司岗位
|
|
|
|
|
* @param addOrUpdateEntPostDto
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "新增和修改公司岗位", notes = "新增和修改公司岗位")
|
|
|
|
|
@PostMapping(value = "/addOrUpdateEntPost")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('addOrUpdateEntPost:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"addOrUpdateEntPost:update"},name = "新增和修改公司岗位")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult addOrUpdateEntPost(@RequestBody AddOrUpdateEntPostDto addOrUpdateEntPostDto)throws Exception{
|
|
|
|
|
return pcBusinessService.addOrUpdateEntPost(addOrUpdateEntPostDto);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-11 17:35:01 +08:00
|
|
|
|
2022-11-07 17:47:41 +08:00
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
/**
|
2022-11-07 17:47:41 +08:00
|
|
|
* 企业清单(类型)分组查询
|
|
|
|
|
* @param enterpriseId
|
2022-10-31 17:33:15 +08:00
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2022-11-07 17:47:41 +08:00
|
|
|
@ApiOperation(value = "企业清单(类型)分组查询", notes = "企业清单(类型)分组查询")
|
2022-10-31 17:33:15 +08:00
|
|
|
@ApiImplicitParams({
|
2022-11-07 17:47:41 +08:00
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "listId", value = "清单id",required = false, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "userId", value = "用户id",required = true, dataType = "string"),
|
2022-10-31 17:33:15 +08:00
|
|
|
})
|
2022-11-07 17:47:41 +08:00
|
|
|
@GetMapping(value = "/entListGroupByListId")
|
2022-11-11 19:57:18 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entListGroupByListId','entListGroupByListId:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entListGroupByListId","entListGroupByListId:update"},name = "企业清单(类型)分组查询")
|
2022-10-31 17:33:15 +08:00
|
|
|
@ResponseBody
|
2022-11-07 17:47:41 +08:00
|
|
|
public SingleResult<List<EntPostList>> entListGroupByListId(@RequestParam(required = true) String enterpriseId,
|
|
|
|
|
String listId,
|
2022-11-21 17:38:49 +08:00
|
|
|
String userId)throws Exception{
|
2022-11-07 17:47:41 +08:00
|
|
|
return pcBusinessService.entListGroupByListId(enterpriseId,listId,userId);
|
2022-10-31 17:33:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-08 18:09:46 +08:00
|
|
|
/**
|
|
|
|
|
* 人员类型列表
|
|
|
|
|
* @return list
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "人员类型列表", notes = "人员类型列表")
|
|
|
|
|
@GetMapping(value = "/entUserTypeList")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entUserTypeList')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entUserTypeList"},name = "人员类型列表")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<List<EntPostList>> entListGroupByListId()throws Exception{
|
|
|
|
|
return pcBusinessService.entUserTypeList();
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
|
2022-10-11 17:35:01 +08:00
|
|
|
|
2022-10-09 17:33:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-30 09:41:48 +08:00
|
|
|
|
|
|
|
|
|
2022-10-17 17:40:17 +08:00
|
|
|
|
2022-11-07 17:47:41 +08:00
|
|
|
|
2022-11-11 19:57:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
}
|