From 1fc3871eaa6c847d19a865de9b2fb228156172f8 Mon Sep 17 00:00:00 2001 From: 79493 <794930212@qq.com> Date: Tue, 11 Oct 2022 17:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AB=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=92=8C=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=20spring=20securi?= =?UTF-8?q?ty=20=E6=9D=83=E9=99=90=E6=89=AB=E6=8F=8F=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rzyc/mapper/ent/EntUserMapper.java | 6 + .../rzyc/model/dto/AddOrUpdateEntUserDto.java | 114 ++++++++++++++++++ .../model/dto/EntUserCredentialUpdateDto.java | 13 +- .../rzyc/model/dto/EntUserPostDutyDto.java | 64 ++++++++++ .../rzyc/model/dto/EntUserPostListDto.java | 75 ++++++++++++ .../rzyc/model/dto/EntUserPostTaskDto.java | 112 +++++++++++++++++ .../resources/mapper/ent/EntUserMapper.xml | 5 + .../rzyc/controller/PersonalController.java | 80 ++++++------ .../filter/JwtAuthenticationTokenFiler.java | 2 +- .../com/rzyc/service/PcBusinessService.java | 43 +++++-- .../filter/JwtAuthenticationTokenFiler.java | 2 +- 11 files changed, 461 insertions(+), 55 deletions(-) create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostDutyDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostListDto.java create mode 100644 inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java index a287ee2..1ef0c82 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/ent/EntUserMapper.java @@ -36,4 +36,10 @@ public interface EntUserMapper extends BaseMapper { ListselectEntUserList(@Param("keyContent") String keyContent,@Param("page")Integer page,@Param("pageSize")Integer pageSize); + /** + * 修改企业用户 + * @param entUser 关键字 + * @return int 成功或失败 + * */ + int updateEntUser(@Param("entUser") EntUser entUser); } diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserDto.java new file mode 100644 index 0000000..1e4e80e --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/AddOrUpdateEntUserDto.java @@ -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; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserCredentialUpdateDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserCredentialUpdateDto.java index 5074609..7a72055 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserCredentialUpdateDto.java +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserCredentialUpdateDto.java @@ -7,36 +7,43 @@ import com.baomidou.mybatisplus.annotation.TableName; 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/10 * */ - - -@ApiModel(value="企业用户证件对象", description="企业用户证件对象") +@ApiModel(value="企业用户证件Dto", description="企业用户证件Dto") public class EntUserCredentialUpdateDto { + @NotNull @ApiModelProperty(value = "企业用户证照表id") private String credentialId; + @NotNull @ApiModelProperty(value = "证照名") private String credentialName; + @NotNull @ApiModelProperty(value = "证照状态 1.未超时 2.已超时") private Integer credentialState; + @NotNull @ApiModelProperty(value = "证照地址") private String credentialImageAddress; + @NotNull @ApiModelProperty(value = "企业用户id") private String entUserId; + @NotNull @ApiModelProperty(value = "证照起始时间") private Date credentialStartTime; + @NotNull @ApiModelProperty(value = "证照结束时间") private Date credentialEndTime; diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostDutyDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostDutyDto.java new file mode 100644 index 0000000..479e59b --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostDutyDto.java @@ -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; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostListDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostListDto.java new file mode 100644 index 0000000..12343b1 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostListDto.java @@ -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; + } +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java new file mode 100644 index 0000000..9d595d9 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/model/dto/EntUserPostTaskDto.java @@ -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; + } +} diff --git a/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml b/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml index 66753cd..2ee864f 100644 --- a/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml +++ b/inventory-dao/src/main/resources/mapper/ent/EntUserMapper.xml @@ -68,6 +68,11 @@ limit #{page},#{pageSize} + + 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) + + diff --git a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java index 76e8f43..2fb751b 100644 --- a/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java +++ b/inventory-ent/src/main/java/com/rzyc/controller/PersonalController.java @@ -9,7 +9,7 @@ import com.common.utils.jwt.JwtUtil; import com.common.utils.model.SingleResult; import com.rzyc.bean.user.dto.LoginDto; 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.service.PcBusinessService; 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.web.bind.annotation.*; import javax.validation.Valid; +import javax.validation.constraints.NotNull; import java.util.List; import java.util.Objects; @@ -32,6 +33,7 @@ import java.util.Objects; /** * 个人中心系统 * @author dong + * @author Xuwanxin * @date 2022-09-16 14:19 * @Version V1.0 */ @@ -160,81 +162,55 @@ public class PersonalController extends BaseController{ @PreAuthorize("hasAnyAuthority('entUserTree','entUserTree:update')") @MethodAnnotation(authorizations = {"entUserTree","entUserTree:update"},name = "企业用户组织树") @ResponseBody - public SingleResult> entUserTree(String enterpriseId, String postId)throws Exception{ + public SingleResult> entUserTree(@NotNull(message = "公司id不能为null") String enterpriseId, String postId)throws Exception{ return pcBusinessService.entUserTree(enterpriseId,postId); } /** * 企业用户工作要务 - * @param enterpriseId 企业id - * @param entUserId 企业用户id - * @param postId 企业用户岗位id + * @param entUserPostListDto 企业用户工作要务 * @return 企业用户工作要务 * @throws Exception */ @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") @PreAuthorize("hasAnyAuthority('entUserPostList','entUserPostList:update')") @MethodAnnotation(authorizations = {"entUserPostList","entUserPostList:update"},name = "企业用户工作要务") @ResponseBody - public SingleResult entUserPostList(String enterpriseId, String entUserId,String postId,Integer page,Integer pageSize)throws Exception{ - return pcBusinessService.entUserPostList(enterpriseId,entUserId,postId,page,pageSize); + public SingleResult entUserPostList(@RequestBody EntUserPostListDto entUserPostListDto)throws Exception{ + return pcBusinessService.entUserPostList(entUserPostListDto); } /** * 企业用户工作清单 - * @param enterpriseId 企业id - * @param postId 岗位id - * @param listId 清单id - * @param entUserId 企业用户id * @return 企业用户工作清单 * @throws Exception */ @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") @PreAuthorize("hasAnyAuthority('entUserPostTask','entUserPostTask:update')") @MethodAnnotation(authorizations = {"entUserPostTask","entUserPostTask:update"},name = "企业用户工作清单") @ResponseBody - public SingleResult entUserPostTask(String enterpriseId, String entUserId,String postId,String listId,String content,Integer taskState,Integer page,Integer pageSize)throws Exception{ - return pcBusinessService.entUserPostTask(enterpriseId,entUserId,postId,listId,content,taskState,page,pageSize); + public SingleResult entUserPostTask(@RequestBody EntUserPostTaskDto entUserPostTaskDto)throws Exception{ + return pcBusinessService.entUserPostTask(entUserPostTaskDto); } /** * 企业用户岗位职责 - * @param enterpriseId 企业id - * @param postId 岗位id + * @param entUserPostDutyDto 企业用户岗位职责参数对象 * @return 企业用户岗位职责 * @throws Exception */ @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") @PreAuthorize("hasAnyAuthority('entUserPostDuty','entUserPostDuty:update')") @MethodAnnotation(authorizations = {"entUserPostDuty","entUserPostDuty:update"},name = "企业用户岗位职责") @ResponseBody - public SingleResult entUserPostDuty(String enterpriseId, String postId,Integer page,Integer pageSize)throws Exception{ - return pcBusinessService.entUserPostDuty(enterpriseId,postId,page,pageSize); + public SingleResult entUserPostDuty(@RequestBody EntUserPostDutyDto entUserPostDutyDto)throws Exception{ + return pcBusinessService.entUserPostDuty(entUserPostDutyDto); } /** @@ -246,12 +222,14 @@ public class PersonalController extends BaseController{ @ApiOperation(value = "企业用户证照表", notes = "企业用户证照表") @ApiImplicitParams({ @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") @PreAuthorize("hasAnyAuthority('entUserCredential','entUserCredential:update')") @MethodAnnotation(authorizations = {"entUserCredential","entUserCredential:update"},name = "企业用户证照表") @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); } @@ -288,7 +266,7 @@ public class PersonalController extends BaseController{ @PreAuthorize("hasAnyAuthority('entUserCredentialDelete')") @MethodAnnotation(authorizations = {"entUserCredentialDelete"},name = "企业用户证照表-删除") @ResponseBody - public SingleResult entUserCredentialDelete(String credentialId)throws Exception{ + public SingleResult entUserCredentialDelete(@NotNull(message = "证件照id不能为null") String credentialId)throws Exception{ return pcBusinessService.entUserCredentialDelete(credentialId); } @@ -301,17 +279,39 @@ public class PersonalController extends BaseController{ */ @ApiOperation(value = "企业岗位总体信息列表", notes = "企业岗位总体信息列表") @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") @PreAuthorize("hasAnyAuthority('entUserList','entUserList:update')") @MethodAnnotation(authorizations = {"entUserList","entUserList:update"},name = "企业岗位总体信息列表") @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); } + /** + * 新增和修改公司岗位人员 + * @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); + } + + + + diff --git a/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java b/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java index d1fa9db..ac89d0b 100644 --- a/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java +++ b/inventory-ent/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java @@ -58,7 +58,7 @@ public class JwtAuthenticationTokenFiler extends OncePerRequestFilter { List authority= new ArrayList(); StringBuilder stringBuilder = new StringBuilder(); for (AuthorityKey s:authorizations) { - stringBuilder.append(s.getCategory() +":"+s.getAuthKey()); + stringBuilder.append(s.getAuthKey()); authority.add(new SimpleGrantedAuthority(stringBuilder.toString())); stringBuilder.setLength(0); } diff --git a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java index 8a69be7..728169c 100644 --- a/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java +++ b/inventory-ent/src/main/java/com/rzyc/service/PcBusinessService.java @@ -14,7 +14,7 @@ import com.rzyc.model.EntPostDuty; import com.rzyc.model.EntPostList; import com.rzyc.model.EntPostTask; 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.EntUser; 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(); - page = pageSize * (page - 1); - Listlist = entPostListMapper.selectEntPostList(enterpriseId,entUserId,postId,page,pageSize); + entUserPostListDto.setPage(entUserPostListDto.getPageSize() * (entUserPostListDto.getPage() - 1)); + Listlist = entPostListMapper.selectEntPostList(entUserPostListDto.getEnterpriseId(),entUserPostListDto.getEntUserId(), + entUserPostListDto.getPostId(),entUserPostListDto.getPage(),entUserPostListDto.getPageSize()); singleResult.setData(list); 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(); - page = pageSize * (page - 1); + entUserPostTaskDto.setPage(entUserPostTaskDto.getPageSize() * (entUserPostTaskDto.getPage() - 1)); //EntPostTask - Listlist = entPostTaskMapper.selectEntUserPostTask(enterpriseId,entUserId,postId,listId,content,taskState,page,pageSize); + Listlist = entPostTaskMapper.selectEntUserPostTask(entUserPostTaskDto.getEnterpriseId(),entUserPostTaskDto.getEntUserId(),entUserPostTaskDto.getPostId() + ,entUserPostTaskDto.getListId(),entUserPostTaskDto.getContent(),entUserPostTaskDto.getTaskState(), + entUserPostTaskDto.getPage(),entUserPostTaskDto.getPageSize()); singleResult.setData(list); return singleResult; } - public SingleResult entUserPostDuty(String enterpriseId, String postId,Integer page,Integer pageSize){ + public SingleResult entUserPostDuty(EntUserPostDutyDto entUserPostDutyDto){ SingleResult singleResult = new SingleResult(); - page = pageSize * (page - 1); + entUserPostDutyDto.setPage( entUserPostDutyDto.getPageSize() * (entUserPostDutyDto.getPage() - 1)); //EntPostDuty - Listlist = entPostDutyMapper.selectEntUserPostDuty(enterpriseId,postId,page,pageSize); + Listlist = entPostDutyMapper.selectEntUserPostDuty(entUserPostDutyDto.getEnterpriseId(),entUserPostDutyDto.getPostId(),entUserPostDutyDto.getPage(),entUserPostDutyDto.getPageSize()); singleResult.setData(list); return singleResult; } @@ -162,6 +165,26 @@ public class PcBusinessService extends BaseController { 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; + } + diff --git a/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java b/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java index 6a21968..906e0ce 100644 --- a/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java +++ b/inventory-gov/src/main/java/com/rzyc/filter/JwtAuthenticationTokenFiler.java @@ -57,7 +57,7 @@ public class JwtAuthenticationTokenFiler extends OncePerRequestFilter { List authority= new ArrayList(); StringBuilder stringBuilder = new StringBuilder(); for (AuthorityKey s:authorizations) { - stringBuilder.append(s.getCategory() +":"+s.getAuthKey()); + stringBuilder.append(s.getAuthKey()); authority.add(new SimpleGrantedAuthority(stringBuilder.toString())); stringBuilder.setLength(0); }