企业端新增和修改用户

spring security 权限扫描工具优化
This commit is contained in:
79493 2022-10-11 17:35:01 +08:00
parent 784d5f92d8
commit 1fc3871eaa
11 changed files with 461 additions and 55 deletions

View File

@ -36,4 +36,10 @@ public interface EntUserMapper extends BaseMapper<EntUser> {
List<EntUser>selectEntUserList(@Param("keyContent") String keyContent,@Param("page")Integer page,@Param("pageSize")Integer pageSize); List<EntUser>selectEntUserList(@Param("keyContent") String keyContent,@Param("page")Integer page,@Param("pageSize")Integer pageSize);
/**
* 修改企业用户
* @param entUser 关键字
* @return int 成功或失败
* */
int updateEntUser(@Param("entUser") EntUser entUser);
} }

View File

@ -0,0 +1,114 @@
package com.rzyc.model.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 企业用户新增和修改Dto
* @author Xuwanxin
* @date 2022/10/11
* */
@ApiModel(value="企业用户新增和修改Dto", description="企业用户新增和修改Dto")
public class AddOrUpdateEntUserDto {
@NotNull
@ApiModelProperty(value = "岗位id")
private String postId;
@NotNull
@ApiModelProperty(value = "企业id")
private String enterpriseId;
@NotNull
@ApiModelProperty(value = "姓名")
private String name;
@NotNull
@ApiModelProperty(value = "电话")
private String mobile;
@NotNull
@ApiModelProperty(value = "人员类型")
private Integer userType;
@NotNull
@ApiModelProperty(value = "年龄")
private Integer age;
@NotNull
@ApiModelProperty(value = "从业时间")
private Date workTime;
@NotNull
@ApiModelProperty(value = "从业时间")
private String jobNumber;
public String getPostId() {
return postId;
}
public void setPostId(String postId) {
this.postId = postId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Integer getUserType() {
return userType;
}
public void setUserType(Integer userType) {
this.userType = userType;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Date getWorkTime() {
return workTime;
}
public void setWorkTime(Date workTime) {
this.workTime = workTime;
}
public String getJobNumber() {
return jobNumber;
}
public void setJobNumber(String jobNumber) {
this.jobNumber = jobNumber;
}
}

View File

@ -7,36 +7,43 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
/** /**
* 企业用户证件照Dto * 企业用户证件照Dto
* @author Xuwanxin * @author Xuwanxin
* @date 2022/10/10
* */ * */
@ApiModel(value="企业用户证件Dto", description="企业用户证件Dto")
@ApiModel(value="企业用户证件对象", description="企业用户证件对象")
public class EntUserCredentialUpdateDto { public class EntUserCredentialUpdateDto {
@NotNull
@ApiModelProperty(value = "企业用户证照表id") @ApiModelProperty(value = "企业用户证照表id")
private String credentialId; private String credentialId;
@NotNull
@ApiModelProperty(value = "证照名") @ApiModelProperty(value = "证照名")
private String credentialName; private String credentialName;
@NotNull
@ApiModelProperty(value = "证照状态 1.未超时 2.已超时") @ApiModelProperty(value = "证照状态 1.未超时 2.已超时")
private Integer credentialState; private Integer credentialState;
@NotNull
@ApiModelProperty(value = "证照地址") @ApiModelProperty(value = "证照地址")
private String credentialImageAddress; private String credentialImageAddress;
@NotNull
@ApiModelProperty(value = "企业用户id") @ApiModelProperty(value = "企业用户id")
private String entUserId; private String entUserId;
@NotNull
@ApiModelProperty(value = "证照起始时间") @ApiModelProperty(value = "证照起始时间")
private Date credentialStartTime; private Date credentialStartTime;
@NotNull
@ApiModelProperty(value = "证照结束时间") @ApiModelProperty(value = "证照结束时间")
private Date credentialEndTime; private Date credentialEndTime;

View File

@ -0,0 +1,64 @@
package com.rzyc.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* 企业用户证件照Dto
* @author Xuwanxin
* @date 2022/10/11
* */
@ApiModel(value="企业用户岗位职责Dto", description="企业用户岗位职责Dto")
public class EntUserPostDutyDto {
@NotNull
@ApiModelProperty(value = "企业id")
private String enterpriseId;
@NotNull
@ApiModelProperty(value = "岗位id")
private String postId;
@NotNull
@ApiModelProperty(value = "页码")
private Integer page;
@NotNull
@ApiModelProperty(value = "条数")
private Integer pageSize;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getPostId() {
return postId;
}
public void setPostId(String postId) {
this.postId = postId;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}

View File

@ -0,0 +1,75 @@
package com.rzyc.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* 企业用户岗位要务Dto
* @author Xuwanxin
* @date 2022/10/11
* */
@ApiModel(value = "企业用户岗位要务Dto",description = "企业用户岗位要务Dto")
public class EntUserPostListDto {
@NotNull
@ApiModelProperty(value = "企业id")
String enterpriseId;
@NotNull
@ApiModelProperty(value = "企业用户id")
String entUserId;
@ApiModelProperty(value = "岗位id")
String postId;
@NotNull
@ApiModelProperty(value = "页码")
Integer page;
@NotNull
@ApiModelProperty(value = "条数")
Integer pageSize;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEntUserId() {
return entUserId;
}
public void setEntUserId(String entUserId) {
this.entUserId = entUserId;
}
public String getPostId() {
return postId;
}
public void setPostId(String postId) {
this.postId = postId;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}

View File

@ -0,0 +1,112 @@
package com.rzyc.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* 企业用户工作清单Dto
* @author Xuwanxin
* @date 2022/10/11
* */
@ApiModel(value="企业用户工作清单Dto", description="企业用户工作清单Dto")
public class EntUserPostTaskDto {
@NotNull
@ApiModelProperty(value = "企业id")
String enterpriseId;
@NotNull
@ApiModelProperty(value = "企业用户id")
String entUserId;
@ApiModelProperty(value = "岗位id")
String postId;
@ApiModelProperty(value = "清单id")
String listId;
@ApiModelProperty(value = "模糊内容")
String content;
@NotNull
@ApiModelProperty(value = "任务状态")
Integer taskState;
@NotNull
@ApiModelProperty(value = "页码")
Integer page;
@NotNull
@ApiModelProperty(value = "条数")
Integer pageSize;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEntUserId() {
return entUserId;
}
public void setEntUserId(String entUserId) {
this.entUserId = entUserId;
}
public String getPostId() {
return postId;
}
public void setPostId(String postId) {
this.postId = postId;
}
public String getListId() {
return listId;
}
public void setListId(String listId) {
this.listId = listId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Integer getTaskState() {
return taskState;
}
public void setTaskState(Integer taskState) {
this.taskState = taskState;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}

View File

@ -68,6 +68,11 @@
limit #{page},#{pageSize} limit #{page},#{pageSize}
</select> </select>
<update id="updateEntUser" parameterType="com.rzyc.model.ent.EntUser">
update ent_user (post_id,enterprise_id,name,mobile,user_type,age,work_time,passwd,post_path,post_path_name,job_number,modify_time,modify_by)
values(entUser.postId,entUser.enterpriseId,entUser.name,entUser.mobile,entUser.userType,entUser.age,entUser.workTime,entUser.passwd,entUser.postPath,entUser.postPathName,entUser.jobNumber,entUser.modifyTime,entUser.modifyBy)
</update>

View File

@ -9,7 +9,7 @@ import com.common.utils.jwt.JwtUtil;
import com.common.utils.model.SingleResult; import com.common.utils.model.SingleResult;
import com.rzyc.bean.user.dto.LoginDto; import com.rzyc.bean.user.dto.LoginDto;
import com.rzyc.config.MethodAnnotation; import com.rzyc.config.MethodAnnotation;
import com.rzyc.model.dto.EntUserCredentialUpdateDto; import com.rzyc.model.dto.*;
import com.rzyc.model.ent.EntUser; import com.rzyc.model.ent.EntUser;
import com.rzyc.service.PcBusinessService; import com.rzyc.service.PcBusinessService;
import com.rzyc.service.UserLoginService; import com.rzyc.service.UserLoginService;
@ -25,6 +25,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -32,6 +33,7 @@ import java.util.Objects;
/** /**
* 个人中心系统 * 个人中心系统
* @author dong * @author dong
* @author Xuwanxin
* @date 2022-09-16 14:19 * @date 2022-09-16 14:19
* @Version V1.0 * @Version V1.0
*/ */
@ -160,81 +162,55 @@ public class PersonalController extends BaseController{
@PreAuthorize("hasAnyAuthority('entUserTree','entUserTree:update')") @PreAuthorize("hasAnyAuthority('entUserTree','entUserTree:update')")
@MethodAnnotation(authorizations = {"entUserTree","entUserTree:update"},name = "企业用户组织树") @MethodAnnotation(authorizations = {"entUserTree","entUserTree:update"},name = "企业用户组织树")
@ResponseBody @ResponseBody
public SingleResult<List<EntUser>> entUserTree(String enterpriseId, String postId)throws Exception{ public SingleResult<List<EntUser>> entUserTree(@NotNull(message = "公司id不能为null") String enterpriseId, String postId)throws Exception{
return pcBusinessService.entUserTree(enterpriseId,postId); return pcBusinessService.entUserTree(enterpriseId,postId);
} }
/** /**
* 企业用户工作要务 * 企业用户工作要务
* @param enterpriseId 企业id * @param entUserPostListDto 企业用户工作要务
* @param entUserId 企业用户id
* @param postId 企业用户岗位id
* @return 企业用户工作要务 * @return 企业用户工作要务
* @throws Exception * @throws Exception
*/ */
@ApiOperation(value = "企业用户工作要务", notes = "企业用户工作要务") @ApiOperation(value = "企业用户工作要务", notes = "企业用户工作要务")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
@ApiImplicitParam(name = "entUserId", value = "企业用户id", required = true, dataType = "string"),
@ApiImplicitParam(name = "postId", value = "企业用户岗位id",required = false, dataType = "string"),
})
@GetMapping(value = "/entUserPostList") @GetMapping(value = "/entUserPostList")
@PreAuthorize("hasAnyAuthority('entUserPostList','entUserPostList:update')") @PreAuthorize("hasAnyAuthority('entUserPostList','entUserPostList:update')")
@MethodAnnotation(authorizations = {"entUserPostList","entUserPostList:update"},name = "企业用户工作要务") @MethodAnnotation(authorizations = {"entUserPostList","entUserPostList:update"},name = "企业用户工作要务")
@ResponseBody @ResponseBody
public SingleResult entUserPostList(String enterpriseId, String entUserId,String postId,Integer page,Integer pageSize)throws Exception{ public SingleResult entUserPostList(@RequestBody EntUserPostListDto entUserPostListDto)throws Exception{
return pcBusinessService.entUserPostList(enterpriseId,entUserId,postId,page,pageSize); return pcBusinessService.entUserPostList(entUserPostListDto);
} }
/** /**
* 企业用户工作清单 * 企业用户工作清单
* @param enterpriseId 企业id
* @param postId 岗位id
* @param listId 清单id
* @param entUserId 企业用户id
* @return 企业用户工作清单 * @return 企业用户工作清单
* @throws Exception * @throws Exception
*/ */
@ApiOperation(value = "企业用户工作清单", notes = "企业用户工作清单") @ApiOperation(value = "企业用户工作清单", notes = "企业用户工作清单")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
@ApiImplicitParam(name = "entUserId", value = "企业用户id", required = true, dataType = "string"),
@ApiImplicitParam(name = "postId", value = "企业用户岗位id",required = false, dataType = "string"),
@ApiImplicitParam(name = "listId", value = "清单类型Id", required = false, dataType = "string"),
@ApiImplicitParam(name = "content", value = "内容模糊搜索", required = false, dataType = "string"),
@ApiImplicitParam(name = "taskState", value = "任务状态 1、进行中 2、已完成 3、已超期", required = false, dataType = "int"),
})
@GetMapping(value = "/entUserPostTask") @GetMapping(value = "/entUserPostTask")
@PreAuthorize("hasAnyAuthority('entUserPostTask','entUserPostTask:update')") @PreAuthorize("hasAnyAuthority('entUserPostTask','entUserPostTask:update')")
@MethodAnnotation(authorizations = {"entUserPostTask","entUserPostTask:update"},name = "企业用户工作清单") @MethodAnnotation(authorizations = {"entUserPostTask","entUserPostTask:update"},name = "企业用户工作清单")
@ResponseBody @ResponseBody
public SingleResult entUserPostTask(String enterpriseId, String entUserId,String postId,String listId,String content,Integer taskState,Integer page,Integer pageSize)throws Exception{ public SingleResult entUserPostTask(@RequestBody EntUserPostTaskDto entUserPostTaskDto)throws Exception{
return pcBusinessService.entUserPostTask(enterpriseId,entUserId,postId,listId,content,taskState,page,pageSize); return pcBusinessService.entUserPostTask(entUserPostTaskDto);
} }
/** /**
* 企业用户岗位职责 * 企业用户岗位职责
* @param enterpriseId 企业id * @param entUserPostDutyDto 企业用户岗位职责参数对象
* @param postId 岗位id
* @return 企业用户岗位职责 * @return 企业用户岗位职责
* @throws Exception * @throws Exception
*/ */
@ApiOperation(value = "企业用户岗位职责", notes = "企业用户岗位职责") @ApiOperation(value = "企业用户岗位职责", notes = "企业用户岗位职责")
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
@ApiImplicitParam(name = "postId", value = "企业用户岗位id",required = true, dataType = "string"),
})
@GetMapping(value = "/entUserPostDuty") @GetMapping(value = "/entUserPostDuty")
@PreAuthorize("hasAnyAuthority('entUserPostDuty','entUserPostDuty:update')") @PreAuthorize("hasAnyAuthority('entUserPostDuty','entUserPostDuty:update')")
@MethodAnnotation(authorizations = {"entUserPostDuty","entUserPostDuty:update"},name = "企业用户岗位职责") @MethodAnnotation(authorizations = {"entUserPostDuty","entUserPostDuty:update"},name = "企业用户岗位职责")
@ResponseBody @ResponseBody
public SingleResult entUserPostDuty(String enterpriseId, String postId,Integer page,Integer pageSize)throws Exception{ public SingleResult entUserPostDuty(@RequestBody EntUserPostDutyDto entUserPostDutyDto)throws Exception{
return pcBusinessService.entUserPostDuty(enterpriseId,postId,page,pageSize); return pcBusinessService.entUserPostDuty(entUserPostDutyDto);
} }
/** /**
@ -246,12 +222,14 @@ public class PersonalController extends BaseController{
@ApiOperation(value = "企业用户证照表", notes = "企业用户证照表") @ApiOperation(value = "企业用户证照表", notes = "企业用户证照表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "entUserId", value = "企业用户id",required = true, dataType = "string"), @ApiImplicitParam(name = "entUserId", value = "企业用户id",required = true, dataType = "string"),
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"),
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
}) })
@GetMapping(value = "/entUserCredential") @GetMapping(value = "/entUserCredential")
@PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')") @PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')")
@MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表") @MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表")
@ResponseBody @ResponseBody
public SingleResult entUserCredential(String entUserId,Integer page,Integer pageSize)throws Exception{ public SingleResult entUserCredential(@NotNull(message = "企业用户id不能为null") String entUserId, @NotNull(message = "页码不能为null") Integer page, @NotNull(message = "条数不能为null")Integer pageSize)throws Exception{
return pcBusinessService.entUserCredential(null,entUserId,page,pageSize); return pcBusinessService.entUserCredential(null,entUserId,page,pageSize);
} }
@ -288,7 +266,7 @@ public class PersonalController extends BaseController{
@PreAuthorize("hasAnyAuthority('entUserCredentialDelete')") @PreAuthorize("hasAnyAuthority('entUserCredentialDelete')")
@MethodAnnotation(authorizations = {"entUserCredentialDelete"},name = "企业用户证照表-删除") @MethodAnnotation(authorizations = {"entUserCredentialDelete"},name = "企业用户证照表-删除")
@ResponseBody @ResponseBody
public SingleResult entUserCredentialDelete(String credentialId)throws Exception{ public SingleResult entUserCredentialDelete(@NotNull(message = "证件照id不能为null") String credentialId)throws Exception{
return pcBusinessService.entUserCredentialDelete(credentialId); return pcBusinessService.entUserCredentialDelete(credentialId);
} }
@ -301,17 +279,39 @@ public class PersonalController extends BaseController{
*/ */
@ApiOperation(value = "企业岗位总体信息列表", notes = "企业岗位总体信息列表") @ApiOperation(value = "企业岗位总体信息列表", notes = "企业岗位总体信息列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "keyContent", value = "搜索关键字",required = false, dataType = "string"), @ApiImplicitParam(name = "keyContent", value = "搜索关键字",required = true, dataType = "string"),
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "int"),
@ApiImplicitParam(name = "pageSize", value = "pageSize",required = true, dataType = "int"),
}) })
@GetMapping(value = "/entUserList") @GetMapping(value = "/entUserList")
@PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')") @PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')")
@MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位总体信息列表") @MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位总体信息列表")
@ResponseBody @ResponseBody
public SingleResult entUserList(String keyContent,Integer page,Integer pageSize)throws Exception{ public SingleResult entUserList(@NotNull(message = "搜索关键字不能为null") String keyContent,
@NotNull(message = "页码不能为null") Integer page,
@NotNull(message = "条数不能为null") Integer pageSize)throws Exception{
return pcBusinessService.entUserList(keyContent,page,pageSize); return pcBusinessService.entUserList(keyContent,page,pageSize);
} }
/**
* 新增和修改公司岗位人员
* @param addOrUpdateEntUserDto
* @return list
* @throws Exception
*/
@ApiOperation(value = "新增和修改公司岗位人员", notes = "新增和修改公司岗位人员")
@PostMapping(value = "/addOrUpdateEntUser")
@PreAuthorize("hasAnyAuthority('addOrUpdateEntUser:update')")
@MethodAnnotation(authorizations = {"addOrUpdateEntUser:update"},name = "新增和修改公司岗位人员")
@ResponseBody
public SingleResult addOrUpdateEntUser(@RequestBody AddOrUpdateEntUserDto addOrUpdateEntUserDto)throws Exception{
return pcBusinessService.addOrUpdateEntUser(addOrUpdateEntUserDto);
}

View File

@ -58,7 +58,7 @@ public class JwtAuthenticationTokenFiler extends OncePerRequestFilter {
List<GrantedAuthority> authority= new ArrayList<GrantedAuthority>(); List<GrantedAuthority> authority= new ArrayList<GrantedAuthority>();
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (AuthorityKey s:authorizations) { for (AuthorityKey s:authorizations) {
stringBuilder.append(s.getCategory() +":"+s.getAuthKey()); stringBuilder.append(s.getAuthKey());
authority.add(new SimpleGrantedAuthority(stringBuilder.toString())); authority.add(new SimpleGrantedAuthority(stringBuilder.toString()));
stringBuilder.setLength(0); stringBuilder.setLength(0);
} }

View File

@ -14,7 +14,7 @@ import com.rzyc.model.EntPostDuty;
import com.rzyc.model.EntPostList; import com.rzyc.model.EntPostList;
import com.rzyc.model.EntPostTask; import com.rzyc.model.EntPostTask;
import com.rzyc.model.EntUserCredential; import com.rzyc.model.EntUserCredential;
import com.rzyc.model.dto.EntUserCredentialUpdateDto; import com.rzyc.model.dto.*;
import com.rzyc.model.ent.EntPost; import com.rzyc.model.ent.EntPost;
import com.rzyc.model.ent.EntUser; import com.rzyc.model.ent.EntUser;
import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.ent.SysEnterprise;
@ -79,29 +79,32 @@ public class PcBusinessService extends BaseController {
} }
public SingleResult entUserPostList(String enterpriseId,String entUserId,String postId,Integer page,Integer pageSize){ public SingleResult entUserPostList(EntUserPostListDto entUserPostListDto){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
page = pageSize * (page - 1); entUserPostListDto.setPage(entUserPostListDto.getPageSize() * (entUserPostListDto.getPage() - 1));
List<EntPostList>list = entPostListMapper.selectEntPostList(enterpriseId,entUserId,postId,page,pageSize); List<EntPostList>list = entPostListMapper.selectEntPostList(entUserPostListDto.getEnterpriseId(),entUserPostListDto.getEntUserId(),
entUserPostListDto.getPostId(),entUserPostListDto.getPage(),entUserPostListDto.getPageSize());
singleResult.setData(list); singleResult.setData(list);
return singleResult; return singleResult;
} }
public SingleResult entUserPostTask(String enterpriseId, String entUserId,String postId,String listId,String content,Integer taskState,Integer page,Integer pageSize){ public SingleResult entUserPostTask(EntUserPostTaskDto entUserPostTaskDto){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
page = pageSize * (page - 1); entUserPostTaskDto.setPage(entUserPostTaskDto.getPageSize() * (entUserPostTaskDto.getPage() - 1));
//EntPostTask //EntPostTask
List<EntPostTask>list = entPostTaskMapper.selectEntUserPostTask(enterpriseId,entUserId,postId,listId,content,taskState,page,pageSize); List<EntPostTask>list = entPostTaskMapper.selectEntUserPostTask(entUserPostTaskDto.getEnterpriseId(),entUserPostTaskDto.getEntUserId(),entUserPostTaskDto.getPostId()
,entUserPostTaskDto.getListId(),entUserPostTaskDto.getContent(),entUserPostTaskDto.getTaskState(),
entUserPostTaskDto.getPage(),entUserPostTaskDto.getPageSize());
singleResult.setData(list); singleResult.setData(list);
return singleResult; return singleResult;
} }
public SingleResult entUserPostDuty(String enterpriseId, String postId,Integer page,Integer pageSize){ public SingleResult entUserPostDuty(EntUserPostDutyDto entUserPostDutyDto){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
page = pageSize * (page - 1); entUserPostDutyDto.setPage( entUserPostDutyDto.getPageSize() * (entUserPostDutyDto.getPage() - 1));
//EntPostDuty //EntPostDuty
List<EntPostDuty>list = entPostDutyMapper.selectEntUserPostDuty(enterpriseId,postId,page,pageSize); List<EntPostDuty>list = entPostDutyMapper.selectEntUserPostDuty(entUserPostDutyDto.getEnterpriseId(),entUserPostDutyDto.getPostId(),entUserPostDutyDto.getPage(),entUserPostDutyDto.getPageSize());
singleResult.setData(list); singleResult.setData(list);
return singleResult; return singleResult;
} }
@ -162,6 +165,26 @@ public class PcBusinessService extends BaseController {
return singleResult; return singleResult;
} }
public SingleResult addOrUpdateEntUser(AddOrUpdateEntUserDto addOrUpdateEntUserDto){
SingleResult singleResult = new SingleResult();
EntUser entUser = new EntUser();
BeanUtils.copyProperties(addOrUpdateEntUserDto,entUser);
EntPost entPost = entPostMapper.selectById(addOrUpdateEntUserDto.getPostId());
entUser.setPostPath(entPost.getPostPath());
entUser.setPostPathName(entPost.getPostId());
int result = 0 ;
if (StringUtils.isNotBlank(entUser.getEntUserId())){
result = entUserMapper.updateEntUser(entUser);
}else {
result = entUserMapper.insert(entUser);
}
if (result != 1){
singleResult.setCode(Code.ERROR.getCode());
singleResult.setMessage(Message.ERROR);
}
return singleResult;
}

View File

@ -57,7 +57,7 @@ public class JwtAuthenticationTokenFiler extends OncePerRequestFilter {
List<GrantedAuthority> authority= new ArrayList<GrantedAuthority>(); List<GrantedAuthority> authority= new ArrayList<GrantedAuthority>();
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (AuthorityKey s:authorizations) { for (AuthorityKey s:authorizations) {
stringBuilder.append(s.getCategory() +":"+s.getAuthKey()); stringBuilder.append(s.getAuthKey());
authority.add(new SimpleGrantedAuthority(stringBuilder.toString())); authority.add(new SimpleGrantedAuthority(stringBuilder.toString()));
stringBuilder.setLength(0); stringBuilder.setLength(0);
} }