diff --git a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/userarchives/UserArchivesAppController.java b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/userarchives/UserArchivesAppController.java index d8c760b..36be2e5 100644 --- a/src/main/java/cn/com/tenlion/systemoa/controller/app/api/userarchives/UserArchivesAppController.java +++ b/src/main/java/cn/com/tenlion/systemoa/controller/app/api/userarchives/UserArchivesAppController.java @@ -82,6 +82,16 @@ public class UserArchivesAppController extends DefaultBaseController { return userArchivesService.get(userArchivesId); } + @ApiOperation(value = "人员自己的档案详情(通过ID)", notes = "人员自己的档案详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getByUserId") + public UserArchivesDTO getByUserId(@RequestHeader("token") String token) { + return userArchivesService.getByToken(token); + } + @ApiOperation(value = "人员档案列表", notes = "人员档案列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") diff --git a/src/main/java/cn/com/tenlion/systemoa/pojo/dtos/userarchives/UserArchivesDTO.java b/src/main/java/cn/com/tenlion/systemoa/pojo/dtos/userarchives/UserArchivesDTO.java index 9978005..6492b04 100644 --- a/src/main/java/cn/com/tenlion/systemoa/pojo/dtos/userarchives/UserArchivesDTO.java +++ b/src/main/java/cn/com/tenlion/systemoa/pojo/dtos/userarchives/UserArchivesDTO.java @@ -32,22 +32,32 @@ public class UserArchivesDTO { private String name; @ApiModelProperty(name = "sex", value = "性别") private String sex; + @ApiModelProperty(name = "sexName", value = "性别") + private String sexName; @ApiModelProperty(name = "birthday", value = "出生日期") private String birthday; @ApiModelProperty(name = "idCard", value = "身份证号码") private String idCard; @ApiModelProperty(name = "politicalOutlook", value = "政治面貌") private String politicalOutlook; + @ApiModelProperty(name = "politicalOutlookName", value = "政治面貌") + private String politicalOutlookName; @ApiModelProperty(name = "maritalStatus", value = "婚姻状况") private String maritalStatus; + @ApiModelProperty(name = "maritalStatusName", value = "婚姻状况") + private String maritalStatusName; @ApiModelProperty(name = "nationality", value = "国籍") private String nationality; + @ApiModelProperty(name = "nationalityName", value = "国籍") + private String nationalityName; @ApiModelProperty(name = "nativeAddress", value = "籍贯") private String nativeAddress; @ApiModelProperty(name = "residence", value = "户口") private String residence; @ApiModelProperty(name = "residenceNature", value = "户口性质") private String residenceNature; + @ApiModelProperty(name = "residenceNatureName", value = "户口性质") + private String residenceNatureName; @ApiModelProperty(name = "address", value = "家庭住址") private String address; @ApiModelProperty(name = "email", value = "电子邮箱") @@ -58,6 +68,8 @@ public class UserArchivesDTO { private String graduation; @ApiModelProperty(name = "major", value = "专业") private String major; + @ApiModelProperty(name = "majorName", value = "专业") + private String majorName; @ApiModelProperty(name = "highestDegree", value = "最高学位") private String highestDegree; @ApiModelProperty(name = "graduationDate", value = "毕业日期") @@ -76,10 +88,16 @@ public class UserArchivesDTO { private String quitTime; @ApiModelProperty(name = "dept", value = "所在部门") private String dept; + @ApiModelProperty(name = "deptName", value = "所在部门") + private String deptName; @ApiModelProperty(name = "post", value = "岗位") private String post; + @ApiModelProperty(name = "postName", value = "岗位") + private String postName; @ApiModelProperty(name = "directSuperior", value = "直接上级") private String directSuperior; + @ApiModelProperty(name = "directSuperiorName", value = "直接上级") + private String directSuperiorName; @ApiModelProperty(name = "bankAccount", value = "银行账号") private String bankAccount; @ApiModelProperty(name = "fundAccount", value = "公积金号") @@ -88,10 +106,16 @@ public class UserArchivesDTO { private String securityAccount; @ApiModelProperty(name = "title", value = "职称") private String title; + @ApiModelProperty(name = "titleName", value = "职称") + private String titleName; @ApiModelProperty(name = "titleGrade", value = "职称职等") private String titleGrade; + @ApiModelProperty(name = "titleGradeName", value = "职称职等") + private String titleGradeName; @ApiModelProperty(name = "userType", value = "人员分类") private String userType; + @ApiModelProperty(name = "userTypeName", value = "人员分类") + private String userTypeName; @ApiModelProperty(name = "creator", value = "") private String creator; @ApiModelProperty(name = "gmtCreate", value = "") @@ -110,7 +134,7 @@ public class UserArchivesDTO { private List workList; public String getUserArchivesId() { - return userArchivesId == null ? "" : userArchivesId.trim(); + return userArchivesId; } public void setUserArchivesId(String userArchivesId) { @@ -126,7 +150,7 @@ public class UserArchivesDTO { } public String getArchivesNum() { - return archivesNum == null ? "" : archivesNum.trim(); + return archivesNum; } public void setArchivesNum(String archivesNum) { @@ -134,7 +158,7 @@ public class UserArchivesDTO { } public String getLoginNum() { - return loginNum == null ? "" : loginNum.trim(); + return loginNum; } public void setLoginNum(String loginNum) { @@ -142,7 +166,7 @@ public class UserArchivesDTO { } public String getName() { - return name == null ? "" : name.trim(); + return name; } public void setName(String name) { @@ -150,15 +174,23 @@ public class UserArchivesDTO { } public String getSex() { - return sex == null ? "" : sex.trim(); + return sex; } public void setSex(String sex) { this.sex = sex; } + public String getSexName() { + return sexName; + } + + public void setSexName(String sexName) { + this.sexName = sexName; + } + public String getBirthday() { - return birthday == null ? "" : birthday.trim(); + return birthday; } public void setBirthday(String birthday) { @@ -166,7 +198,7 @@ public class UserArchivesDTO { } public String getIdCard() { - return idCard == null ? "" : idCard.trim(); + return idCard; } public void setIdCard(String idCard) { @@ -174,31 +206,55 @@ public class UserArchivesDTO { } public String getPoliticalOutlook() { - return politicalOutlook == null ? "" : politicalOutlook.trim(); + return politicalOutlook; } public void setPoliticalOutlook(String politicalOutlook) { this.politicalOutlook = politicalOutlook; } + public String getPoliticalOutlookName() { + return politicalOutlookName; + } + + public void setPoliticalOutlookName(String politicalOutlookName) { + this.politicalOutlookName = politicalOutlookName; + } + public String getMaritalStatus() { - return maritalStatus == null ? "" : maritalStatus.trim(); + return maritalStatus; } public void setMaritalStatus(String maritalStatus) { this.maritalStatus = maritalStatus; } + public String getMaritalStatusName() { + return maritalStatusName; + } + + public void setMaritalStatusName(String maritalStatusName) { + this.maritalStatusName = maritalStatusName; + } + public String getNationality() { - return nationality == null ? "" : nationality.trim(); + return nationality; } public void setNationality(String nationality) { this.nationality = nationality; } + public String getNationalityName() { + return nationalityName; + } + + public void setNationalityName(String nationalityName) { + this.nationalityName = nationalityName; + } + public String getNativeAddress() { - return nativeAddress == null ? "" : nativeAddress.trim(); + return nativeAddress; } public void setNativeAddress(String nativeAddress) { @@ -206,7 +262,7 @@ public class UserArchivesDTO { } public String getResidence() { - return residence == null ? "" : residence.trim(); + return residence; } public void setResidence(String residence) { @@ -214,15 +270,23 @@ public class UserArchivesDTO { } public String getResidenceNature() { - return residenceNature == null ? "" : residenceNature.trim(); + return residenceNature; } public void setResidenceNature(String residenceNature) { this.residenceNature = residenceNature; } + public String getResidenceNatureName() { + return residenceNatureName; + } + + public void setResidenceNatureName(String residenceNatureName) { + this.residenceNatureName = residenceNatureName; + } + public String getAddress() { - return address == null ? "" : address.trim(); + return address; } public void setAddress(String address) { @@ -230,7 +294,7 @@ public class UserArchivesDTO { } public String getEmail() { - return email == null ? "" : email.trim(); + return email; } public void setEmail(String email) { @@ -238,7 +302,7 @@ public class UserArchivesDTO { } public String getPhone() { - return phone == null ? "" : phone.trim(); + return phone; } public void setPhone(String phone) { @@ -246,7 +310,7 @@ public class UserArchivesDTO { } public String getGraduation() { - return graduation == null ? "" : graduation.trim(); + return graduation; } public void setGraduation(String graduation) { @@ -254,15 +318,23 @@ public class UserArchivesDTO { } public String getMajor() { - return major == null ? "" : major.trim(); + return major; } public void setMajor(String major) { this.major = major; } + public String getMajorName() { + return majorName; + } + + public void setMajorName(String majorName) { + this.majorName = majorName; + } + public String getHighestDegree() { - return highestDegree == null ? "" : highestDegree.trim(); + return highestDegree; } public void setHighestDegree(String highestDegree) { @@ -270,7 +342,7 @@ public class UserArchivesDTO { } public String getGraduationDate() { - return graduationDate == null ? "" : graduationDate.trim(); + return graduationDate; } public void setGraduationDate(String graduationDate) { @@ -278,7 +350,7 @@ public class UserArchivesDTO { } public String getEmergencyContact() { - return emergencyContact == null ? "" : emergencyContact.trim(); + return emergencyContact; } public void setEmergencyContact(String emergencyContact) { @@ -286,7 +358,7 @@ public class UserArchivesDTO { } public String getEmergencyContactPhone() { - return emergencyContactPhone == null ? "" : emergencyContactPhone.trim(); + return emergencyContactPhone; } public void setEmergencyContactPhone(String emergencyContactPhone) { @@ -294,7 +366,7 @@ public class UserArchivesDTO { } public String getPhoto() { - return photo == null ? "" : photo.trim(); + return photo; } public void setPhoto(String photo) { @@ -302,7 +374,7 @@ public class UserArchivesDTO { } public String getJoinTime() { - return joinTime == null ? "" : joinTime.trim(); + return joinTime; } public void setJoinTime(String joinTime) { @@ -310,7 +382,7 @@ public class UserArchivesDTO { } public String getCeremonialTime() { - return ceremonialTime == null ? "" : ceremonialTime.trim(); + return ceremonialTime; } public void setCeremonialTime(String ceremonialTime) { @@ -318,7 +390,7 @@ public class UserArchivesDTO { } public String getQuitTime() { - return quitTime == null ? "" : quitTime.trim(); + return quitTime; } public void setQuitTime(String quitTime) { @@ -326,31 +398,55 @@ public class UserArchivesDTO { } public String getDept() { - return dept == null ? "" : dept.trim(); + return dept; } public void setDept(String dept) { this.dept = dept; } + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + public String getPost() { - return post == null ? "" : post.trim(); + return post; } public void setPost(String post) { this.post = post; } + public String getPostName() { + return postName; + } + + public void setPostName(String postName) { + this.postName = postName; + } + public String getDirectSuperior() { - return directSuperior == null ? "" : directSuperior.trim(); + return directSuperior; } public void setDirectSuperior(String directSuperior) { this.directSuperior = directSuperior; } + public String getDirectSuperiorName() { + return directSuperiorName; + } + + public void setDirectSuperiorName(String directSuperiorName) { + this.directSuperiorName = directSuperiorName; + } + public String getBankAccount() { - return bankAccount == null ? "" : bankAccount.trim(); + return bankAccount; } public void setBankAccount(String bankAccount) { @@ -358,7 +454,7 @@ public class UserArchivesDTO { } public String getFundAccount() { - return fundAccount == null ? "" : fundAccount.trim(); + return fundAccount; } public void setFundAccount(String fundAccount) { @@ -366,7 +462,7 @@ public class UserArchivesDTO { } public String getSecurityAccount() { - return securityAccount == null ? "" : securityAccount.trim(); + return securityAccount; } public void setSecurityAccount(String securityAccount) { @@ -374,31 +470,55 @@ public class UserArchivesDTO { } public String getTitle() { - return title == null ? "" : title.trim(); + return title; } public void setTitle(String title) { this.title = title; } + public String getTitleName() { + return titleName; + } + + public void setTitleName(String titleName) { + this.titleName = titleName; + } + public String getTitleGrade() { - return titleGrade == null ? "" : titleGrade.trim(); + return titleGrade; } public void setTitleGrade(String titleGrade) { this.titleGrade = titleGrade; } + public String getTitleGradeName() { + return titleGradeName; + } + + public void setTitleGradeName(String titleGradeName) { + this.titleGradeName = titleGradeName; + } + public String getUserType() { - return userType == null ? "" : userType.trim(); + return userType; } public void setUserType(String userType) { this.userType = userType; } + public String getUserTypeName() { + return userTypeName; + } + + public void setUserTypeName(String userTypeName) { + this.userTypeName = userTypeName; + } + public String getCreator() { - return creator == null ? "" : creator.trim(); + return creator; } public void setCreator(String creator) { @@ -406,7 +526,7 @@ public class UserArchivesDTO { } public String getGmtCreate() { - return gmtCreate == null ? "" : gmtCreate.trim(); + return gmtCreate; } public void setGmtCreate(String gmtCreate) { @@ -414,7 +534,7 @@ public class UserArchivesDTO { } public String getModifier() { - return modifier == null ? "" : modifier.trim(); + return modifier; } public void setModifier(String modifier) { @@ -422,7 +542,7 @@ public class UserArchivesDTO { } public String getGmtModified() { - return gmtModified == null ? "" : gmtModified.trim(); + return gmtModified; } public void setGmtModified(String gmtModified) { @@ -430,7 +550,7 @@ public class UserArchivesDTO { } public Integer getIsDelete() { - return isDelete == null ? 0 : isDelete; + return isDelete; } public void setIsDelete(Integer isDelete) { diff --git a/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java index 61b48a4..63cc558 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/filetype/impl/FileTypeServiceImpl.java @@ -110,11 +110,6 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType @Override public FileTypeDTO get(Map params) { - /*if(null != params.get("typeBelong")) { - if("共享文档".equals(params.get("typeBelong").toString())) { - params.put("typeBelong", "个人文档"); - } - }*/ return fileTypeDao.get(params); } @@ -164,23 +159,54 @@ public class FileTypeServiceImpl extends DefaultBaseService implements IFileType params.put("typeBelong", "个人文档"); } } - List fileTypeDTOList = fileTypeDao.list(params); + List fileTypeDTOList = null; + fileTypeDTOList = fileTypeDao.list(params); Iterator it = fileTypeDTOList.iterator(); while (it.hasNext()) { FileTypeDTO fileTypeDTO = it.next(); + params.put("fileUploadId", fileTypeDTO.getFileTypeId()); + FileRoleDTO fileRoleDTO = fileRoleService.get(params); if(null != params.get("method")) { if("新增".equals(params.get("method"))) { - if("否".equals(fileTypeDTO.getAddRole())) { + if(null != fileRoleDTO && "否".equals(fileTypeDTO.getAddRole())) { it.remove(); } } if("修改".equals(params.get("method"))) { - if("否".equals(fileTypeDTO.getEditRole())) { + if(null != fileRoleDTO && "否".equals(fileTypeDTO.getEditRole())) { it.remove(); } } } } + + if(!it.hasNext()) { + List fileRoleDTOList = fileRoleService.list(params); + if(null != fileRoleDTOList && fileRoleDTOList.size() > 0) { + fileTypeDTOList = new ArrayList<>(); + for(FileRoleDTO fileRoleDTO: fileRoleDTOList) { + params.put("fileTypeId", fileRoleDTO.getFileUploadId()); + params.remove("creator"); + FileTypeDTO fileTypeDTO = get(params); + if(null != fileTypeDTO) { + fileTypeDTO.setAddRole(fileRoleDTO.getAddRole()); + fileTypeDTO.setDelRole(fileRoleDTO.getDelRole()); + fileTypeDTO.setEditRole(fileRoleDTO.getEditRole()); + fileTypeDTO.setShareRole(fileRoleDTO.getShareRole()); + if ("新增".equals(params.get("method"))) { + if ("是".equals(fileRoleDTO.getAddRole())) { + fileTypeDTOList.add(fileTypeDTO); + } + } + if ("修改".equals(params.get("method"))) { + if ("是".equals(fileRoleDTO.getEditRole())) { + fileTypeDTOList.add(fileTypeDTO); + } + } + } + } + } + } return fileTypeDTOList; } diff --git a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java index 17c547f..90b5455 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/fileupload/impl/FileUploadServiceImpl.java @@ -9,6 +9,7 @@ import cn.com.tenlion.systemoa.pojo.dtos.fileupload.FileUploadDTO; import cn.com.tenlion.systemoa.pojo.pos.fileupload.FileUploadPO; import cn.com.tenlion.systemoa.pojo.vos.fileupload.FileUploadVO; import cn.com.tenlion.systemoa.service.filecatalogue.IFileCatalogueService; +import cn.com.tenlion.systemoa.service.filerole.IFileRoleService; import cn.com.tenlion.systemoa.service.filetype.IFileTypeService; import cn.com.tenlion.systemoa.service.fileupload.IFileUploadService; import cn.com.tenlion.systemoa.utils.OfficeToPDFUtils; @@ -64,6 +65,8 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp private ConfigPro configPro; @Autowired private FileProperties fileProperties; + @Autowired + private IFileRoleService fileRoleService; @Override public void save(FileUploadVO fileUploadVO) { @@ -226,7 +229,7 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp } } - List fileUploadDTOList = fileUploadDao.list(params); + /*List fileUploadDTOList = fileUploadDao.list(params); if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { Iterator it = fileUploadDTOList.iterator(); while(it.hasNext()) { @@ -265,7 +268,115 @@ public class FileUploadServiceImpl extends DefaultBaseService implements IFileUp fileUploadDTO.setCatalogueName(fileTypeDTO1.getTypeName()); } } + }*/ + // 新逻辑 + List fileUploadDTOList = null; + if(null != params.get("typeBelong")) { + String typeBelong = params.get("typeBelong").toString(); + String creator = params.get("creator").toString(); + if("个人文档".equals(params.get("typeBelong").toString())) { + fileUploadDTOList = fileUploadDao.list(params); + if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { + Iterator iterator = fileUploadDTOList.iterator(); + while (iterator.hasNext()) { + FileUploadDTO fileUploadDTO = iterator.next(); + params.put("fileTypeId", fileUploadDTO.getFileTypeId()); + params.remove("typeBelong"); + params.remove("creator"); + FileTypeDTO fileTypeDTO = fileTypeService.get(params); + if(null != fileTypeDTO && "公共文档".equals(fileTypeDTO.getTypeBelong())) { + iterator.remove(); + } + fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); + fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); + } + for(FileUploadDTO fileUploadDTO: fileUploadDTOList) { + fileUploadDTO.setAddRole("是"); + fileUploadDTO.setDelRole("是"); + fileUploadDTO.setEditRole("是"); + fileUploadDTO.setShareRole("是"); + } + } + } + + params.put("typeBelong", typeBelong); + if("共享文档".equals(params.get("typeBelong").toString())) { + List fileRoleDTOList = fileRoleService.list(params); + if(null != fileRoleDTOList && fileRoleDTOList.size() > 0) { + fileUploadDTOList = new ArrayList<>(); + for(FileRoleDTO fileRoleDTO: fileRoleDTOList) { + params.put("fileUploadId", fileRoleDTO.getFileUploadId()); + params.remove("creator"); + FileUploadDTO fileUploadDTO = get(params); + if(null != fileUploadDTO) { + fileUploadDTO.setAddRole(fileRoleDTO.getAddRole()); + fileUploadDTO.setDelRole(fileRoleDTO.getDelRole()); + fileUploadDTO.setEditRole(fileRoleDTO.getEditRole()); + fileUploadDTO.setShareRole(fileRoleDTO.getShareRole()); + params.put("fileTypeId", fileUploadDTO.getFileTypeId()); + params.remove("creator"); + FileTypeDTO fileTypeDTO = fileTypeService.get(params); + if(null != fileTypeDTO) { + fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); + fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); + } + fileUploadDTOList.add(fileUploadDTO); + } + } + } + } + + if("公共文档".equals(params.get("typeBelong").toString())) { + params.remove("creator"); + fileUploadDTOList = fileUploadDao.list(params); + if(null != fileUploadDTOList && fileUploadDTOList.size() > 0) { + Iterator it = fileUploadDTOList.iterator(); + while(it.hasNext()) { + FileUploadDTO fileUploadDTO = it.next(); + params.put("fileTypeId", fileUploadDTO.getFileTypeId()); + params.remove("typeBelong"); + params.remove("creator"); + FileTypeDTO fileTypeDTO = fileTypeService.get(params); + if(null != fileTypeDTO) { + if("个人文档".equals(fileTypeDTO.getTypeBelong())) { + it.remove(); + continue; + } + if(null != fileTypeDTO) { + fileUploadDTO.setCatalogueName(fileTypeDTO.getTypeName()); + fileUploadDTO.setCatalogueType(fileTypeDTO.getTypeBelong()); + } + } + + // params.put("typeBelong", typeBelong); + params.put("creator", creator); + params.put("userId", creator); + FileRoleDTO fileRoleDTO = fileRoleService.get(params); + if(null != fileRoleDTO) { + fileUploadDTO.setAddRole(fileRoleDTO.getAddRole()); + fileUploadDTO.setDelRole(fileRoleDTO.getDelRole()); + fileUploadDTO.setEditRole(fileRoleDTO.getEditRole()); + fileUploadDTO.setShareRole(fileRoleDTO.getShareRole()); + }else { + FileUploadDTO fileUploadDTO1 = get(params); + if(null != fileUploadDTO1) { + fileUploadDTO.setAddRole("是"); + fileUploadDTO.setDelRole("是"); + fileUploadDTO.setEditRole("是"); + fileUploadDTO.setShareRole("是"); + }else { + fileUploadDTO.setAddRole("否"); + fileUploadDTO.setDelRole("否"); + fileUploadDTO.setEditRole("否"); + fileUploadDTO.setShareRole("否"); + } + } + } + } + + } } + return fileUploadDTOList; } diff --git a/src/main/java/cn/com/tenlion/systemoa/service/userarchives/IUserArchivesService.java b/src/main/java/cn/com/tenlion/systemoa/service/userarchives/IUserArchivesService.java index 511cae2..15c67be 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/userarchives/IUserArchivesService.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/userarchives/IUserArchivesService.java @@ -191,4 +191,6 @@ public interface IUserArchivesService { * @return */ UserArchivesDTO getByUserId(String userId); + + UserArchivesDTO getByToken(String token); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemoa/service/userarchives/impl/UserArchivesServiceImpl.java b/src/main/java/cn/com/tenlion/systemoa/service/userarchives/impl/UserArchivesServiceImpl.java index ce709eb..3575a1e 100644 --- a/src/main/java/cn/com/tenlion/systemoa/service/userarchives/impl/UserArchivesServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemoa/service/userarchives/impl/UserArchivesServiceImpl.java @@ -7,9 +7,17 @@ import cn.com.tenlion.systemoa.pojo.vos.userwork.UserWorkVO; import cn.com.tenlion.systemoa.service.usereducation.IUserEducationService; import cn.com.tenlion.systemoa.service.userwork.IUserWorkService; import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.module.dictionary.pojo.dtos.DataDTO; +import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.pojo.dtos.department.DepartmentDTO; +import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultList; +import ink.wgink.service.department.service.IDepartmentService; +import ink.wgink.service.department.service.IDepartmentUserService; +import ink.wgink.service.user.service.IUserService; import ink.wgink.util.map.HashMapUtil; import ink.wgink.util.UUIDUtil; import cn.com.tenlion.systemoa.dao.userarchives.IUserArchivesDao; @@ -43,6 +51,12 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser private IUserEducationService userEducationService; @Autowired private IUserWorkService userWorkService; + @Autowired + private IDataService dataService; + @Autowired + private IDepartmentService departmentService; + @Autowired + private IUserService userService; @Override public void save(UserArchivesVO userArchivesVO) { @@ -70,13 +84,14 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser setAppSaveInfo(token, params); } params.put("archivesNum", creatArchivesNum()); + params.put("userId", params.get("creator")); userArchivesDao.save(params); List userEducationVOList = userArchivesVO.getEducationList(); if(null != userEducationVOList && userEducationVOList.size() > 0) { for(UserEducationVO userEducationVO: userEducationVOList) { userEducationVO.setUserArchivesId(userArchivesId); - userEducationService.save(userEducationVO); + userEducationService.save(token, userEducationVO); } } @@ -84,7 +99,7 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser if(null != userWorkVOList && userWorkVOList.size() > 0) { for(UserWorkVO userWorkVO: userWorkVOList) { userWorkVO.setUserArchivesId(userArchivesId); - userWorkService.save(userWorkVO); + userWorkService.save(token, userWorkVO); } } return userArchivesId; @@ -150,7 +165,7 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser userEducationService.removeByUserArchivesId(null, userArchivesId); for(UserEducationVO userEducationVO: userEducationVOList) { userEducationVO.setUserArchivesId(userArchivesId); - userEducationService.save(userEducationVO); + userEducationService.save(token, userEducationVO); } } @@ -159,7 +174,7 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser userWorkService.removeByUserArchivesId(null, userArchivesId); for(UserWorkVO userWorkVO: userWorkVOList) { userWorkVO.setUserArchivesId(userArchivesId); - userWorkService.save(userWorkVO); + userWorkService.save(token, userWorkVO); } } userArchivesDao.update(params); @@ -169,6 +184,76 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser public UserArchivesDTO get(Map params) { UserArchivesDTO userArchivesDTO = userArchivesDao.get(params); if(null != userArchivesDTO) { + params.put("userArchivesId", userArchivesDTO.getUserArchivesId()); + // 获取字典相关汉字 + if(!StringUtils.isEmpty(userArchivesDTO.getSex())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getSex()); + if(null != dataDTO) { + userArchivesDTO.setSexName(dataDTO.getDataName()); + } + } + + if(!StringUtils.isEmpty(userArchivesDTO.getPoliticalOutlook())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getPoliticalOutlook()); + if(null != dataDTO) { + userArchivesDTO.setPoliticalOutlookName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getMaritalStatus())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getMaritalStatus()); + if(null != dataDTO) { + userArchivesDTO.setMaritalStatusName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getResidenceNature())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getResidenceNature()); + if(null != dataDTO) { + userArchivesDTO.setResidenceNatureName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getMajor())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getMajor()); + if(null != dataDTO) { + userArchivesDTO.setMajorName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getDept())) { + DepartmentDTO departmentDTO = departmentService.get(userArchivesDTO.getDept()); + if(null != departmentDTO) { + userArchivesDTO.setDeptName(departmentDTO.getDepartmentName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getPost())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getPost()); + if(null != dataDTO) { + userArchivesDTO.setPostName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getDirectSuperior())) { + UserDTO userDTO = userService.get(userArchivesDTO.getDirectSuperior()); + if(null != userDTO) { + userArchivesDTO.setDirectSuperiorName(userDTO.getUserName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getTitle())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getTitle()); + if(null != dataDTO) { + userArchivesDTO.setTitleName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getTitleGrade())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getTitleGrade()); + if(null != dataDTO) { + userArchivesDTO.setTitleGradeName(dataDTO.getDataName()); + } + } + if(!StringUtils.isEmpty(userArchivesDTO.getUserType())) { + DataDTO dataDTO = dataService.get(userArchivesDTO.getUserType()); + if(null != dataDTO) { + userArchivesDTO.setUserTypeName(dataDTO.getDataName()); + } + } + List userEducationDTOList = userEducationService.list(params); if(null != userEducationDTOList && userEducationDTOList.size() > 0) { userArchivesDTO.setEducationList(userEducationDTOList); @@ -249,4 +334,18 @@ public class UserArchivesServiceImpl extends DefaultBaseService implements IUser return get(params); } + @Override + public UserArchivesDTO getByToken(String token) { + if(null != token) { + AppTokenUser appTokenUser = getAppTokenUser(token); + String userId = appTokenUser.getId(); + UserArchivesDTO userArchivesDTO = getByUserId(userId); + if(null == userArchivesDTO) { + return new UserArchivesDTO(); + } + return userArchivesDTO; + } + return null; + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml b/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml index 83c8ae8..64b99b3 100644 --- a/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml +++ b/src/main/resources/mybatis/mapper/filerole/file-role-mapper.xml @@ -235,6 +235,9 @@ t1.id LIKE CONCAT('%', #{keywords}, '%') ) + + AND FIND_IN_SET(#{creator}, t1.user_id) + AND t1.file_upload_id = #{fileUploadId} diff --git a/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml b/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml index 75261cd..6ccaad6 100644 --- a/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml +++ b/src/main/resources/mybatis/mapper/filetype/file-type-mapper.xml @@ -123,7 +123,7 @@ - + SELECT + t1.type_name, + t1.remake, + t1.type_belong, + t1.code, + t1.file_type_id, + 1 + FROM + data_file_type t1 + WHERE + t1.is_delete = 0 + + AND t1.file_type_id = #{fileTypeId} + + + AND t1.type_belong = #{typeBelong} + + + AND FIND_IN_SET(#{creator}, t1.creator) + + LIMIT 0, 1 - + SELECT + DISTINCT + t1.file_type_id, + t1.type_name, + t1.remake, + t1.type_belong, + t1.code, + t1.creator, + t1.gmt_create, + t1.modifier, + t1.gmt_modified, + t1.is_delete, + 1 + FROM + data_file_type t1 + WHERE + t1.is_delete = 0 + + AND ( + t1.type_name LIKE CONCAT('%', #{keywords}, '%') + OR t1.remake LIKE CONCAT('%', #{keywords}, '%') + OR t1.code LIKE CONCAT('%', #{keywords}, '%') + OR t1.type_belong LIKE CONCAT('%', #{keywords}, '%') + ) + + + AND t1.type_belong = #{typeBelong} + + + AND FIND_IN_SET(#{creator}, t1.creator) + + + AND + LEFT(t1.gmt_create, 10) = ]]> #{startTime} + + + AND + LEFT(t1.gmt_create, 10) #{endTime} + + + AND + t1.file_type_id IN + + #{fileTypeIds[${index}]} + + diff --git a/src/main/resources/mybatis/mapper/fileupload/file-upload-mapper.xml b/src/main/resources/mybatis/mapper/fileupload/file-upload-mapper.xml index 2bca8b3..f9687a7 100644 --- a/src/main/resources/mybatis/mapper/fileupload/file-upload-mapper.xml +++ b/src/main/resources/mybatis/mapper/fileupload/file-upload-mapper.xml @@ -172,6 +172,10 @@ AND t1.file_upload_id = #{fileUploadId} + + AND FIND_IN_SET(#{creator}, t1.creator) + + LIMIT 0, 1 @@ -227,6 +231,66 @@ + + -