From 163ac1e5dec3828dd97a0f0a9635c7fa29d497c9 Mon Sep 17 00:00:00 2001 From: Qiancheng Zhao <15226586396@163.com> Date: Tue, 23 Jul 2024 18:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0pms=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E3=80=81=E5=BA=94=E6=94=B6=E6=AC=BE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=A4=E9=A1=B9=E5=8A=9F=E8=83=BD=E7=9A=84CRUD?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/pms/codegen-Budget-sql.sql | 55 +++++++++++ sql/pms/codegen-BudgetHistory-sql.sql | 57 +++++++++++ sql/pms/codegen-Receivables-sql.sql | 55 +++++++++++ sql/pms/codegen-ReceivablesHistory-sql.sql | 55 +++++++++++ .../module/pms/enums/ErrorCodeConstants.java | 11 +++ .../admin/budget/BudgetController.java | 95 ++++++++++++++++++ .../admin/budget/vo/BudgetPageReqVO.java | 56 +++++++++++ .../admin/budget/vo/BudgetRespVO.java | 68 +++++++++++++ .../admin/budget/vo/BudgetSaveReqVO.java | 51 ++++++++++ .../BudgetHistoryController.java | 95 ++++++++++++++++++ .../vo/BudgetHistoryPageReqVO.java | 68 +++++++++++++ .../budgethistory/vo/BudgetHistoryRespVO.java | 84 ++++++++++++++++ .../vo/BudgetHistorySaveReqVO.java | 63 ++++++++++++ .../receivables/ReceivablesController.java | 95 ++++++++++++++++++ .../receivables/vo/ReceivablesPageReqVO.java | 46 +++++++++ .../receivables/vo/ReceivablesRespVO.java | 55 +++++++++++ .../receivables/vo/ReceivablesSaveReqVO.java | 40 ++++++++ .../ReceivablesHistoryController.java | 95 ++++++++++++++++++ .../vo/ReceivablesHistoryPageReqVO.java | 58 +++++++++++ .../vo/ReceivablesHistoryRespVO.java | 71 ++++++++++++++ .../vo/ReceivablesHistorySaveReqVO.java | 52 ++++++++++ .../pms/dal/dataobject/budget/BudgetDO.java | 82 ++++++++++++++++ .../budgethistory/BudgetHistoryDO.java | 98 +++++++++++++++++++ .../dataobject/receivables/ReceivablesDO.java | 63 ++++++++++++ .../ReceivablesHistoryDO.java | 79 +++++++++++++++ .../pms/dal/mysql/budget/BudgetMapper.java | 37 +++++++ .../budgethistory/BudgetHistoryMapper.java | 41 ++++++++ .../mysql/receivables/ReceivablesMapper.java | 34 +++++++ .../ReceivablesHistoryMapper.java | 38 +++++++ .../pms/service/budget/BudgetService.java | 55 +++++++++++ .../pms/service/budget/BudgetServiceImpl.java | 74 ++++++++++++++ .../budgethistory/BudgetHistoryService.java | 55 +++++++++++ .../BudgetHistoryServiceImpl.java | 74 ++++++++++++++ .../receivables/ReceivablesService.java | 55 +++++++++++ .../receivables/ReceivablesServiceImpl.java | 74 ++++++++++++++ .../ReceivablesHistoryService.java | 55 +++++++++++ .../ReceivablesHistoryServiceImpl.java | 74 ++++++++++++++ .../src/main/resources/application-local.yaml | 4 +- 38 files changed, 2315 insertions(+), 2 deletions(-) create mode 100644 sql/pms/codegen-Budget-sql.sql create mode 100644 sql/pms/codegen-BudgetHistory-sql.sql create mode 100644 sql/pms/codegen-Receivables-sql.sql create mode 100644 sql/pms/codegen-ReceivablesHistory-sql.sql create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/BudgetController.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetPageReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetRespVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetSaveReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/BudgetHistoryController.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryPageReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryRespVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistorySaveReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/ReceivablesController.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesPageReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesRespVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesSaveReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/ReceivablesHistoryController.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryPageReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryRespVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistorySaveReqVO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budget/BudgetDO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budgethistory/BudgetHistoryDO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivables/ReceivablesDO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivableshistory/ReceivablesHistoryDO.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budget/BudgetMapper.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budgethistory/BudgetHistoryMapper.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivables/ReceivablesMapper.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivableshistory/ReceivablesHistoryMapper.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetService.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetServiceImpl.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryService.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryServiceImpl.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesService.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesServiceImpl.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryService.java create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryServiceImpl.java diff --git a/sql/pms/codegen-Budget-sql.sql b/sql/pms/codegen-Budget-sql.sql new file mode 100644 index 000000000..12ced0edd --- /dev/null +++ b/sql/pms/codegen-Budget-sql.sql @@ -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 +); \ No newline at end of file diff --git a/sql/pms/codegen-BudgetHistory-sql.sql b/sql/pms/codegen-BudgetHistory-sql.sql new file mode 100644 index 000000000..89657c1f9 --- /dev/null +++ b/sql/pms/codegen-BudgetHistory-sql.sql @@ -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 +); diff --git a/sql/pms/codegen-Receivables-sql.sql b/sql/pms/codegen-Receivables-sql.sql new file mode 100644 index 000000000..32156050c --- /dev/null +++ b/sql/pms/codegen-Receivables-sql.sql @@ -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 +); \ No newline at end of file diff --git a/sql/pms/codegen-ReceivablesHistory-sql.sql b/sql/pms/codegen-ReceivablesHistory-sql.sql new file mode 100644 index 000000000..9a0e7bfde --- /dev/null +++ b/sql/pms/codegen-ReceivablesHistory-sql.sql @@ -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 +); \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstants.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstants.java index e1dea1fc9..058bb54fe 100644 --- a/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstants.java +++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/enums/ErrorCodeConstants.java @@ -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, "应收款管理历史记录不存在"); } diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/BudgetController.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/BudgetController.java new file mode 100644 index 000000000..21589f45e --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/BudgetController.java @@ -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 createBudget(@Valid @RequestBody BudgetSaveReqVO createReqVO) { + return success(budgetService.createBudget(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新预算管理") + @PreAuthorize("@ss.hasPermission('pms:budget:update')") + public CommonResult 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 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 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> getBudgetPage(@Valid BudgetPageReqVO pageReqVO) { + PageResult 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 list = budgetService.getBudgetPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "预算管理.xls", "数据", BudgetRespVO.class, + BeanUtils.toBean(list, BudgetRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetPageReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetPageReqVO.java new file mode 100644 index 000000000..de131773f --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetRespVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetRespVO.java new file mode 100644 index 000000000..f7a775463 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetSaveReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetSaveReqVO.java new file mode 100644 index 000000000..f12364657 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budget/vo/BudgetSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/BudgetHistoryController.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/BudgetHistoryController.java new file mode 100644 index 000000000..a00d4fb50 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/BudgetHistoryController.java @@ -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 createBudgetHistory(@Valid @RequestBody BudgetHistorySaveReqVO createReqVO) { + return success(budgetHistoryService.createBudgetHistory(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新历史预算管理") + @PreAuthorize("@ss.hasPermission('pms:budget-history:update')") + public CommonResult 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 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 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> getBudgetHistoryPage(@Valid BudgetHistoryPageReqVO pageReqVO) { + PageResult 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 list = budgetHistoryService.getBudgetHistoryPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "历史预算管理.xls", "数据", BudgetHistoryRespVO.class, + BeanUtils.toBean(list, BudgetHistoryRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryPageReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryPageReqVO.java new file mode 100644 index 000000000..2feb14411 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryRespVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryRespVO.java new file mode 100644 index 000000000..52e630da1 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistoryRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistorySaveReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistorySaveReqVO.java new file mode 100644 index 000000000..c394aa1ea --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/budgethistory/vo/BudgetHistorySaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/ReceivablesController.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/ReceivablesController.java new file mode 100644 index 000000000..4a4f903cc --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/ReceivablesController.java @@ -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 createReceivables(@Valid @RequestBody ReceivablesSaveReqVO createReqVO) { + return success(receivablesService.createReceivables(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新应收款管理") + @PreAuthorize("@ss.hasPermission('pms:receivables:update')") + public CommonResult 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 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 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> getReceivablesPage(@Valid ReceivablesPageReqVO pageReqVO) { + PageResult 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 list = receivablesService.getReceivablesPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "应收款管理.xls", "数据", ReceivablesRespVO.class, + BeanUtils.toBean(list, ReceivablesRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesPageReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesPageReqVO.java new file mode 100644 index 000000000..0e27ab07e --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesRespVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesRespVO.java new file mode 100644 index 000000000..c541f3fdb --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesSaveReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesSaveReqVO.java new file mode 100644 index 000000000..603b926db --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivables/vo/ReceivablesSaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/ReceivablesHistoryController.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/ReceivablesHistoryController.java new file mode 100644 index 000000000..7ddc4f543 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/ReceivablesHistoryController.java @@ -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 createReceivablesHistory(@Valid @RequestBody ReceivablesHistorySaveReqVO createReqVO) { + return success(receivablesHistoryService.createReceivablesHistory(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新应收款管理历史记录") + @PreAuthorize("@ss.hasPermission('pms:receivables-history:update')") + public CommonResult 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 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 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> getReceivablesHistoryPage(@Valid ReceivablesHistoryPageReqVO pageReqVO) { + PageResult 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 list = receivablesHistoryService.getReceivablesHistoryPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "应收款管理历史记录.xls", "数据", ReceivablesHistoryRespVO.class, + BeanUtils.toBean(list, ReceivablesHistoryRespVO.class)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryPageReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryPageReqVO.java new file mode 100644 index 000000000..66f0c5864 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryPageReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryRespVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryRespVO.java new file mode 100644 index 000000000..e5a9bac29 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistoryRespVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistorySaveReqVO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistorySaveReqVO.java new file mode 100644 index 000000000..37d934d4a --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/receivableshistory/vo/ReceivablesHistorySaveReqVO.java @@ -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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budget/BudgetDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budget/BudgetDO.java new file mode 100644 index 000000000..9eaa11b2d --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budget/BudgetDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budgethistory/BudgetHistoryDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budgethistory/BudgetHistoryDO.java new file mode 100644 index 000000000..fcd59d33f --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/budgethistory/BudgetHistoryDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivables/ReceivablesDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivables/ReceivablesDO.java new file mode 100644 index 000000000..d3a73696d --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivables/ReceivablesDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivableshistory/ReceivablesHistoryDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivableshistory/ReceivablesHistoryDO.java new file mode 100644 index 000000000..b88ae2b02 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/receivableshistory/ReceivablesHistoryDO.java @@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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; + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budget/BudgetMapper.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budget/BudgetMapper.java new file mode 100644 index 000000000..41e8b5625 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budget/BudgetMapper.java @@ -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 { + + default PageResult selectPage(BudgetPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budgethistory/BudgetHistoryMapper.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budgethistory/BudgetHistoryMapper.java new file mode 100644 index 000000000..cdf0e2d21 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/budgethistory/BudgetHistoryMapper.java @@ -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 { + + default PageResult selectPage(BudgetHistoryPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivables/ReceivablesMapper.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivables/ReceivablesMapper.java new file mode 100644 index 000000000..106d339f5 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivables/ReceivablesMapper.java @@ -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 { + + default PageResult selectPage(ReceivablesPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivableshistory/ReceivablesHistoryMapper.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivableshistory/ReceivablesHistoryMapper.java new file mode 100644 index 000000000..87b24459d --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/receivableshistory/ReceivablesHistoryMapper.java @@ -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 { + + default PageResult selectPage(ReceivablesHistoryPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetService.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetService.java new file mode 100644 index 000000000..41b5d6da5 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetService.java @@ -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 getBudgetPage(BudgetPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetServiceImpl.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetServiceImpl.java new file mode 100644 index 000000000..edd22cb1c --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budget/BudgetServiceImpl.java @@ -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 getBudgetPage(BudgetPageReqVO pageReqVO) { + return budgetMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryService.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryService.java new file mode 100644 index 000000000..8eeb5d476 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryService.java @@ -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 getBudgetHistoryPage(BudgetHistoryPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryServiceImpl.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryServiceImpl.java new file mode 100644 index 000000000..ea70436e1 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/budgethistory/BudgetHistoryServiceImpl.java @@ -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 getBudgetHistoryPage(BudgetHistoryPageReqVO pageReqVO) { + return budgetHistoryMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesService.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesService.java new file mode 100644 index 000000000..408e30b7e --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesService.java @@ -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 getReceivablesPage(ReceivablesPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesServiceImpl.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesServiceImpl.java new file mode 100644 index 000000000..9873de254 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivables/ReceivablesServiceImpl.java @@ -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 getReceivablesPage(ReceivablesPageReqVO pageReqVO) { + return receivablesMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryService.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryService.java new file mode 100644 index 000000000..7fefd697d --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryService.java @@ -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 getReceivablesHistoryPage(ReceivablesHistoryPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryServiceImpl.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryServiceImpl.java new file mode 100644 index 000000000..3a57c035e --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/receivableshistory/ReceivablesHistoryServiceImpl.java @@ -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 getReceivablesHistoryPage(ReceivablesHistoryPageReqVO pageReqVO) { + return receivablesHistoryMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index ec792afc5..e2ed2e5c0 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -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: