Merge remote-tracking branch 'origin/master'
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
commit
7633239213
@ -52,4 +52,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode NJGL_DATA_STATUS = new ErrorCode(1_011_020_000, "请假审批错误");
|
ErrorCode NJGL_DATA_STATUS = new ErrorCode(1_011_020_000, "请假审批错误");
|
||||||
// ========== 销假管理 1_011_021_000 ==========
|
// ========== 销假管理 1_011_021_000 ==========
|
||||||
ErrorCode NJGL_BACK_DAY = new ErrorCode(1_011_021_000, "销假审批错误");
|
ErrorCode NJGL_BACK_DAY = new ErrorCode(1_011_021_000, "销假审批错误");
|
||||||
|
// ========== 收发文编号 1_011_022_000 ==========
|
||||||
|
ErrorCode NUMBERS_NOT_EXISTS = new ErrorCode(1_011_022_000, "收发文编号不存在");
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.controller.admin.numbers;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.home.controller.admin.numbers.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.home.dal.dataobject.numbers.numbersDO;
|
||||||
|
import cn.iocoder.yudao.module.home.service.numbers.numbersService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 收发文编号")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/home/numbers")
|
||||||
|
@Validated
|
||||||
|
public class numbersController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private numbersService numbersService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建收发文编号")
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:create')")
|
||||||
|
public CommonResult<Long> createnumbers(@Valid @RequestBody numbersSaveReqVO createReqVO) {
|
||||||
|
return success(numbersService.createnumbers(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新收发文编号")
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:update')")
|
||||||
|
public CommonResult<Boolean> updatenumbers(@Valid @RequestBody numbersSaveReqVO updateReqVO) {
|
||||||
|
numbersService.updatenumbers(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除收发文编号")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:delete')")
|
||||||
|
public CommonResult<Boolean> deletenumbers(@RequestParam("id") Long id) {
|
||||||
|
numbersService.deletenumbers(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得收发文编号")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:query')")
|
||||||
|
public CommonResult<numbersRespVO> getnumbers(@RequestParam("id") Long id) {
|
||||||
|
numbersDO numbers = numbersService.getnumbers(id);
|
||||||
|
return success(BeanUtils.toBean(numbers, numbersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得收发文编号分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:query')")
|
||||||
|
public CommonResult<PageResult<numbersRespVO>> getnumbersPage(@Valid numbersPageReqVO pageReqVO) {
|
||||||
|
PageResult<numbersDO> pageResult = numbersService.getnumbersPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, numbersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出收发文编号 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('home:numbers:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportnumbersExcel(@Valid numbersPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<numbersDO> list = numbersService.getnumbersPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "收发文编号.xls", "数据", numbersRespVO.class,
|
||||||
|
BeanUtils.toBean(list, numbersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.controller.admin.numbers.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发文编号分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class numbersPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "id", example = "5552")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "头业务代号")
|
||||||
|
private String fastCode;
|
||||||
|
|
||||||
|
@Schema(description = "头符号")
|
||||||
|
private String fastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "年份")
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
@Schema(description = "月份")
|
||||||
|
private Integer month;
|
||||||
|
|
||||||
|
@Schema(description = "尾符号")
|
||||||
|
private String lastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "顺序号")
|
||||||
|
private Integer docOrder;
|
||||||
|
|
||||||
|
@Schema(description = "尾业务代号")
|
||||||
|
private String lastCode;
|
||||||
|
|
||||||
|
@Schema(description = "启用月份(0=禁用 1=启用)")
|
||||||
|
private Integer enableMonth;
|
||||||
|
|
||||||
|
@Schema(description = "数据类型(0=流水号 1=文号)", example = "2")
|
||||||
|
private Integer numbersType;
|
||||||
|
|
||||||
|
@Schema(description = "长度选择")
|
||||||
|
private Integer lengthSelection;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据1")
|
||||||
|
private String mappingData1;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据2")
|
||||||
|
private String mappingData2;
|
||||||
|
|
||||||
|
@Schema(description = "注解")
|
||||||
|
private String annotation;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.controller.admin.numbers.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发文编号 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class numbersRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5552")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "头业务代号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("头业务代号")
|
||||||
|
private String fastCode;
|
||||||
|
|
||||||
|
@Schema(description = "头符号")
|
||||||
|
@ExcelProperty("头符号")
|
||||||
|
private String fastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("年份")
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
@Schema(description = "月份")
|
||||||
|
@ExcelProperty("月份")
|
||||||
|
private Integer month;
|
||||||
|
|
||||||
|
@Schema(description = "尾符号")
|
||||||
|
@ExcelProperty("尾符号")
|
||||||
|
private String lastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("顺序号")
|
||||||
|
private Integer docOrder;
|
||||||
|
|
||||||
|
@Schema(description = "尾业务代号")
|
||||||
|
@ExcelProperty("尾业务代号")
|
||||||
|
private String lastCode;
|
||||||
|
|
||||||
|
@Schema(description = "启用月份(0=禁用 1=启用)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty(value = "启用月份(0=禁用 1=启用)", converter = DictConvert.class)
|
||||||
|
@DictFormat("oa_numbers_enable_month") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private Integer enableMonth;
|
||||||
|
|
||||||
|
@Schema(description = "数据类型(0=流水号 1=文号)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty(value = "数据类型(0=流水号 1=文号)", converter = DictConvert.class)
|
||||||
|
@DictFormat("oa_numbers_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private Integer numbersType;
|
||||||
|
|
||||||
|
@Schema(description = "长度选择", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty(value = "长度选择", converter = DictConvert.class)
|
||||||
|
@DictFormat("oa_numbers_length") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private Integer lengthSelection;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据1")
|
||||||
|
@ExcelProperty("映射数据1")
|
||||||
|
private String mappingData1;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据2")
|
||||||
|
@ExcelProperty("映射数据2")
|
||||||
|
private String mappingData2;
|
||||||
|
|
||||||
|
@Schema(description = "注解")
|
||||||
|
@ExcelProperty("注解")
|
||||||
|
private String annotation;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.controller.admin.numbers.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发文编号新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class numbersSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5552")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "头业务代号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "头业务代号不能为空")
|
||||||
|
private String fastCode;
|
||||||
|
|
||||||
|
@Schema(description = "头符号")
|
||||||
|
private String fastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "年份不能为空")
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
@Schema(description = "月份")
|
||||||
|
private Integer month;
|
||||||
|
|
||||||
|
@Schema(description = "尾符号")
|
||||||
|
private String lastBrackets;
|
||||||
|
|
||||||
|
@Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "顺序号不能为空")
|
||||||
|
private Integer docOrder;
|
||||||
|
|
||||||
|
@Schema(description = "尾业务代号")
|
||||||
|
private String lastCode;
|
||||||
|
|
||||||
|
@Schema(description = "启用月份(0=禁用 1=启用)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "启用月份(0=禁用 1=启用)不能为空")
|
||||||
|
private Integer enableMonth;
|
||||||
|
|
||||||
|
@Schema(description = "数据类型(0=流水号 1=文号)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotNull(message = "数据类型(0=流水号 1=文号)不能为空")
|
||||||
|
private Integer numbersType;
|
||||||
|
|
||||||
|
@Schema(description = "长度选择", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotNull(message = "长度选择")
|
||||||
|
private Integer lengthSelection;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据1")
|
||||||
|
private String mappingData1;
|
||||||
|
|
||||||
|
@Schema(description = "映射数据2")
|
||||||
|
private String mappingData2;
|
||||||
|
|
||||||
|
@Schema(description = "注解")
|
||||||
|
private String annotation;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.dal.dataobject.numbers;
|
||||||
|
|
||||||
|
import com.sun.xml.bind.v2.TODO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收发文编号 DO
|
||||||
|
*
|
||||||
|
* @author 君风
|
||||||
|
*/
|
||||||
|
@TableName("oa_numbers")
|
||||||
|
@KeySequence("oa_numbers_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class numbersDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 头业务代号
|
||||||
|
*/
|
||||||
|
private String fastCode;
|
||||||
|
/**
|
||||||
|
* 头符号
|
||||||
|
*/
|
||||||
|
private String fastBrackets;
|
||||||
|
/**
|
||||||
|
* 年份
|
||||||
|
*/
|
||||||
|
private Integer year;
|
||||||
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
|
private Integer month;
|
||||||
|
/**
|
||||||
|
* 尾符号
|
||||||
|
*/
|
||||||
|
private String lastBrackets;
|
||||||
|
/**
|
||||||
|
* 顺序号
|
||||||
|
*/
|
||||||
|
private Integer docOrder;
|
||||||
|
/**
|
||||||
|
* 尾业务代号
|
||||||
|
*/
|
||||||
|
private String lastCode;
|
||||||
|
/**
|
||||||
|
* 启用月份(0=禁用 1=启用)
|
||||||
|
*
|
||||||
|
* 枚举 {@link TODO oa_numbers_enable_month 对应的类}
|
||||||
|
*/
|
||||||
|
private Integer enableMonth;
|
||||||
|
/**
|
||||||
|
* 数据类型(0=流水号 1=文号)
|
||||||
|
*
|
||||||
|
* 枚举 {@link TODO oa_numbers_type 对应的类}
|
||||||
|
*/
|
||||||
|
private Integer numbersType;
|
||||||
|
/**
|
||||||
|
* 长度选择
|
||||||
|
* 枚举 {@link TODO oa_numbers_length 对应的类}
|
||||||
|
*/
|
||||||
|
private Integer lengthSelection;
|
||||||
|
/**
|
||||||
|
* 映射数据1
|
||||||
|
*/
|
||||||
|
private String mappingData1;
|
||||||
|
/**
|
||||||
|
* 映射数据2
|
||||||
|
*/
|
||||||
|
private String mappingData2;
|
||||||
|
/**
|
||||||
|
* 注解
|
||||||
|
*/
|
||||||
|
private String annotation;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.dal.mysql.numbers;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.home.dal.dataobject.numbers.numbersDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.home.controller.admin.numbers.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收发文编号 Mapper
|
||||||
|
*
|
||||||
|
* @author 君风
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface numbersMapper extends BaseMapperX<numbersDO> {
|
||||||
|
|
||||||
|
default PageResult<numbersDO> selectPage(numbersPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<numbersDO>()
|
||||||
|
.eqIfPresent(numbersDO::getId, reqVO.getId())
|
||||||
|
.eqIfPresent(numbersDO::getFastCode, reqVO.getFastCode())
|
||||||
|
.eqIfPresent(numbersDO::getFastBrackets, reqVO.getFastBrackets())
|
||||||
|
.eqIfPresent(numbersDO::getYear, reqVO.getYear())
|
||||||
|
.eqIfPresent(numbersDO::getMonth, reqVO.getMonth())
|
||||||
|
.eqIfPresent(numbersDO::getLastBrackets, reqVO.getLastBrackets())
|
||||||
|
.eqIfPresent(numbersDO::getDocOrder, reqVO.getDocOrder())
|
||||||
|
.eqIfPresent(numbersDO::getLastCode, reqVO.getLastCode())
|
||||||
|
.eqIfPresent(numbersDO::getEnableMonth, reqVO.getEnableMonth())
|
||||||
|
.eqIfPresent(numbersDO::getNumbersType, reqVO.getNumbersType())
|
||||||
|
.eqIfPresent(numbersDO::getLengthSelection, reqVO.getLengthSelection())
|
||||||
|
.eqIfPresent(numbersDO::getMappingData1, reqVO.getMappingData1())
|
||||||
|
.eqIfPresent(numbersDO::getMappingData2, reqVO.getMappingData2())
|
||||||
|
.eqIfPresent(numbersDO::getAnnotation, reqVO.getAnnotation())
|
||||||
|
.betweenIfPresent(numbersDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(numbersDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.service.numbers;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.home.controller.admin.numbers.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.home.dal.dataobject.numbers.numbersDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收发文编号 Service 接口
|
||||||
|
*
|
||||||
|
* @author 君风
|
||||||
|
*/
|
||||||
|
public interface numbersService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建收发文编号
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createnumbers(@Valid numbersSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新收发文编号
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updatenumbers(@Valid numbersSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除收发文编号
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deletenumbers(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得收发文编号
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 收发文编号
|
||||||
|
*/
|
||||||
|
numbersDO getnumbers(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得收发文编号分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 收发文编号分页
|
||||||
|
*/
|
||||||
|
PageResult<numbersDO> getnumbersPage(numbersPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package cn.iocoder.yudao.module.home.service.numbers;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.home.controller.admin.numbers.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.home.dal.dataobject.numbers.numbersDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.home.dal.mysql.numbers.numbersMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.home.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收发文编号 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 君风
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class numbersServiceImpl implements numbersService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private numbersMapper numbersMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createnumbers(numbersSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
numbersDO numbers = BeanUtils.toBean(createReqVO, numbersDO.class);
|
||||||
|
numbersMapper.insert(numbers);
|
||||||
|
// 返回
|
||||||
|
return numbers.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatenumbers(numbersSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validatenumbersExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
numbersDO updateObj = BeanUtils.toBean(updateReqVO, numbersDO.class);
|
||||||
|
numbersMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletenumbers(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validatenumbersExists(id);
|
||||||
|
// 删除
|
||||||
|
numbersMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validatenumbersExists(Long id) {
|
||||||
|
if (numbersMapper.selectById(id) == null) {
|
||||||
|
throw exception(NUMBERS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public numbersDO getnumbers(Long id) {
|
||||||
|
return numbersMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<numbersDO> getnumbersPage(numbersPageReqVO pageReqVO) {
|
||||||
|
return numbersMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.home.dal.mysql.numbers.numbersMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user