添加pms预算管理、应收款管理两项功能的CRUD功能

This commit is contained in:
Qiancheng Zhao 2024-07-23 18:05:21 +08:00
parent 391dd0fe83
commit 163ac1e5de
38 changed files with 2315 additions and 2 deletions

View File

@ -0,0 +1,55 @@
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'预算管理管理', '', 2, 0, 2759,
'budget', '', 'pms/budget/index', 0, 'Budget'
);
-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理查询', 'pms:budget:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理创建', 'pms:budget:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理更新', 'pms:budget:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理删除', 'pms:budget:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理导出', 'pms:budget:export', 3, 5, @parentId,
'', '', '', 0
);

View File

@ -0,0 +1,57 @@
-- 历史预算管理
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'历史预算管理管理', '', 2, 0, 2759,
'budget-history', '', 'pms/budgethistory/index', 0, 'BudgetHistory'
);
-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理查询', 'pms:budget-history:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理创建', 'pms:budget-history:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理更新', 'pms:budget-history:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理删除', 'pms:budget-history:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'预算管理导出', 'pms:budget-history:export', 3, 5, @parentId,
'', '', '', 0
);

View File

@ -0,0 +1,55 @@
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'应收款管理管理', '', 2, 0, 2759,
'receivables', '', 'pms/receivables/index', 0, 'Receivables'
);
-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理查询', 'pms:receivables:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理创建', 'pms:receivables:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理更新', 'pms:receivables:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理删除', 'pms:receivables:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理导出', 'pms:receivables:export', 3, 5, @parentId,
'', '', '', 0
);

View File

@ -0,0 +1,55 @@
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'应收款管理历史记录管理', '', 2, 0, 2759,
'receivables-history', '', 'pms/receivableshistory/index', 0, 'ReceivablesHistory'
);
-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理历史记录查询', 'pms:receivables-history:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理历史记录创建', 'pms:receivables-history:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理历史记录更新', 'pms:receivables-history:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理历史记录删除', 'pms:receivables-history:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'应收款管理历史记录导出', 'pms:receivables-history:export', 3, 5, @parentId,
'', '', '', 0
);

View File

