Revert "制度模块按需求修改完成,且通过测试"

This reverts commit 258806b499.
This commit is contained in:
Mr.j 2025-08-04 19:35:00 +08:00
parent 075d1daf02
commit d3e0851413
8 changed files with 17 additions and 36 deletions

View File

@ -19,13 +19,9 @@ public interface RegulationMapper extends BaseMapper<RegulationEntity> {
* @param page 分页参数 * @param page 分页参数
* @param status 状态 * @param status 状态
* @param type 类型 * @param type 类型
* @param title 提案标题
* @param proposer 提案人
* @return 分页结果 * @return 分页结果
*/ */
Page<RegulationEntity> selectRegulationListWithCreator(Page<RegulationEntity> page, Page<RegulationEntity> selectRegulationListWithCreator(Page<RegulationEntity> page,
@Param("status") String status, @Param("status") String status,
@Param("type") String type, @Param("type") String type);
@Param("title") String title,
@Param("proposer") String proposer);
} }

View File

@ -18,12 +18,7 @@ public interface RegulationTypeMapper extends BaseMapper<RegulationTypeEntity> {
* 分页查询制度类型列表包含创建人姓名 * 分页查询制度类型列表包含创建人姓名
* @param page 分页参数 * @param page 分页参数
* @param typeName 类型名称 * @param typeName 类型名称
* @param status 状态
* @param remark 备注
* @return 分页结果 * @return 分页结果
*/ */
Page<RegulationTypeEntity> selectRegulationTypeListWithCreator(Page<RegulationTypeEntity> page, Page<RegulationTypeEntity> selectRegulationTypeListWithCreator(Page<RegulationTypeEntity> page, @Param("typeName") String typeName);
@Param("typeName") String typeName,
@Param("status") String status,
@Param("remark") String remark);
} }

View File

@ -17,11 +17,9 @@ public interface RegulationService extends IService<RegulationEntity> {
* @param pageSize 页大小 * @param pageSize 页大小
* @param status 状态 * @param status 状态
* @param type 类型 * @param type 类型
* @param title 提案标题
* @param proposer 提案人
* @return 结果 * @return 结果
*/ */
Result getRegulationList(Integer page, Integer pageSize, String status, String type, String title, String proposer); Result getRegulationList(Integer page, Integer pageSize, String status, String type);
/** /**
* 创建制度提案 * 创建制度提案

View File

@ -16,11 +16,9 @@ public interface RegulationTypeService extends IService<RegulationTypeEntity> {
* @param page 页码 * @param page 页码
* @param size 页大小 * @param size 页大小
* @param typeName 类型名称 * @param typeName 类型名称
* @param status 状态
* @param remark 备注
* @return 结果 * @return 结果
*/ */
Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark); Result getRegulationTypes(Integer page, Integer size, String typeName);
/** /**
* 创建制度类型 * 创建制度类型

View File

@ -68,12 +68,12 @@ public class RegulationServiceImpl extends ServiceImpl<RegulationMapper, Regulat
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result getRegulationList(Integer page, Integer pageSize, String status, String type, String title, String proposer) { public Result getRegulationList(Integer page, Integer pageSize, String status, String type) {
try { try {
Page<RegulationEntity> pageParam = new Page<>(page, pageSize); Page<RegulationEntity> pageParam = new Page<>(page, pageSize);
// 使用关联查询获取创建人姓名 // 使用关联查询获取创建人姓名
Page<RegulationEntity> result = this.baseMapper.selectRegulationListWithCreator(pageParam, status, type, title, proposer); Page<RegulationEntity> result = this.baseMapper.selectRegulationListWithCreator(pageParam, status, type);
// 如果是获取已发布的制度需要添加确认状态 // 如果是获取已发布的制度需要添加确认状态
if (status != null && "PUBLISHED".equals(status)) { if (status != null && "PUBLISHED".equals(status)) {

View File

@ -5,11 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.Result; import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.domain.entity.RegulationTypeEntity; import com.dite.znpt.domain.entity.RegulationTypeEntity;
import com.dite.znpt.mapper.RegulationMapper; import com.dite.znpt.domain.entity.RegulationEntity;
import com.dite.znpt.mapper.RegulationTypeMapper; import com.dite.znpt.mapper.RegulationTypeMapper;
import com.dite.znpt.mapper.RegulationMapper;
import com.dite.znpt.service.RegulationTypeService; import com.dite.znpt.service.RegulationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -23,20 +24,17 @@ import java.time.LocalDateTime;
@Service @Service
public class RegulationTypeServiceImpl extends ServiceImpl<RegulationTypeMapper, RegulationTypeEntity> implements RegulationTypeService { public class RegulationTypeServiceImpl extends ServiceImpl<RegulationTypeMapper, RegulationTypeEntity> implements RegulationTypeService {
private final RegulationMapper regulationMapper; @Autowired
private RegulationMapper regulationMapper;
public RegulationTypeServiceImpl(RegulationMapper regulationMapper) {
this.regulationMapper = regulationMapper;
}
@Override @Override
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark) { public Result getRegulationTypes(Integer page, Integer size, String typeName) {
try { try {
Page<RegulationTypeEntity> pageParam = new Page<>(page, size); Page<RegulationTypeEntity> pageParam = new Page<>(page, size);
// 使用连表查询获取创建人姓名 // 使用连表查询获取创建人姓名
Page<RegulationTypeEntity> result = this.baseMapper.selectRegulationTypeListWithCreator(pageParam, typeName, status, remark); Page<RegulationTypeEntity> result = this.baseMapper.selectRegulationTypeListWithCreator(pageParam, typeName);
return Result.ok(result); return Result.ok(result);
} catch (Exception e) { } catch (Exception e) {

View File

@ -26,10 +26,8 @@ public class RegulationController {
public Result getRegulationList(@RequestParam(defaultValue = "1") int page, public Result getRegulationList(@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "10") int size, @RequestParam(defaultValue = "10") int size,
@RequestParam(required = false) String status, @RequestParam(required = false) String status,
@RequestParam(required = false) String type, @RequestParam(required = false) String type) {
@RequestParam(required = false) String title, return regulationService.getRegulationList(page, size, status, type);
@RequestParam(required = false) String proposer) {
return regulationService.getRegulationList(page, size, status, type, title, proposer);
} }
@ApiOperation(value = "创建制度提案", httpMethod = "POST") @ApiOperation(value = "创建制度提案", httpMethod = "POST")

View File

@ -25,10 +25,8 @@ public class RegulationTypeController {
@GetMapping @GetMapping
public Result getRegulationTypes(@RequestParam(defaultValue = "1") int page, public Result getRegulationTypes(@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "10") int size, @RequestParam(defaultValue = "10") int size,
@RequestParam(required = false) String typeName, @RequestParam(required = false) String typeName) {
@RequestParam(required = false) String status, return regulationTypeService.getRegulationTypes(page, size, typeName);
@RequestParam(required = false) String remark) {
return regulationTypeService.getRegulationTypes(page, size, typeName, status, remark);
} }
@ApiOperation(value = "创建制度类型", httpMethod = "POST") @ApiOperation(value = "创建制度类型", httpMethod = "POST")