diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java deleted file mode 100644 index 343411cb..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.Setter; -import me.zhengjie.base.BaseEntity; -import javax.persistence.*; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Entity -@Getter -@Setter -@Table(name="sys_job") -public class Job extends BaseEntity implements Serializable { - - @Id - @Column(name = "job_id") - @NotNull(groups = Update.class) - @ApiModelProperty(value = "ID", hidden = true) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @NotBlank - @ApiModelProperty(value = "岗位名称") - private String name; - - @NotNull - @ApiModelProperty(value = "岗位排序") - private Long jobSort; - - @NotNull - @ApiModelProperty(value = "是否启用") - private Boolean enabled; - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Job job = (Job) o; - return Objects.equals(id, job.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java index 7e9b0aa6..a4ac11d0 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java @@ -52,13 +52,6 @@ public class User extends BaseEntity implements Serializable { inverseJoinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "role_id")}) private Set roles; - @ManyToMany(fetch = FetchType.EAGER) - @ApiModelProperty(value = "用户岗位") - @JoinTable(name = "sys_users_jobs", - joinColumns = {@JoinColumn(name = "user_id",referencedColumnName = "user_id")}, - inverseJoinColumns = {@JoinColumn(name = "job_id",referencedColumnName = "job_id")}) - private Set jobs; - @OneToOne @JoinColumn(name = "dept_id") @ApiModelProperty(value = "用户部门") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java deleted file mode 100644 index 3454efcb..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.repository; - -import me.zhengjie.modules.system.domain.Job; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; - -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -public interface JobRepository extends JpaRepository, JpaSpecificationExecutor { - - /** - * 根据名称查询 - * @param name 名称 - * @return / - */ - Job findByName(String name); - - /** - * 根据Id删除 - * @param ids / - */ - void deleteAllByIdIn(Set ids); -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java index 979f0f31..48764979 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java @@ -103,14 +103,6 @@ public interface UserRepository extends JpaRepository, JpaSpecificat */ void deleteAllByIdIn(Set ids); - /** - * 根据岗位查询 - * @param ids / - * @return / - */ - @Query(value = "SELECT count(1) FROM sys_user u, sys_users_jobs j WHERE u.user_id = j.user_id AND j.job_id IN ?1", nativeQuery = true) - int countByJobs(Set ids); - /** * 根据部门查询 * @param deptIds / diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java deleted file mode 100644 index 729bfc45..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.rest; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.JobService; -import me.zhengjie.modules.system.service.dto.JobDto; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import me.zhengjie.utils.PageResult; -import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@RestController -@RequiredArgsConstructor -@Api(tags = "系统:岗位管理") -@RequestMapping("/api/job") -public class JobController { - - private final JobService jobService; - private static final String ENTITY_NAME = "job"; - - @ApiOperation("导出岗位数据") - @GetMapping(value = "/download") - @PreAuthorize("@el.check('job:list')") - public void exportJob(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { - jobService.download(jobService.queryAll(criteria), response); - } - - @ApiOperation("查询岗位") - @GetMapping - @PreAuthorize("@el.check('job:list','user:list')") - public ResponseEntity> queryJob(JobQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(jobService.queryAll(criteria, pageable),HttpStatus.OK); - } - - @Log("新增岗位") - @ApiOperation("新增岗位") - @PostMapping - @PreAuthorize("@el.check('job:add')") - public ResponseEntity createJob(@Validated @RequestBody Job resources){ - if (resources.getId() != null) { - throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); - } - jobService.create(resources); - return new ResponseEntity<>(HttpStatus.CREATED); - } - - @Log("修改岗位") - @ApiOperation("修改岗位") - @PutMapping - @PreAuthorize("@el.check('job:edit')") - public ResponseEntity updateJob(@Validated(Job.Update.class) @RequestBody Job resources){ - jobService.update(resources); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除岗位") - @ApiOperation("删除岗位") - @DeleteMapping - @PreAuthorize("@el.check('job:del')") - public ResponseEntity deleteJob(@RequestBody Set ids){ - // 验证是否被用户关联 - jobService.verification(ids); - jobService.delete(ids); - return new ResponseEntity<>(HttpStatus.OK); - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java deleted file mode 100644 index 5543ede6..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service; - -import me.zhengjie.utils.PageResult; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobDto; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import org.springframework.data.domain.Pageable; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.Set; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -public interface JobService { - - /** - * 根据ID查询 - * @param id / - * @return / - */ - JobDto findById(Long id); - - /** - * 创建 - * @param resources / - * @return / - */ - void create(Job resources); - - /** - * 编辑 - * @param resources / - */ - void update(Job resources); - - /** - * 删除 - * @param ids / - */ - void delete(Set ids); - - /** - * 分页查询 - * @param criteria 条件 - * @param pageable 分页参数 - * @return / - */ - PageResult queryAll(JobQueryCriteria criteria, Pageable pageable); - - /** - * 查询全部数据 - * @param criteria / - * @return / - */ - List queryAll(JobQueryCriteria criteria); - - /** - * 导出数据 - * @param queryAll 待导出的数据 - * @param response / - * @throws IOException / - */ - void download(List queryAll, HttpServletResponse response) throws IOException; - - /** - * 验证是否被用户关联 - * @param ids / - */ - void verification(Set ids); -} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java deleted file mode 100644 index 9852d3c2..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import me.zhengjie.base.BaseDTO; - -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Getter -@Setter -@NoArgsConstructor -public class JobDto extends BaseDTO implements Serializable { - - @ApiModelProperty(value = "ID") - private Long id; - - @ApiModelProperty(value = "岗位排序") - private Integer jobSort; - - @ApiModelProperty(value = "名称") - private String name; - - @ApiModelProperty(value = "是否启用") - private Boolean enabled; - - public JobDto(String name, Boolean enabled) { - this.name = name; - this.enabled = enabled; - } -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java deleted file mode 100644 index 90895c2b..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import me.zhengjie.annotation.Query; -import java.sql.Timestamp; -import java.util.List; - -/** -* @author Zheng Jie -* @date 2019-6-4 14:49:34 -*/ -@Data -@NoArgsConstructor -public class JobQueryCriteria { - - @ApiModelProperty(value = "岗位名称") - @Query(type = Query.Type.INNER_LIKE) - private String name; - - @Query - @ApiModelProperty(value = "岗位状态") - private Boolean enabled; - - @ApiModelProperty(value = "创建时间") - @Query(type = Query.Type.BETWEEN) - private List createTime; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java deleted file mode 100644 index 50f04a54..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import java.io.Serializable; - -/** -* @author Zheng Jie -* @date 2019-6-10 16:32:18 -*/ -@Data -@NoArgsConstructor -public class JobSmallDto implements Serializable { - - @ApiModelProperty(value = "ID") - private Long id; - - @ApiModelProperty(value = "名称") - private String name; -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java index 9ec68740..5dfe40aa 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java @@ -38,9 +38,6 @@ public class UserDto extends BaseDTO implements Serializable { @ApiModelProperty(value = "角色") private Set roles; - @ApiModelProperty(value = "岗位") - private Set jobs; - @ApiModelProperty(value = "部门") private DeptSmallDto dept; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java deleted file mode 100644 index e6646c29..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.impl; - -import lombok.RequiredArgsConstructor; -import me.zhengjie.utils.PageResult; -import me.zhengjie.exception.BadRequestException; -import me.zhengjie.exception.EntityExistException; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.repository.UserRepository; -import me.zhengjie.modules.system.service.dto.JobQueryCriteria; -import me.zhengjie.utils.*; -import me.zhengjie.modules.system.repository.JobRepository; -import me.zhengjie.modules.system.service.JobService; -import me.zhengjie.modules.system.service.dto.JobDto; -import me.zhengjie.modules.system.service.mapstruct.JobMapper; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.concurrent.TimeUnit; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Service -@RequiredArgsConstructor -public class JobServiceImpl implements JobService { - - private final JobRepository jobRepository; - private final JobMapper jobMapper; - private final RedisUtils redisUtils; - private final UserRepository userRepository; - - @Override - public PageResult queryAll(JobQueryCriteria criteria, Pageable pageable) { - Page page = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); - return PageUtil.toPage(page.map(jobMapper::toDto).getContent(),page.getTotalElements()); - } - - @Override - public List queryAll(JobQueryCriteria criteria) { - List list = jobRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)); - return jobMapper.toDto(list); - } - - @Override - public JobDto findById(Long id) { - String key = CacheKey.JOB_ID + id; - Job job = redisUtils.get(key, Job.class); - if(job == null){ - job = jobRepository.findById(id).orElseGet(Job::new); - ValidationUtil.isNull(job.getId(),"Job","id",id); - redisUtils.set(key, job, 1, TimeUnit.DAYS); - } - return jobMapper.toDto(job); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Job resources) { - Job job = jobRepository.findByName(resources.getName()); - if(job != null){ - throw new EntityExistException(Job.class,"name",resources.getName()); - } - jobRepository.save(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Job resources) { - Job job = jobRepository.findById(resources.getId()).orElseGet(Job::new); - Job old = jobRepository.findByName(resources.getName()); - if(old != null && !old.getId().equals(resources.getId())){ - throw new EntityExistException(Job.class,"name",resources.getName()); - } - ValidationUtil.isNull( job.getId(),"Job","id",resources.getId()); - resources.setId(job.getId()); - jobRepository.save(resources); - // 删除缓存 - delCaches(resources.getId()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Set ids) { - jobRepository.deleteAllByIdIn(ids); - // 删除缓存 - redisUtils.delByKeys(CacheKey.JOB_ID, ids); - } - - @Override - public void download(List jobDtos, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (JobDto jobDTO : jobDtos) { - Map map = new LinkedHashMap<>(); - map.put("岗位名称", jobDTO.getName()); - map.put("岗位状态", jobDTO.getEnabled() ? "启用" : "停用"); - map.put("创建日期", jobDTO.getCreateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } - - @Override - public void verification(Set ids) { - if(userRepository.countByJobs(ids) > 0){ - throw new BadRequestException("所选的岗位中存在用户关联,请解除关联再试!"); - } - } - - /** - * 删除缓存 - * @param id / - */ - public void delCaches(Long id){ - redisUtils.del(CacheKey.JOB_ID + id); - } -} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java index 70693885..a176041d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java @@ -134,7 +134,6 @@ public class UserServiceImpl implements UserService { user.setEnabled(resources.getEnabled()); user.setRoles(resources.getRoles()); user.setDept(resources.getDept()); - user.setJobs(resources.getJobs()); user.setPhone(resources.getPhone()); user.setNickName(resources.getNickName()); user.setGender(resources.getGender()); @@ -255,7 +254,6 @@ public class UserServiceImpl implements UserService { map.put("用户名", userDTO.getUsername()); map.put("角色", roles); map.put("部门", userDTO.getDept().getName()); - map.put("岗位", userDTO.getJobs().stream().map(JobSmallDto::getName).collect(Collectors.toList())); map.put("邮箱", userDTO.getEmail()); map.put("状态", userDTO.getEnabled() ? "启用" : "禁用"); map.put("手机号码", userDTO.getPhone()); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java deleted file mode 100644 index 1012ab6a..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Mapper(componentModel = "spring",uses = {DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface JobMapper extends BaseMapper { -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java deleted file mode 100644 index b5ad149e..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-2025 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.modules.system.service.mapstruct; - -import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.system.domain.Job; -import me.zhengjie.modules.system.service.dto.JobSmallDto; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; - -/** -* @author Zheng Jie -* @date 2019-03-29 -*/ -@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface JobSmallMapper extends BaseMapper { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java index 9f40d60a..decf8e9f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java @@ -25,6 +25,6 @@ import org.mapstruct.ReportingPolicy; * @author Zheng Jie * @date 2018-11-23 */ -@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class, JobMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) +@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE) public interface UserMapper extends BaseMapper { } diff --git a/eladmin-system/src/main/resources/db/migration/V5__event_organizer.sql b/eladmin-system/src/main/resources/db/migration/V5__event_organizer.sql new file mode 100644 index 00000000..59011a6f --- /dev/null +++ b/eladmin-system/src/main/resources/db/migration/V5__event_organizer.sql @@ -0,0 +1,10 @@ +create table event_organizer +( + id bigint auto_increment primary key, + user_id bigint not null references sys_user (user_id), + club_id bigint null references club (id) +); + +drop table sys_users_jobs; + +drop table sys_job; \ No newline at end of file