@ -13,4 +13,15 @@ public interface ErrorCodeConstants {
// ============ 项目与人员关联关系 =========
ErrorCode PROJECT_USER_NOT_EXISTS = new ErrorCode(1_022_000_000, "项目与人员关联关系不存在");
// ========== 预算管理 1_023_000_000 ==========
ErrorCode BUDGET_NOT_EXISTS = new ErrorCode(1_023_000_000, "预算管理不存在");
// ========== 预算管理 1_023_000_000 ==========
ErrorCode BUDGET_HISTORY_NOT_EXISTS = new ErrorCode(1_023_000_000, "预算管理历史记录不存在");
// ========== 应收款管理 1_024_000_000 ==========
ErrorCode RECEIVABLES_NOT_EXISTS = new ErrorCode(1_024_000_000, "应收款管理不存在");
// ========== 应收款管理历史记录 1_024_000_000 ==========
ErrorCode RECEIVABLES_HISTORY_NOT_EXISTS = new ErrorCode(1_024_000_000, "应收款管理历史记录不存在");
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.pms.controller.admin.budget;
import org.springframework.web.bind.annotation.*;
import jakarta.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 jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.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.pms.controller.admin.budget.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budget.BudgetDO;
import cn.iocoder.yudao.module.pms.service.budget.BudgetService;
@Tag(name = "管理后台 - 预算管理")
@RestController
@RequestMapping("/pms/budget")
@Validated
public class BudgetController {
@Resource
private BudgetService budgetService;
@PostMapping("/create")
@Operation(summary = "创建预算管理")
@PreAuthorize("@ss.hasPermission('pms:budget:create')")
public CommonResult<Long> createBudget(@Valid @RequestBody BudgetSaveReqVO createReqVO) {
return success(budgetService.createBudget(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新预算管理")
@PreAuthorize("@ss.hasPermission('pms:budget:update')")
public CommonResult<Boolean> updateBudget(@Valid @RequestBody BudgetSaveReqVO updateReqVO) {
budgetService.updateBudget(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除预算管理")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('pms:budget:delete')")
public CommonResult<Boolean> deleteBudget(@RequestParam("id") Long id) {
budgetService.deleteBudget(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得预算管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('pms:budget:query')")
public CommonResult<BudgetRespVO> getBudget(@RequestParam("id") Long id) {
BudgetDO budget = budgetService.getBudget(id);
return success(BeanUtils.toBean(budget, BudgetRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得预算管理分页")
@PreAuthorize("@ss.hasPermission('pms:budget:query')")
public CommonResult<PageResult<BudgetRespVO>> getBudgetPage(@Valid BudgetPageReqVO pageReqVO) {
PageResult<BudgetDO> pageResult = budgetService.getBudgetPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, BudgetRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出预算管理 Excel")
@PreAuthorize("@ss.hasPermission('pms:budget:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportBudgetExcel(@Valid BudgetPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<BudgetDO> list = budgetService.getBudgetPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "预算管理.xls", "数据", BudgetRespVO.class,
BeanUtils.toBean(list, BudgetRespVO.class));
}
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.pms.controller.admin.budget.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
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 BudgetPageReqVO extends PageParam {
@Schema(description = "项目id", example = "13470")
private Long projectId;
@Schema(description = "合同管理", example = "20248")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.pms.controller.admin.budget.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 预算管理 Response VO")
@Data
@ExcelIgnoreUnannotated
public class BudgetRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25375")
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13470")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "合同管理", requiredMode = Schema.RequiredMode.REQUIRED, example = "20248")
@ExcelProperty("合同管理")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
@ExcelProperty("预算文件url")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
@ExcelProperty("预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
@ExcelProperty("人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
@ExcelProperty("累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
@ExcelProperty("生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
@ExcelProperty("累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
@ExcelProperty("财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
@ExcelProperty("累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
@ExcelProperty("回款情况")
private String collectionSituation;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,51 @@
package cn.iocoder.yudao.module.pms.controller.admin.budget.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 BudgetSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25375")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13470")
@NotNull(message = "项目id不能为空")
private Long projectId;
@Schema(description = "合同管理", requiredMode = Schema.RequiredMode.REQUIRED, example = "20248")
@NotNull(message = "合同管理不能为空")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
private String collectionSituation;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.pms.controller.admin.budgethistory;
import org.springframework.web.bind.annotation.*;
import jakarta.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 jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.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.pms.controller.admin.budgethistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budgethistory.BudgetHistoryDO;
import cn.iocoder.yudao.module.pms.service.budgethistory.BudgetHistoryService;
@Tag(name = "管理后台 - 历史预算管理")
@RestController
@RequestMapping("/pms/budget-history")
@Validated
public class BudgetHistoryController {
@Resource
private BudgetHistoryService budgetHistoryService;
@PostMapping("/create")
@Operation(summary = "创建历史预算管理")
@PreAuthorize("@ss.hasPermission('pms:budget-history:create')")
public CommonResult<Long> createBudgetHistory(@Valid @RequestBody BudgetHistorySaveReqVO createReqVO) {
return success(budgetHistoryService.createBudgetHistory(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新历史预算管理")
@PreAuthorize("@ss.hasPermission('pms:budget-history:update')")
public CommonResult<Boolean> updateBudgetHistory(@Valid @RequestBody BudgetHistorySaveReqVO updateReqVO) {
budgetHistoryService.updateBudgetHistory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除历史预算管理")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('pms:budget-history:delete')")
public CommonResult<Boolean> deleteBudgetHistory(@RequestParam("id") Long id) {
budgetHistoryService.deleteBudgetHistory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得历史预算管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('pms:budget-history:query')")
public CommonResult<BudgetHistoryRespVO> getBudgetHistory(@RequestParam("id") Long id) {
BudgetHistoryDO budgetHistory = budgetHistoryService.getBudgetHistory(id);
return success(BeanUtils.toBean(budgetHistory, BudgetHistoryRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得历史预算管理分页")
@PreAuthorize("@ss.hasPermission('pms:budget-history:query')")
public CommonResult<PageResult<BudgetHistoryRespVO>> getBudgetHistoryPage(@Valid BudgetHistoryPageReqVO pageReqVO) {
PageResult<BudgetHistoryDO> pageResult = budgetHistoryService.getBudgetHistoryPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, BudgetHistoryRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出历史预算管理 Excel")
@PreAuthorize("@ss.hasPermission('pms:budget-history:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportBudgetHistoryExcel(@Valid BudgetHistoryPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<BudgetHistoryDO> list = budgetHistoryService.getBudgetHistoryPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "历史预算管理.xls", "数据", BudgetHistoryRespVO.class,
BeanUtils.toBean(list, BudgetHistoryRespVO.class));
}
}

View File

@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.pms.controller.admin.budgethistory.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
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 BudgetHistoryPageReqVO extends PageParam {
@Schema(description = "项目id", example = "15123")
private Long projectId;
@Schema(description = "合同管理", example = "23971")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实体id", example = "30893")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
private String processStatus;
@Schema(description = "预算id", example = "24627")
private Long budgetId;
@Schema(description = "版本")
private String version;
}

View File

@ -0,0 +1,84 @@
package cn.iocoder.yudao.module.pms.controller.admin.budgethistory.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 预算管理 Response VO")
@Data
@ExcelIgnoreUnannotated
public class BudgetHistoryRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2972")
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15123")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "合同管理", requiredMode = Schema.RequiredMode.REQUIRED, example = "23971")
@ExcelProperty("合同管理")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
@ExcelProperty("预算文件url")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
@ExcelProperty("预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
@ExcelProperty("人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
@ExcelProperty("累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
@ExcelProperty("生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
@ExcelProperty("累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
@ExcelProperty("财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
@ExcelProperty("累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
@ExcelProperty("回款情况")
private String collectionSituation;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "流程实体id", example = "30893")
@ExcelProperty("流程实体id")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
@ExcelProperty("流程状态")
private String processStatus;
@Schema(description = "预算id", example = "24627")
@ExcelProperty("预算id")
private Long budgetId;
@Schema(description = "版本")
@ExcelProperty("版本")
private String version;
}

View File

@ -0,0 +1,63 @@
package cn.iocoder.yudao.module.pms.controller.admin.budgethistory.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 BudgetHistorySaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2972")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15123")
@NotNull(message = "项目id不能为空")
private Long projectId;
@Schema(description = "合同管理", requiredMode = Schema.RequiredMode.REQUIRED, example = "23971")
@NotNull(message = "合同管理不能为空")
private Long contractId;
@Schema(description = "预算文件url", example = "https://www.iocoder.cn")
private String budgetFileUrl;
@Schema(description = "预算外包成本")
private BigDecimal outsourcingCosts;
@Schema(description = "人力成本")
private BigDecimal laborCosts;
@Schema(description = "累计人力成本")
private BigDecimal accumulatedLaborCosts;
@Schema(description = "生产成本")
private BigDecimal productCosts;
@Schema(description = "累计生产成本")
private BigDecimal accumulatedProductCosts;
@Schema(description = "财务成本")
private BigDecimal financialCosts;
@Schema(description = "累计财务成本")
private BigDecimal accumulatedFinancialCosts;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "流程实体id", example = "30893")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
private String processStatus;
@Schema(description = "预算id", example = "24627")
private Long budgetId;
@Schema(description = "版本")
private String version;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivables;
import org.springframework.web.bind.annotation.*;
import jakarta.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 jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.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.pms.controller.admin.receivables.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivables.ReceivablesDO;
import cn.iocoder.yudao.module.pms.service.receivables.ReceivablesService;
@Tag(name = "管理后台 - 应收款管理")
@RestController
@RequestMapping("/pms/receivables")
@Validated
public class ReceivablesController {
@Resource
private ReceivablesService receivablesService;
@PostMapping("/create")
@Operation(summary = "创建应收款管理")
@PreAuthorize("@ss.hasPermission('pms:receivables:create')")
public CommonResult<Long> createReceivables(@Valid @RequestBody ReceivablesSaveReqVO createReqVO) {
return success(receivablesService.createReceivables(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新应收款管理")
@PreAuthorize("@ss.hasPermission('pms:receivables:update')")
public CommonResult<Boolean> updateReceivables(@Valid @RequestBody ReceivablesSaveReqVO updateReqVO) {
receivablesService.updateReceivables(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除应收款管理")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('pms:receivables:delete')")
public CommonResult<Boolean> deleteReceivables(@RequestParam("id") Long id) {
receivablesService.deleteReceivables(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得应收款管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('pms:receivables:query')")
public CommonResult<ReceivablesRespVO> getReceivables(@RequestParam("id") Long id) {
ReceivablesDO receivables = receivablesService.getReceivables(id);
return success(BeanUtils.toBean(receivables, ReceivablesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得应收款管理分页")
@PreAuthorize("@ss.hasPermission('pms:receivables:query')")
public CommonResult<PageResult<ReceivablesRespVO>> getReceivablesPage(@Valid ReceivablesPageReqVO pageReqVO) {
PageResult<ReceivablesDO> pageResult = receivablesService.getReceivablesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ReceivablesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出应收款管理 Excel")
@PreAuthorize("@ss.hasPermission('pms:receivables:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportReceivablesExcel(@Valid ReceivablesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ReceivablesDO> list = receivablesService.getReceivablesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "应收款管理.xls", "数据", ReceivablesRespVO.class,
BeanUtils.toBean(list, ReceivablesRespVO.class));
}
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivables.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 ReceivablesPageReqVO extends PageParam {
@Schema(description = "项目id")
private Long projectId;
@Schema(description = "主合同id ")
private Long contractId;
@Schema(description = "方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
private String approveStage;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivables.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.*;
@Schema(description = "管理后台 - 应收款管理 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ReceivablesRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "主合同id ")
@ExcelProperty("主合同id ")
private Long contractId;
@Schema(description = "方案阶段比例")
@ExcelProperty("方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
@ExcelProperty("初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
@ExcelProperty("施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
@ExcelProperty("施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
@ExcelProperty("审定阶段")
private String approveStage;
@Schema(description = "回款情况")
@ExcelProperty("回款情况")
private String collectionSituation;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivables.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 应收款管理新增/修改 Request VO")
@Data
public class ReceivablesSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "项目id不能为空")
private Long projectId;
@Schema(description = "主合同id ")
private Long contractId;
@Schema(description = "方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
private String approveStage;
@Schema(description = "回款情况")
private String collectionSituation;
}

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivableshistory;
import org.springframework.web.bind.annotation.*;
import jakarta.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 jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.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.pms.controller.admin.receivableshistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivableshistory.ReceivablesHistoryDO;
import cn.iocoder.yudao.module.pms.service.receivableshistory.ReceivablesHistoryService;
@Tag(name = "管理后台 - 应收款管理历史记录")
@RestController
@RequestMapping("/pms/receivables-history")
@Validated
public class ReceivablesHistoryController {
@Resource
private ReceivablesHistoryService receivablesHistoryService;
@PostMapping("/create")
@Operation(summary = "创建应收款管理历史记录")
@PreAuthorize("@ss.hasPermission('pms:receivables-history:create')")
public CommonResult<Long> createReceivablesHistory(@Valid @RequestBody ReceivablesHistorySaveReqVO createReqVO) {
return success(receivablesHistoryService.createReceivablesHistory(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新应收款管理历史记录")
@PreAuthorize("@ss.hasPermission('pms:receivables-history:update')")
public CommonResult<Boolean> updateReceivablesHistory(@Valid @RequestBody ReceivablesHistorySaveReqVO updateReqVO) {
receivablesHistoryService.updateReceivablesHistory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除应收款管理历史记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('pms:receivables-history:delete')")
public CommonResult<Boolean> deleteReceivablesHistory(@RequestParam("id") Long id) {
receivablesHistoryService.deleteReceivablesHistory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得应收款管理历史记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('pms:receivables-history:query')")
public CommonResult<ReceivablesHistoryRespVO> getReceivablesHistory(@RequestParam("id") Long id) {
ReceivablesHistoryDO receivablesHistory = receivablesHistoryService.getReceivablesHistory(id);
return success(BeanUtils.toBean(receivablesHistory, ReceivablesHistoryRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得应收款管理历史记录分页")
@PreAuthorize("@ss.hasPermission('pms:receivables-history:query')")
public CommonResult<PageResult<ReceivablesHistoryRespVO>> getReceivablesHistoryPage(@Valid ReceivablesHistoryPageReqVO pageReqVO) {
PageResult<ReceivablesHistoryDO> pageResult = receivablesHistoryService.getReceivablesHistoryPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ReceivablesHistoryRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出应收款管理历史记录 Excel")
@PreAuthorize("@ss.hasPermission('pms:receivables-history:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportReceivablesHistoryExcel(@Valid ReceivablesHistoryPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ReceivablesHistoryDO> list = receivablesHistoryService.getReceivablesHistoryPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "应收款管理历史记录.xls", "数据", ReceivablesHistoryRespVO.class,
BeanUtils.toBean(list, ReceivablesHistoryRespVO.class));
}
}

View File

@ -0,0 +1,58 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.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 ReceivablesHistoryPageReqVO extends PageParam {
@Schema(description = "项目id", example = "6633")
private Long projectId;
@Schema(description = "主合同id ", example = "5479")
private Long contractId;
@Schema(description = "方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
private String approveStage;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "流程实体id", example = "4399")
private String processInstanceId;
@Schema(description = "流程状态", example = "1")
private String processStatus;
@Schema(description = "应收款id", example = "22335")
private Long receivableId;
@Schema(description = "版本")
private String version;
}

View File

@ -0,0 +1,71 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.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.*;
@Schema(description = "管理后台 - 应收款管理历史记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ReceivablesHistoryRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20822")
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6633")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "主合同id ", example = "5479")
@ExcelProperty("主合同id ")
private Long contractId;
@Schema(description = "方案阶段比例")
@ExcelProperty("方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
@ExcelProperty("初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
@ExcelProperty("施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
@ExcelProperty("施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
@ExcelProperty("审定阶段")
private String approveStage;
@Schema(description = "回款情况")
@ExcelProperty("回款情况")
private String collectionSituation;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "流程实体id", example = "4399")
@ExcelProperty("流程实体id")
private String processInstanceId;
@Schema(description = "流程状态", example = "1")
@ExcelProperty("流程状态")
private String processStatus;
@Schema(description = "应收款id", example = "22335")
@ExcelProperty("应收款id")
private Long receivableId;
@Schema(description = "版本")
@ExcelProperty("版本")
private String version;
}

View File

@ -0,0 +1,52 @@
package cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 应收款管理历史记录新增/修改 Request VO")
@Data
public class ReceivablesHistorySaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20822")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6633")
@NotNull(message = "项目id不能为空")
private Long projectId;
@Schema(description = "主合同id ", example = "5479")
private Long contractId;
@Schema(description = "方案阶段比例")
private String planStage;
@Schema(description = "初设阶段比例")
private String initialDesignStage;
@Schema(description = "施工图阶段比例")
private String constructionDrawingStage;
@Schema(description = "施工配合阶段")
private String constructionStage;
@Schema(description = "审定阶段")
private String approveStage;
@Schema(description = "回款情况")
private String collectionSituation;
@Schema(description = "流程实体id", example = "4399")
private String processInstanceId;
@Schema(description = "流程状态", example = "1")
private String processStatus;
@Schema(description = "应收款id", example = "22335")
private Long receivableId;
@Schema(description = "版本")
private String version;
}

View File

@ -0,0 +1,82 @@
package cn.iocoder.yudao.module.pms.dal.dataobject.budget;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 预算管理 DO
*
* @author zqc
*/
@TableName("pms_budget")
@KeySequence("pms_budget_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BudgetDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 合同管理
*/
private Long contractId;
/**
* 预算文件url
*/
private String budgetFileUrl;
/**
* 预算外包成本
*/
private BigDecimal outsourcingCosts;
/**
* 人力成本
*/
private BigDecimal laborCosts;
/**
* 累计人力成本
*/
private BigDecimal accumulatedLaborCosts;
/**
* 生产成本
*/
private BigDecimal productCosts;
/**
* 累计生产成本
*/
private BigDecimal accumulatedProductCosts;
/**
* 财务成本
*/
private BigDecimal financialCosts;
/**
* 累计财务成本
*/
private BigDecimal accumulatedFinancialCosts;
/**
* 回款情况
*/
private String collectionSituation;
}

View File

@ -0,0 +1,98 @@
package cn.iocoder.yudao.module.pms.dal.dataobject.budgethistory;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 预算管理 DO
*
* @author zqc
*/
@TableName("pms_budget_history")
@KeySequence("pms_budget_history_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BudgetHistoryDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 合同管理
*/
private Long contractId;
/**
* 预算文件url
*/
private String budgetFileUrl;
/**
* 预算外包成本
*/
private BigDecimal outsourcingCosts;
/**
* 人力成本
*/
private BigDecimal laborCosts;
/**
* 累计人力成本
*/
private BigDecimal accumulatedLaborCosts;
/**
* 生产成本
*/
private BigDecimal productCosts;
/**
* 累计生产成本
*/
private BigDecimal accumulatedProductCosts;
/**
* 财务成本
*/
private BigDecimal financialCosts;
/**
* 累计财务成本
*/
private BigDecimal accumulatedFinancialCosts;
/**
* 回款情况
*/
private String collectionSituation;
/**
* 流程实体id
*/
private String processInstanceId;
/**
* 流程状态
*/
private String processStatus;
/**
* 预算id
*/
private Long budgetId;
/**
* 版本
*/
private String version;
}

View File

@ -0,0 +1,63 @@
package cn.iocoder.yudao.module.pms.dal.dataobject.receivables;
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 zqc
*/
@TableName("pms_receivables")
@KeySequence("pms_receivables_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReceivablesDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 主合同id
*/
private Long contractId;
/**
* 方案阶段比例
*/
private String planStage;
/**
* 初设阶段比例
*/
private String initialDesignStage;
/**
* 施工图阶段比例
*/
private String constructionDrawingStage;
/**
* 施工配合阶段
*/
private String constructionStage;
/**
* 审定阶段
*/
private String approveStage;
/**
* 回款情况
*/
private String collectionSituation;
}

View File

@ -0,0 +1,79 @@
package cn.iocoder.yudao.module.pms.dal.dataobject.receivableshistory;
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 zqc
*/
@TableName("pms_receivables_history")
@KeySequence("pms_receivables_history_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ReceivablesHistoryDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 主合同id
*/
private Long contractId;
/**
* 方案阶段比例
*/
private String planStage;
/**
* 初设阶段比例
*/
private String initialDesignStage;
/**
* 施工图阶段比例
*/
private String constructionDrawingStage;
/**
* 施工配合阶段
*/
private String constructionStage;
/**
* 审定阶段
*/
private String approveStage;
/**
* 回款情况
*/
private String collectionSituation;
/**
* 流程实体id
*/
private String processInstanceId;
/**
* 流程状态
*/
private String processStatus;
/**
* 应收款id
*/
private Long receivableId;
/**
* 版本
*/
private String version;
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.pms.dal.mysql.budget;
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.pms.dal.dataobject.budget.BudgetDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pms.controller.admin.budget.vo.*;
/**
* 预算管理 Mapper
*
* @author zqc
*/
@Mapper
public interface BudgetMapper extends BaseMapperX<BudgetDO> {
default PageResult<BudgetDO> selectPage(BudgetPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BudgetDO>()
.eqIfPresent(BudgetDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(BudgetDO::getContractId, reqVO.getContractId())
.eqIfPresent(BudgetDO::getBudgetFileUrl, reqVO.getBudgetFileUrl())
.eqIfPresent(BudgetDO::getOutsourcingCosts, reqVO.getOutsourcingCosts())
.eqIfPresent(BudgetDO::getLaborCosts, reqVO.getLaborCosts())
.eqIfPresent(BudgetDO::getAccumulatedLaborCosts, reqVO.getAccumulatedLaborCosts())
.eqIfPresent(BudgetDO::getProductCosts, reqVO.getProductCosts())
.eqIfPresent(BudgetDO::getAccumulatedProductCosts, reqVO.getAccumulatedProductCosts())
.eqIfPresent(BudgetDO::getFinancialCosts, reqVO.getFinancialCosts())
.eqIfPresent(BudgetDO::getAccumulatedFinancialCosts, reqVO.getAccumulatedFinancialCosts())
.eqIfPresent(BudgetDO::getCollectionSituation, reqVO.getCollectionSituation())
.betweenIfPresent(BudgetDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BudgetDO::getId));
}
}

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.pms.dal.mysql.budgethistory;
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.pms.dal.dataobject.budgethistory.BudgetHistoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pms.controller.admin.budgethistory.vo.*;
/**
* 预算管理 Mapper
*
* @author zqc
*/
@Mapper
public interface BudgetHistoryMapper extends BaseMapperX<BudgetHistoryDO> {
default PageResult<BudgetHistoryDO> selectPage(BudgetHistoryPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BudgetHistoryDO>()
.eqIfPresent(BudgetHistoryDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(BudgetHistoryDO::getContractId, reqVO.getContractId())
.eqIfPresent(BudgetHistoryDO::getBudgetFileUrl, reqVO.getBudgetFileUrl())
.eqIfPresent(BudgetHistoryDO::getOutsourcingCosts, reqVO.getOutsourcingCosts())
.eqIfPresent(BudgetHistoryDO::getLaborCosts, reqVO.getLaborCosts())
.eqIfPresent(BudgetHistoryDO::getAccumulatedLaborCosts, reqVO.getAccumulatedLaborCosts())
.eqIfPresent(BudgetHistoryDO::getProductCosts, reqVO.getProductCosts())
.eqIfPresent(BudgetHistoryDO::getAccumulatedProductCosts, reqVO.getAccumulatedProductCosts())
.eqIfPresent(BudgetHistoryDO::getFinancialCosts, reqVO.getFinancialCosts())
.eqIfPresent(BudgetHistoryDO::getAccumulatedFinancialCosts, reqVO.getAccumulatedFinancialCosts())
.eqIfPresent(BudgetHistoryDO::getCollectionSituation, reqVO.getCollectionSituation())
.betweenIfPresent(BudgetHistoryDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BudgetHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(BudgetHistoryDO::getProcessStatus, reqVO.getProcessStatus())
.eqIfPresent(BudgetHistoryDO::getBudgetId, reqVO.getBudgetId())
.eqIfPresent(BudgetHistoryDO::getVersion, reqVO.getVersion())
.orderByDesc(BudgetHistoryDO::getId));
}
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.pms.dal.mysql.receivables;
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.pms.dal.dataobject.receivables.ReceivablesDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pms.controller.admin.receivables.vo.*;
/**
* 应收款管理 Mapper
*
* @author zqc
*/
@Mapper
public interface ReceivablesMapper extends BaseMapperX<ReceivablesDO> {
default PageResult<ReceivablesDO> selectPage(ReceivablesPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ReceivablesDO>()
.eqIfPresent(ReceivablesDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(ReceivablesDO::getContractId, reqVO.getContractId())
.eqIfPresent(ReceivablesDO::getPlanStage, reqVO.getPlanStage())
.eqIfPresent(ReceivablesDO::getInitialDesignStage, reqVO.getInitialDesignStage())
.eqIfPresent(ReceivablesDO::getConstructionDrawingStage, reqVO.getConstructionDrawingStage())
.eqIfPresent(ReceivablesDO::getConstructionStage, reqVO.getConstructionStage())
.eqIfPresent(ReceivablesDO::getApproveStage, reqVO.getApproveStage())
.eqIfPresent(ReceivablesDO::getCollectionSituation, reqVO.getCollectionSituation())
.betweenIfPresent(ReceivablesDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ReceivablesDO::getId));
}
}

View File

@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.pms.dal.mysql.receivableshistory;
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.pms.dal.dataobject.receivableshistory.ReceivablesHistoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.vo.*;
/**
* 应收款管理历史记录 Mapper
*
* @author zqc
*/
@Mapper
public interface ReceivablesHistoryMapper extends BaseMapperX<ReceivablesHistoryDO> {
default PageResult<ReceivablesHistoryDO> selectPage(ReceivablesHistoryPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ReceivablesHistoryDO>()
.eqIfPresent(ReceivablesHistoryDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(ReceivablesHistoryDO::getContractId, reqVO.getContractId())
.eqIfPresent(ReceivablesHistoryDO::getPlanStage, reqVO.getPlanStage())
.eqIfPresent(ReceivablesHistoryDO::getInitialDesignStage, reqVO.getInitialDesignStage())
.eqIfPresent(ReceivablesHistoryDO::getConstructionDrawingStage, reqVO.getConstructionDrawingStage())
.eqIfPresent(ReceivablesHistoryDO::getConstructionStage, reqVO.getConstructionStage())
.eqIfPresent(ReceivablesHistoryDO::getApproveStage, reqVO.getApproveStage())
.eqIfPresent(ReceivablesHistoryDO::getCollectionSituation, reqVO.getCollectionSituation())
.betweenIfPresent(ReceivablesHistoryDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ReceivablesHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(ReceivablesHistoryDO::getProcessStatus, reqVO.getProcessStatus())
.eqIfPresent(ReceivablesHistoryDO::getReceivableId, reqVO.getReceivableId())
.eqIfPresent(ReceivablesHistoryDO::getVersion, reqVO.getVersion())
.orderByDesc(ReceivablesHistoryDO::getId));
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.pms.service.budget;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.pms.controller.admin.budget.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budget.BudgetDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 预算管理 Service 接口
*
* @author zqc
*/
public interface BudgetService {
/**
* 创建预算管理
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createBudget(@Valid BudgetSaveReqVO createReqVO);
/**
* 更新预算管理
*
* @param updateReqVO 更新信息
*/
void updateBudget(@Valid BudgetSaveReqVO updateReqVO);
/**
* 删除预算管理
*
* @param id 编号
*/
void deleteBudget(Long id);
/**
* 获得预算管理
*
* @param id 编号
* @return 预算管理
*/
BudgetDO getBudget(Long id);
/**
* 获得预算管理分页
*
* @param pageReqVO 分页查询
* @return 预算管理分页
*/
PageResult<BudgetDO> getBudgetPage(BudgetPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.pms.service.budget;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.pms.controller.admin.budget.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budget.BudgetDO;
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.pms.dal.mysql.budget.BudgetMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.*;
/**
* 预算管理 Service 实现类
*
* @author zqc
*/
@Service
@Validated
public class BudgetServiceImpl implements BudgetService {
@Resource
private BudgetMapper budgetMapper;
@Override
public Long createBudget(BudgetSaveReqVO createReqVO) {
// 插入
BudgetDO budget = BeanUtils.toBean(createReqVO, BudgetDO.class);
budgetMapper.insert(budget);
// 返回
return budget.getId();
}
@Override
public void updateBudget(BudgetSaveReqVO updateReqVO) {
// 校验存在
validateBudgetExists(updateReqVO.getId());
// 更新
BudgetDO updateObj = BeanUtils.toBean(updateReqVO, BudgetDO.class);
budgetMapper.updateById(updateObj);
}
@Override
public void deleteBudget(Long id) {
// 校验存在
validateBudgetExists(id);
// 删除
budgetMapper.deleteById(id);
}
private void validateBudgetExists(Long id) {
if (budgetMapper.selectById(id) == null) {
throw exception(BUDGET_NOT_EXISTS);
}
}
@Override
public BudgetDO getBudget(Long id) {
return budgetMapper.selectById(id);
}
@Override
public PageResult<BudgetDO> getBudgetPage(BudgetPageReqVO pageReqVO) {
return budgetMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.pms.service.budgethistory;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.pms.controller.admin.budgethistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budgethistory.BudgetHistoryDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 预算管理 Service 接口
*
* @author zqc
*/
public interface BudgetHistoryService {
/**
* 创建预算管理
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createBudgetHistory(@Valid BudgetHistorySaveReqVO createReqVO);
/**
* 更新预算管理
*
* @param updateReqVO 更新信息
*/
void updateBudgetHistory(@Valid BudgetHistorySaveReqVO updateReqVO);
/**
* 删除预算管理
*
* @param id 编号
*/
void deleteBudgetHistory(Long id);
/**
* 获得预算管理
*
* @param id 编号
* @return 预算管理
*/
BudgetHistoryDO getBudgetHistory(Long id);
/**
* 获得预算管理分页
*
* @param pageReqVO 分页查询
* @return 预算管理分页
*/
PageResult<BudgetHistoryDO> getBudgetHistoryPage(BudgetHistoryPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.pms.service.budgethistory;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.pms.controller.admin.budgethistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.budgethistory.BudgetHistoryDO;
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.pms.dal.mysql.budgethistory.BudgetHistoryMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.*;
/**
* 预算管理 Service 实现类
*
* @author zqc
*/
@Service
@Validated
public class BudgetHistoryServiceImpl implements BudgetHistoryService {
@Resource
private BudgetHistoryMapper budgetHistoryMapper;
@Override
public Long createBudgetHistory(BudgetHistorySaveReqVO createReqVO) {
// 插入
BudgetHistoryDO budgetHistory = BeanUtils.toBean(createReqVO, BudgetHistoryDO.class);
budgetHistoryMapper.insert(budgetHistory);
// 返回
return budgetHistory.getId();
}
@Override
public void updateBudgetHistory(BudgetHistorySaveReqVO updateReqVO) {
// 校验存在
validateBudgetHistoryExists(updateReqVO.getId());
// 更新
BudgetHistoryDO updateObj = BeanUtils.toBean(updateReqVO, BudgetHistoryDO.class);
budgetHistoryMapper.updateById(updateObj);
}
@Override
public void deleteBudgetHistory(Long id) {
// 校验存在
validateBudgetHistoryExists(id);
// 删除
budgetHistoryMapper.deleteById(id);
}
private void validateBudgetHistoryExists(Long id) {
if (budgetHistoryMapper.selectById(id) == null) {
throw exception(BUDGET_HISTORY_NOT_EXISTS);
}
}
@Override
public BudgetHistoryDO getBudgetHistory(Long id) {
return budgetHistoryMapper.selectById(id);
}
@Override
public PageResult<BudgetHistoryDO> getBudgetHistoryPage(BudgetHistoryPageReqVO pageReqVO) {
return budgetHistoryMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.pms.service.receivables;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.pms.controller.admin.receivables.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivables.ReceivablesDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 应收款管理 Service 接口
*
* @author zqc
*/
public interface ReceivablesService {
/**
* 创建应收款管理
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createReceivables(@Valid ReceivablesSaveReqVO createReqVO);
/**
* 更新应收款管理
*
* @param updateReqVO 更新信息
*/
void updateReceivables(@Valid ReceivablesSaveReqVO updateReqVO);
/**
* 删除应收款管理
*
* @param id 编号
*/
void deleteReceivables(Long id);
/**
* 获得应收款管理
*
* @param id 编号
* @return 应收款管理
*/
ReceivablesDO getReceivables(Long id);
/**
* 获得应收款管理分页
*
* @param pageReqVO 分页查询
* @return 应收款管理分页
*/
PageResult<ReceivablesDO> getReceivablesPage(ReceivablesPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.pms.service.receivables;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.pms.controller.admin.receivables.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivables.ReceivablesDO;
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.pms.dal.mysql.receivables.ReceivablesMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.*;
/**
* 应收款管理 Service 实现类
*
* @author zqc
*/
@Service
@Validated
public class ReceivablesServiceImpl implements ReceivablesService {
@Resource
private ReceivablesMapper receivablesMapper;
@Override
public Long createReceivables(ReceivablesSaveReqVO createReqVO) {
// 插入
ReceivablesDO receivables = BeanUtils.toBean(createReqVO, ReceivablesDO.class);
receivablesMapper.insert(receivables);
// 返回
return receivables.getId();
}
@Override
public void updateReceivables(ReceivablesSaveReqVO updateReqVO) {
// 校验存在
validateReceivablesExists(updateReqVO.getId());
// 更新
ReceivablesDO updateObj = BeanUtils.toBean(updateReqVO, ReceivablesDO.class);
receivablesMapper.updateById(updateObj);
}
@Override
public void deleteReceivables(Long id) {
// 校验存在
validateReceivablesExists(id);
// 删除
receivablesMapper.deleteById(id);
}
private void validateReceivablesExists(Long id) {
if (receivablesMapper.selectById(id) == null) {
throw exception(RECEIVABLES_NOT_EXISTS);
}
}
@Override
public ReceivablesDO getReceivables(Long id) {
return receivablesMapper.selectById(id);
}
@Override
public PageResult<ReceivablesDO> getReceivablesPage(ReceivablesPageReqVO pageReqVO) {
return receivablesMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.pms.service.receivableshistory;
import java.util.*;
import jakarta.validation.*;
import cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivableshistory.ReceivablesHistoryDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 应收款管理历史记录 Service 接口
*
* @author zqc
*/
public interface ReceivablesHistoryService {
/**
* 创建应收款管理历史记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createReceivablesHistory(@Valid ReceivablesHistorySaveReqVO createReqVO);
/**
* 更新应收款管理历史记录
*
* @param updateReqVO 更新信息
*/
void updateReceivablesHistory(@Valid ReceivablesHistorySaveReqVO updateReqVO);
/**
* 删除应收款管理历史记录
*
* @param id 编号
*/
void deleteReceivablesHistory(Long id);
/**
* 获得应收款管理历史记录
*
* @param id 编号
* @return 应收款管理历史记录
*/
ReceivablesHistoryDO getReceivablesHistory(Long id);
/**
* 获得应收款管理历史记录分页
*
* @param pageReqVO 分页查询
* @return 应收款管理历史记录分页
*/
PageResult<ReceivablesHistoryDO> getReceivablesHistoryPage(ReceivablesHistoryPageReqVO pageReqVO);
}

View File

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.pms.service.receivableshistory;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.pms.controller.admin.receivableshistory.vo.*;
import cn.iocoder.yudao.module.pms.dal.dataobject.receivableshistory.ReceivablesHistoryDO;
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.pms.dal.mysql.receivableshistory.ReceivablesHistoryMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstants.*;
/**
* 应收款管理历史记录 Service 实现类
*
* @author zqc
*/
@Service
@Validated
public class ReceivablesHistoryServiceImpl implements ReceivablesHistoryService {
@Resource
private ReceivablesHistoryMapper receivablesHistoryMapper;
@Override
public Long createReceivablesHistory(ReceivablesHistorySaveReqVO createReqVO) {
// 插入
ReceivablesHistoryDO receivablesHistory = BeanUtils.toBean(createReqVO, ReceivablesHistoryDO.class);
receivablesHistoryMapper.insert(receivablesHistory);
// 返回
return receivablesHistory.getId();
}
@Override
public void updateReceivablesHistory(ReceivablesHistorySaveReqVO updateReqVO) {
// 校验存在
validateReceivablesHistoryExists(updateReqVO.getId());
// 更新
ReceivablesHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ReceivablesHistoryDO.class);
receivablesHistoryMapper.updateById(updateObj);
}
@Override
public void deleteReceivablesHistory(Long id) {
// 校验存在
validateReceivablesHistoryExists(id);
// 删除
receivablesHistoryMapper.deleteById(id);
}
private void validateReceivablesHistoryExists(Long id) {
if (receivablesHistoryMapper.selectById(id) == null) {
throw exception(RECEIVABLES_HISTORY_NOT_EXISTS);
}
}
@Override
public ReceivablesHistoryDO getReceivablesHistory(Long id) {
return receivablesHistoryMapper.selectById(id);
}
@Override
public PageResult<ReceivablesHistoryDO> getReceivablesHistoryPage(ReceivablesHistoryPageReqVO pageReqVO) {
return receivablesHistoryMapper.selectPage(pageReqVO);
}
}

View File

@ -54,7 +54,7 @@ spring:
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
username: root
password: 123456
password: we9085@z
# username: sa # SQL Server 连接的示例
# password: Yudao@2024 # SQL Server 连接的示例
# username: SYSDBA # DM 连接的示例
@ -65,7 +65,7 @@ spring:
lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root
password: 123456
password: we9085@z
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
data: