计划管理

This commit is contained in:
潘荣晟
2026-01-16 17:03:26 +08:00
parent 38a6b695f0
commit 05de361806
11 changed files with 875 additions and 1 deletions

View File

@@ -0,0 +1,78 @@
package com.zt.plat.module.base.controller.admin.plandate.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 计划数据分页 Request VO")
@Data
public class PlanDatePageReqVO extends PageParam {
@Schema(description = "计划名称", example = "王五")
private String planName;
@Schema(description = "计划编码")
private String planCoding;
@Schema(description = "父级ID", example = "6059")
private Long parentId;
@Schema(description = "年份")
private String year;
@Schema(description = "初始值")
private BigDecimal initialValue;
@Schema(description = "平均值")
private BigDecimal averageValue;
@Schema(description = "合计值")
private BigDecimal sumValue;
@Schema(description = "一月")
private BigDecimal january;
@Schema(description = "二月")
private BigDecimal february;
@Schema(description = "三月")
private BigDecimal march;
@Schema(description = "四月")
private BigDecimal april;
@Schema(description = "五月")
private BigDecimal may;
@Schema(description = "六月")
private BigDecimal june;
@Schema(description = "七月")
private BigDecimal july;
@Schema(description = "八月")
private BigDecimal august;
@Schema(description = "九月")
private BigDecimal september;
@Schema(description = "十月")
private BigDecimal october;
@Schema(description = "十一月")
private BigDecimal november;
@Schema(description = "十二月")
private BigDecimal december;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,78 @@
package com.zt.plat.module.base.controller.admin.plandate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 计划数据新增/修改 Request VO")
@Data
public class PlanDateSaveReqVO {
@Schema(description = "主键 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10584")
private Long id;
@Schema(description = "计划名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "计划名称不能为空")
private String planName;
@Schema(description = "计划编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "计划编码不能为空")
private String planCoding;
@Schema(description = "父级ID", example = "6059")
private Long parentId;
@Schema(description = "年份")
private String year;
@Schema(description = "初始值")
private BigDecimal initialValue;
@Schema(description = "平均值")
private BigDecimal averageValue;
@Schema(description = "合计值")
private BigDecimal sumValue;
@Schema(description = "一月")
private BigDecimal january;
@Schema(description = "二月")
private BigDecimal february;
@Schema(description = "三月")
private BigDecimal march;
@Schema(description = "四月")
private BigDecimal april;
@Schema(description = "五月")
private BigDecimal may;
@Schema(description = "六月")
private BigDecimal june;
@Schema(description = "七月")
private BigDecimal july;
@Schema(description = "八月")
private BigDecimal august;
@Schema(description = "九月")
private BigDecimal september;
@Schema(description = "十月")
private BigDecimal october;
@Schema(description = "十一月")
private BigDecimal november;
@Schema(description = "十二月")
private BigDecimal december;
@Schema(description = "子节点")
private List<PlanDateSaveReqVO> children;
}

View File

@@ -0,0 +1,47 @@
package com.zt.plat.module.base.dal.dao.plandate;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDatePageReqVO;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanDateDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 计划数据 Mapper
*
* @author 后台管理-1
*/
@Mapper
public interface PlanDateMapper extends BaseMapperX<PlanDateDO> {
default PageResult<PlanDateDO> selectPage(PlanDatePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PlanDateDO>()
.likeIfPresent(PlanDateDO::getPlanName, reqVO.getPlanName())
.eqIfPresent(PlanDateDO::getPlanCoding, reqVO.getPlanCoding())
.eqIfPresent(PlanDateDO::getParentId, reqVO.getParentId())
.eqIfPresent(PlanDateDO::getYear, reqVO.getYear())
.eqIfPresent(PlanDateDO::getInitialValue, reqVO.getInitialValue())
.eqIfPresent(PlanDateDO::getAverageValue, reqVO.getAverageValue())
.eqIfPresent(PlanDateDO::getSumValue, reqVO.getSumValue())
.eqIfPresent(PlanDateDO::getJanuary, reqVO.getJanuary())
.eqIfPresent(PlanDateDO::getFebruary, reqVO.getFebruary())
.eqIfPresent(PlanDateDO::getMarch, reqVO.getMarch())
.eqIfPresent(PlanDateDO::getApril, reqVO.getApril())
.eqIfPresent(PlanDateDO::getMay, reqVO.getMay())
.eqIfPresent(PlanDateDO::getJune, reqVO.getJune())
.eqIfPresent(PlanDateDO::getJuly, reqVO.getJuly())
.eqIfPresent(PlanDateDO::getAugust, reqVO.getAugust())
.eqIfPresent(PlanDateDO::getSeptember, reqVO.getSeptember())
.eqIfPresent(PlanDateDO::getOctober, reqVO.getOctober())
.eqIfPresent(PlanDateDO::getNovember, reqVO.getNovember())
.eqIfPresent(PlanDateDO::getDecember, reqVO.getDecember())
.betweenIfPresent(PlanDateDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(PlanDateDO::getId));
}
}

View File

@@ -0,0 +1,78 @@
package com.zt.plat.module.base.service.plandate;
import java.util.*;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDatePageReqVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateRespVO;
import com.zt.plat.module.base.controller.admin.plandate.vo.PlanDateSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.plandate.PlanDateDO;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* 计划数据 Service 接口
*
* @author 后台管理-1
*/
public interface PlanDateService {
/**
* 创建计划数据
*
* @param createReqVO 创建信息
* @return 编号
*/
PlanDateRespVO createPlanDate(@Valid PlanDateSaveReqVO createReqVO);
/**
* 更新计划数据
*
* @param updateReqVO 更新信息
*/
void updatePlanDate(@Valid PlanDateSaveReqVO updateReqVO);
/**
* 删除计划数据
*
* @param id 编号
*/
void deletePlanDate(Long id);
/**
* 批量删除计划数据
*
* @param ids 编号
*/
void deletePlanDateListByIds(List<Long> ids);
/**
* 获得计划数据
*
* @param id 编号
* @return 计划数据
*/
PlanDateDO getPlanDate(Long id);
/**
* 获得计划数据分页
*
* @param pageReqVO 分页查询
* @return 计划数据分页
*/
PageResult<PlanDateDO> getPlanDatePage(PlanDatePageReqVO pageReqVO);
/**
* 创建计划数据
*
* @param createReqVO 创建信息
* @return 编号
*/
PlanDateRespVO createPlanDateWithChildren(PlanDateSaveReqVO createReqVO);
/**
* 获得计划数据树
*
* @return 计划数据树
*/
List<PlanDateRespVO> listPlanDateTree();
}

View File

@@ -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="com.zt.plat.module.bse.dal.dao.plandate.PlanDateMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>