From 95e9dc81c9c397078a8684dfbddc6599436f76fa Mon Sep 17 00:00:00 2001 From: liuhongfeng <291117974@qq.com> Date: Tue, 31 Oct 2023 01:09:40 +0800 Subject: [PATCH] 【修改】回款计划和回款管理统一带上Crm前缀,防止和其他模块冲突。 --- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java | 89 ----------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java | 89 ----------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java | 12 ++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java | 12 ++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java | 19 +++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java | 18 ++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java | 19 +++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java | 18 ++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java | 60 ------------------------------------------------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java | 14 -------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java | 72 ------------------------------------------------------------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java | 59 ----------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java | 57 --------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java | 62 -------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java | 14 -------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java | 72 ------------------------------------------------------------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java | 51 --------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java | 47 ----------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java | 19 ------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java | 18 ------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java | 19 ------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java | 18 ------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java | 34 ++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java | 34 ++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java | 34 ---------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java | 34 ---------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java | 109 ------------------------------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java | 92 -------------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java | 54 ------------------------------------------------------ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java | 49 ------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java | 70 ---------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java | 130 ---------------------------------------------------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java | 71 ----------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java | 139 ------------------------------------------------------------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml | 12 ++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml | 12 ++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml | 12 ------------ yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml | 12 ------------ yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java | 266 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java | 225 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java | 266 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 60 files changed, 2045 insertions(+), 2057 deletions(-) create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java create mode 100644 yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java delete mode 100644 yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java new file mode 100644 index 0000000..4f7d9e6 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivableConvert; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO; +import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivableService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - CRM 回款管理") +@RestController +@RequestMapping("/crm/receivable") +@Validated +public class CrmReceivableController { + + @Resource + private CrmReceivableService crmReceivableService; + + @PostMapping("/create") + @Operation(summary = "创建回款管理") + @PreAuthorize("@ss.hasPermission('crm:receivable:create')") + public CommonResult createReceivable(@Valid @RequestBody CrmReceivableCreateReqVO createReqVO) { + return success(crmReceivableService.createReceivable(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新回款管理") + @PreAuthorize("@ss.hasPermission('crm:receivable:update')") + public CommonResult updateReceivable(@Valid @RequestBody CrmReceivableUpdateReqVO updateReqVO) { + crmReceivableService.updateReceivable(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除回款管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('crm:receivable:delete')") + public CommonResult deleteReceivable(@RequestParam("id") Long id) { + crmReceivableService.deleteReceivable(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得回款管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('crm:receivable:query')") + public CommonResult getReceivable(@RequestParam("id") Long id) { + CrmReceivableDO receivable = crmReceivableService.getReceivable(id); + return success(CrmReceivableConvert.INSTANCE.convert(receivable)); + } + + @GetMapping("/page") + @Operation(summary = "获得回款管理分页") + @PreAuthorize("@ss.hasPermission('crm:receivable:query')") + public CommonResult> getReceivablePage(@Valid CrmReceivablePageReqVO pageVO) { + PageResult pageResult = crmReceivableService.getReceivablePage(pageVO); + return success(CrmReceivableConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出回款管理 Excel") + @PreAuthorize("@ss.hasPermission('crm:receivable:export')") + @OperateLog(type = EXPORT) + public void exportReceivableExcel(@Valid CrmReceivableExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = crmReceivableService.getReceivableList(exportReqVO); + // 导出 Excel + List datas = CrmReceivableConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "回款管理.xls", "数据", CrmReceivableExcelVO.class, datas); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java new file mode 100644 index 0000000..afba2b7 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivablePlanConvert; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivablePlanService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - CRM 回款计划") +@RestController +@RequestMapping("/crm/receivable-plan") +@Validated +public class CrmReceivablePlanController { + + @Resource + private CrmReceivablePlanService crmReceivablePlanService; + + @PostMapping("/create") + @Operation(summary = "创建回款计划") + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:create')") + public CommonResult createReceivablePlan(@Valid @RequestBody CrmReceivablePlanCreateReqVO createReqVO) { + return success(crmReceivablePlanService.createReceivablePlan(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新回款计划") + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:update')") + public CommonResult updateReceivablePlan(@Valid @RequestBody CrmReceivablePlanUpdateReqVO updateReqVO) { + crmReceivablePlanService.updateReceivablePlan(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除回款计划") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:delete')") + public CommonResult deleteReceivablePlan(@RequestParam("id") Long id) { + crmReceivablePlanService.deleteReceivablePlan(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得回款计划") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") + public CommonResult getReceivablePlan(@RequestParam("id") Long id) { + CrmReceivablePlanDO receivablePlan = crmReceivablePlanService.getReceivablePlan(id); + return success(CrmReceivablePlanConvert.INSTANCE.convert(receivablePlan)); + } + + @GetMapping("/page") + @Operation(summary = "获得回款计划分页") + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") + public CommonResult> getReceivablePlanPage(@Valid CrmReceivablePlanPageReqVO pageVO) { + PageResult pageResult = crmReceivablePlanService.getReceivablePlanPage(pageVO); + return success(CrmReceivablePlanConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出回款计划 Excel") + @PreAuthorize("@ss.hasPermission('crm:receivable-plan:export')") + @OperateLog(type = EXPORT) + public void exportReceivablePlanExcel(@Valid CrmReceivablePlanExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = crmReceivablePlanService.getReceivablePlanList(exportReqVO); + // 导出 Excel + List datas = CrmReceivablePlanConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "回款计划.xls", "数据", CrmReceivablePlanExcelVO.class, datas); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java deleted file mode 100644 index c88f31f..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java +++ /dev/null @@ -1,89 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; -import cn.iocoder.yudao.module.crm.service.receivable.ReceivableService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; - -@Tag(name = "管理后台 - CRM 回款管理") -@RestController -@RequestMapping("/crm/receivable") -@Validated -public class ReceivableController { - - @Resource - private ReceivableService receivableService; - - @PostMapping("/create") - @Operation(summary = "创建回款管理") - @PreAuthorize("@ss.hasPermission('crm:receivable:create')") - public CommonResult createReceivable(@Valid @RequestBody ReceivableCreateReqVO createReqVO) { - return success(receivableService.createReceivable(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新回款管理") - @PreAuthorize("@ss.hasPermission('crm:receivable:update')") - public CommonResult updateReceivable(@Valid @RequestBody ReceivableUpdateReqVO updateReqVO) { - receivableService.updateReceivable(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除回款管理") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('crm:receivable:delete')") - public CommonResult deleteReceivable(@RequestParam("id") Long id) { - receivableService.deleteReceivable(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得回款管理") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('crm:receivable:query')") - public CommonResult getReceivable(@RequestParam("id") Long id) { - ReceivableDO receivable = receivableService.getReceivable(id); - return success(ReceivableConvert.INSTANCE.convert(receivable)); - } - - @GetMapping("/page") - @Operation(summary = "获得回款管理分页") - @PreAuthorize("@ss.hasPermission('crm:receivable:query')") - public CommonResult> getReceivablePage(@Valid ReceivablePageReqVO pageVO) { - PageResult pageResult = receivableService.getReceivablePage(pageVO); - return success(ReceivableConvert.INSTANCE.convertPage(pageResult)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出回款管理 Excel") - @PreAuthorize("@ss.hasPermission('crm:receivable:export')") - @OperateLog(type = EXPORT) - public void exportReceivableExcel(@Valid ReceivableExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = receivableService.getReceivableList(exportReqVO); - // 导出 Excel - List datas = ReceivableConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "回款管理.xls", "数据", ReceivableExcelVO.class, datas); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java deleted file mode 100644 index 0c33eb2..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java +++ /dev/null @@ -1,89 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable; - -import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; -import cn.iocoder.yudao.module.crm.service.receivable.ReceivablePlanService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; - -@Tag(name = "管理后台 - CRM 回款计划") -@RestController -@RequestMapping("/crm/receivable-plan") -@Validated -public class ReceivablePlanController { - - @Resource - private ReceivablePlanService receivablePlanService; - - @PostMapping("/create") - @Operation(summary = "创建回款计划") - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:create')") - public CommonResult createReceivablePlan(@Valid @RequestBody ReceivablePlanCreateReqVO createReqVO) { - return success(receivablePlanService.createReceivablePlan(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新回款计划") - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:update')") - public CommonResult updateReceivablePlan(@Valid @RequestBody ReceivablePlanUpdateReqVO updateReqVO) { - receivablePlanService.updateReceivablePlan(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除回款计划") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:delete')") - public CommonResult deleteReceivablePlan(@RequestParam("id") Long id) { - receivablePlanService.deleteReceivablePlan(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得回款计划") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") - public CommonResult getReceivablePlan(@RequestParam("id") Long id) { - ReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(id); - return success(ReceivablePlanConvert.INSTANCE.convert(receivablePlan)); - } - - @GetMapping("/page") - @Operation(summary = "获得回款计划分页") - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") - public CommonResult> getReceivablePlanPage(@Valid ReceivablePlanPageReqVO pageVO) { - PageResult pageResult = receivablePlanService.getReceivablePlanPage(pageVO); - return success(ReceivablePlanConvert.INSTANCE.convertPage(pageResult)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出回款计划 Excel") - @PreAuthorize("@ss.hasPermission('crm:receivable-plan:export')") - @OperateLog(type = EXPORT) - public void exportReceivablePlanExcel(@Valid ReceivablePlanExportReqVO exportReqVO, - HttpServletResponse response) throws IOException { - List list = receivablePlanService.getReceivablePlanList(exportReqVO); - // 导出 Excel - List datas = ReceivablePlanConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "回款计划.xls", "数据", ReceivablePlanExcelVO.class, datas); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java new file mode 100644 index 0000000..24b1d57 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +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; + +/** + * 回款管理 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class CrmReceivableBaseVO { + + @Schema(description = "回款编号",requiredMode = Schema.RequiredMode.REQUIRED, example = "31177") + private String no; + + @Schema(description = "回款计划", example = "31177") + private Long planId; + + @Schema(description = "客户名称", example = "4963") + private Long customerId; + + @Schema(description = "合同名称", example = "30305") + private Long contractId; + + @Schema(description = "审批状态", example = "1") + @InEnum(AuditStatusEnum.class) + private Integer checkStatus; + + @Schema(description = "回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime returnTime; + + @Schema(description = "回款方式", example = "2") + private String returnType; + + @Schema(description = "回款金额", example = "31859") + private Integer price; + + @Schema(description = "负责人", example = "22202") + private Long ownerUserId; + + @Schema(description = "批次", example = "2539") + private Long batchId; + + @Schema(description = "显示顺序") + private Integer sort; + + @Schema(description = "备注", example = "备注") + private String remark; + + @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + private Integer status; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java new file mode 100644 index 0000000..a2d43d8 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "管理后台 - CRM 回款创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivableCreateReqVO extends CrmReceivableBaseVO { + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java new file mode 100644 index 0000000..1bd4614 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.module.system.enums.DictTypeConstants; +import lombok.*; + +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + + +/** + * CRM 回款管理 Excel VO + * + * @author 赤焰 + */ +@Data +public class CrmReceivableExcelVO { + + @ExcelProperty("ID") + private Long id; + + @ExcelProperty("回款编号") + private String no; + + @ExcelProperty("回款计划ID") + private Long planId; + + @ExcelProperty("客户名称") + private Long customerId; + + @ExcelProperty("合同名称") + private Long contractId; + + @ExcelProperty(value = "审批状态", converter = DictConvert.class) + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS) + private Integer checkStatus; + + @ExcelProperty("工作流编号") + private Long processInstanceId; + + @ExcelProperty("回款日期") + private LocalDateTime returnTime; + + @ExcelProperty("回款方式") + private String returnType; + + @ExcelProperty("回款金额") + private Integer price; + + @ExcelProperty("负责人") + private Long ownerUserId; + + @ExcelProperty("批次") + private Long batchId; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat(DictTypeConstants.COMMON_STATUS) + private Integer status; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java new file mode 100644 index 0000000..b674bbc --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +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; + +/** + * @author 赤焰 + */ +@Schema(description = "管理后台 - CRM 回款 Excel 导出 Request VO,参数和 CrmReceivablePageReqVO 是一致的") +@Data +public class CrmReceivableExportReqVO { + + @Schema(description = "回款编号") + private String no; + + @Schema(description = "回款计划", example = "31177") + private Long planId; + + @Schema(description = "客户名称", example = "4963") + private Long customerId; + + @Schema(description = "合同名称", example = "30305") + private Long contractId; + + @Schema(description = "审批状态", example = "1") + private Integer checkStatus; + + @Schema(description = "回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] returnTime; + + @Schema(description = "回款方式", example = "2") + private String returnType; + + @Schema(description = "回款金额", example = "31859") + private Integer price; + + @Schema(description = "负责人", example = "22202") + private Long ownerUserId; + + @Schema(description = "批次", example = "2539") + private Long batchId; + + @Schema(description = "状态", example = "1") + private Integer status; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java new file mode 100644 index 0000000..3a90ed8 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +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 = "管理后台 - CRM 回款分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivablePageReqVO extends PageParam { + + @Schema(description = "回款编号") + private String no; + + @Schema(description = "回款计划ID", example = "31177") + private Long planId; + + @Schema(description = "客户名称", example = "4963") + private Long customerId; + + @Schema(description = "合同名称", example = "30305") + private Long contractId; + + @Schema(description = "审批状态", example = "1") + private Integer checkStatus; + + @Schema(description = "回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] returnTime; + + @Schema(description = "回款方式", example = "2") + private String returnType; + + @Schema(description = "回款金额", example = "31859") + private Integer price; + + @Schema(description = "负责人", example = "22202") + private Long ownerUserId; + + + @Schema(description = "状态", example = "1") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java new file mode 100644 index 0000000..49d0089 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +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; + +/** + * 回款计划 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class CrmReceivablePlanBaseVO { + + @Schema(description = "期数", example = "1") + private Integer period; + + @Schema(description = "回款计划", example = "19852") + private Long receivableId; + + @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + private Integer status; + + @Schema(description = "审批状态", example = "1") + @InEnum(AuditStatusEnum.class) + private Integer checkStatus; + + @Schema(description = "计划回款金额", example = "29675") + private Integer price; + + @Schema(description = "计划回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime returnTime; + + @Schema(description = "提前几天提醒") + private Integer remindDays; + + @Schema(description = "提醒日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime remindTime; + + @Schema(description = "客户名称", example = "18026") + private Long customerId; + + @Schema(description = "合同名称", example = "3473") + private Long contractId; + + @Schema(description = "负责人", example = "17828") + private Long ownerUserId; + + @Schema(description = "显示顺序") + private Integer sort; + + @Schema(description = "备注", example = "备注") + private String remark; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java new file mode 100644 index 0000000..cebfd28 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "管理后台 - CRM 回款计划创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivablePlanCreateReqVO extends CrmReceivablePlanBaseVO { + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java new file mode 100644 index 0000000..a7246e2 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.module.system.enums.DictTypeConstants; +import lombok.*; + +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + + +/** + * CRM 回款计划 Excel VO + * + * @author 芋道源码 + */ +@Data +public class CrmReceivablePlanExcelVO { + + @ExcelProperty("ID") + private Long id; + + @ExcelProperty("期数") + private Integer period; + + @ExcelProperty("回款ID") + private Long receivableId; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat(DictTypeConstants.COMMON_STATUS) + private Integer status; + + @ExcelProperty(value = "审批状态", converter = DictConvert.class) + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS) + private Integer checkStatus; + + //@ExcelProperty("工作流编号") + //private Long processInstanceId; + + @ExcelProperty("计划回款金额") + private Integer price; + + @ExcelProperty("计划回款日期") + private LocalDateTime returnTime; + + @ExcelProperty("提前几天提醒") + private Integer remindDays; + + @ExcelProperty("提醒日期") + private LocalDateTime remindTime; + + @ExcelProperty("客户ID") + private Long customerId; + + @ExcelProperty("合同名称") + private Long contractId; + + @ExcelProperty("负责人") + private Long ownerUserId; + + //@ExcelProperty("显示顺序") + //private Integer sort; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java new file mode 100644 index 0000000..8002d41 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - CRM 回款计划 Excel 导出 Request VO,参数和 CrmReceivablePlanPageReqVO 是一致的") +@Data +public class CrmReceivablePlanExportReqVO { + + @Schema(description = "期数") + private Integer period; + + @Schema(description = "完成状态", example = "2") + private Integer status; + + @Schema(description = "审批状态", example = "1") + private Integer checkStatus; + + @Schema(description = "计划回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] returnTime; + + @Schema(description = "提前几天提醒") + private Integer remindDays; + + @Schema(description = "提醒日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] remindTime; + + @Schema(description = "客户名称", example = "18026") + private Long customerId; + + @Schema(description = "合同名称", example = "3473") + private Long contractId; + + @Schema(description = "负责人", example = "17828") + private Long ownerUserId; + + @Schema(description = "备注", example = "随便") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java new file mode 100644 index 0000000..10e2620 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +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 = "管理后台 - CRM 回款计划分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivablePlanPageReqVO extends PageParam { + + @Schema(description = "完成状态", example = "2") + private Integer status; + + @Schema(description = "审批状态", example = "1") + private Integer checkStatus; + + @Schema(description = "计划回款日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] returnTime; + + @Schema(description = "提醒日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] remindTime; + + @Schema(description = "客户名称", example = "18026") + private Long customerId; + + @Schema(description = "合同名称", example = "3473") + private Long contractId; + + @Schema(description = "负责人", example = "17828") + private Long ownerUserId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java new file mode 100644 index 0000000..243e7f7 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - CRM 回款计划 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivablePlanRespVO extends CrmReceivablePlanBaseVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") + private Long id; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java new file mode 100644 index 0000000..5471cfb --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - CRM 回款计划更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivablePlanUpdateReqVO extends CrmReceivablePlanBaseVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") + @NotNull(message = "ID不能为空") + private Long id; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java new file mode 100644 index 0000000..00d984d --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - CRM 回款 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivableRespVO extends CrmReceivableBaseVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") + private Long id; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime createTime; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java new file mode 100644 index 0000000..d6241f2 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - CRM 回款更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CrmReceivableUpdateReqVO extends CrmReceivableBaseVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") + @NotNull(message = "ID不能为空") + private Long id; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java deleted file mode 100644 index 1e7e7bd..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.framework.common.validation.InEnum; -import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -/** - * 回款管理 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - */ -@Data -public class ReceivableBaseVO { - - @Schema(description = "回款编号",requiredMode = Schema.RequiredMode.REQUIRED, example = "31177") - private String no; - - @Schema(description = "回款计划", example = "31177") - private Long planId; - - @Schema(description = "客户名称", example = "4963") - private Long customerId; - - @Schema(description = "合同名称", example = "30305") - private Long contractId; - - @Schema(description = "审批状态", example = "1") - @InEnum(AuditStatusEnum.class) - private Integer checkStatus; - - @Schema(description = "回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime returnTime; - - @Schema(description = "回款方式", example = "2") - private String returnType; - - @Schema(description = "回款金额", example = "31859") - private Integer price; - - @Schema(description = "负责人", example = "22202") - private Long ownerUserId; - - @Schema(description = "批次", example = "2539") - private Long batchId; - - @Schema(description = "显示顺序") - private Integer sort; - - @Schema(description = "备注", example = "备注") - private String remark; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java deleted file mode 100644 index d38d0bd..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.*; - -@Schema(description = "管理后台 - CRM 回款创建 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivableCreateReqVO extends ReceivableBaseVO { - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java deleted file mode 100644 index a88fa9f..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.module.system.enums.DictTypeConstants; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.LocalDateTime; - -import com.alibaba.excel.annotation.ExcelProperty; -import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; -import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; - - -/** - * CRM 回款管理 Excel VO - * - * @author 赤焰 - */ -@Data -public class ReceivableExcelVO { - - @ExcelProperty("ID") - private Long id; - - @ExcelProperty("回款编号") - private String no; - - @ExcelProperty("回款计划ID") - private Long planId; - - @ExcelProperty("客户名称") - private Long customerId; - - @ExcelProperty("合同名称") - private Long contractId; - - @ExcelProperty(value = "审批状态", converter = DictConvert.class) - @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS) - private Integer checkStatus; - - @ExcelProperty("工作流编号") - private Long processInstanceId; - - @ExcelProperty("回款日期") - private LocalDateTime returnTime; - - @ExcelProperty("回款方式") - private String returnType; - - @ExcelProperty("回款金额") - private Integer price; - - @ExcelProperty("负责人") - private Long ownerUserId; - - @ExcelProperty("批次") - private Long batchId; - - @ExcelProperty(value = "状态", converter = DictConvert.class) - @DictFormat(DictTypeConstants.COMMON_STATUS) - private Integer status; - - @ExcelProperty("备注") - private String remark; - - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java deleted file mode 100644 index f07e4dd..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -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; - -/** - * @author 赤焰 - */ -@Schema(description = "管理后台 - CRM 回款 Excel 导出 Request VO,参数和 ReceivablePageReqVO 是一致的") -@Data -public class ReceivableExportReqVO { - - @Schema(description = "回款编号") - private String no; - - @Schema(description = "回款计划", example = "31177") - private Long planId; - - @Schema(description = "客户名称", example = "4963") - private Long customerId; - - @Schema(description = "合同名称", example = "30305") - private Long contractId; - - @Schema(description = "审批状态", example = "1") - private Integer checkStatus; - - @Schema(description = "回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] returnTime; - - @Schema(description = "回款方式", example = "2") - private String returnType; - - @Schema(description = "回款金额", example = "31859") - private Integer price; - - @Schema(description = "负责人", example = "22202") - private Long ownerUserId; - - @Schema(description = "批次", example = "2539") - private Long batchId; - - @Schema(description = "状态", example = "1") - private Integer status; - - @Schema(description = "备注", example = "随便") - private String remark; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java deleted file mode 100644 index 53cdc49..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java +++ /dev/null @@ -1,57 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - CRM 回款分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivablePageReqVO extends PageParam { - - @Schema(description = "回款编号") - private String no; - - @Schema(description = "回款计划ID", example = "31177") - private Long planId; - - @Schema(description = "客户名称", example = "4963") - private Long customerId; - - @Schema(description = "合同名称", example = "30305") - private Long contractId; - - @Schema(description = "审批状态", example = "1") - private Integer checkStatus; - - @Schema(description = "回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] returnTime; - - @Schema(description = "回款方式", example = "2") - private String returnType; - - @Schema(description = "回款金额", example = "31859") - private Integer price; - - @Schema(description = "负责人", example = "22202") - private Long ownerUserId; - - - @Schema(description = "状态", example = "1") - private Integer status; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java deleted file mode 100644 index 2bd05a6..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java +++ /dev/null @@ -1,62 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.framework.common.validation.InEnum; -import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -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; - -/** - * 回款计划 Base VO,提供给添加、修改、详细的子 VO 使用 - * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 - */ -@Data -public class ReceivablePlanBaseVO { - - @Schema(description = "期数", example = "1") - private Integer period; - - @Schema(description = "回款计划", example = "19852") - private Long receivableId; - - @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - private Integer status; - - @Schema(description = "审批状态", example = "1") - @InEnum(AuditStatusEnum.class) - private Integer checkStatus; - - @Schema(description = "计划回款金额", example = "29675") - private Integer price; - - @Schema(description = "计划回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime returnTime; - - @Schema(description = "提前几天提醒") - private Integer remindDays; - - @Schema(description = "提醒日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime remindTime; - - @Schema(description = "客户名称", example = "18026") - private Long customerId; - - @Schema(description = "合同名称", example = "3473") - private Long contractId; - - @Schema(description = "负责人", example = "17828") - private Long ownerUserId; - - @Schema(description = "显示顺序") - private Integer sort; - - @Schema(description = "备注", example = "备注") - private String remark; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java deleted file mode 100644 index d03e76e..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.*; - -@Schema(description = "管理后台 - CRM 回款计划创建 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivablePlanCreateReqVO extends ReceivablePlanBaseVO { - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java deleted file mode 100644 index 2ff3fd0..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java +++ /dev/null @@ -1,72 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.module.system.enums.DictTypeConstants; -import lombok.*; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.alibaba.excel.annotation.ExcelProperty; -import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; -import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; - - -/** - * CRM 回款计划 Excel VO - * - * @author 芋道源码 - */ -@Data -public class ReceivablePlanExcelVO { - - @ExcelProperty("ID") - private Long id; - - @ExcelProperty("期数") - private Integer period; - - @ExcelProperty("回款ID") - private Long receivableId; - - @ExcelProperty(value = "状态", converter = DictConvert.class) - @DictFormat(DictTypeConstants.COMMON_STATUS) - private Integer status; - - @ExcelProperty(value = "审批状态", converter = DictConvert.class) - @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS) - private Integer checkStatus; - - //@ExcelProperty("工作流编号") - //private Long processInstanceId; - - @ExcelProperty("计划回款金额") - private Integer price; - - @ExcelProperty("计划回款日期") - private LocalDateTime returnTime; - - @ExcelProperty("提前几天提醒") - private Integer remindDays; - - @ExcelProperty("提醒日期") - private LocalDateTime remindTime; - - @ExcelProperty("客户ID") - private Long customerId; - - @ExcelProperty("合同名称") - private Long contractId; - - @ExcelProperty("负责人") - private Long ownerUserId; - - //@ExcelProperty("显示顺序") - //private Integer sort; - - @ExcelProperty("备注") - private String remark; - - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java deleted file mode 100644 index 803e1ed..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java +++ /dev/null @@ -1,51 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.time.LocalDateTime; -import org.springframework.format.annotation.DateTimeFormat; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - CRM 回款计划 Excel 导出 Request VO,参数和 ReceivablePlanPageReqVO 是一致的") -@Data -public class ReceivablePlanExportReqVO { - - @Schema(description = "期数") - private Integer period; - - @Schema(description = "完成状态", example = "2") - private Integer status; - - @Schema(description = "审批状态", example = "1") - private Integer checkStatus; - - @Schema(description = "计划回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] returnTime; - - @Schema(description = "提前几天提醒") - private Integer remindDays; - - @Schema(description = "提醒日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] remindTime; - - @Schema(description = "客户名称", example = "18026") - private Long customerId; - - @Schema(description = "合同名称", example = "3473") - private Long contractId; - - @Schema(description = "负责人", example = "17828") - private Long ownerUserId; - - @Schema(description = "备注", example = "随便") - private String remark; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java deleted file mode 100644 index c92b4e8..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -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 = "管理后台 - CRM 回款计划分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivablePlanPageReqVO extends PageParam { - - @Schema(description = "完成状态", example = "2") - private Integer status; - - @Schema(description = "审批状态", example = "1") - private Integer checkStatus; - - @Schema(description = "计划回款日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] returnTime; - - @Schema(description = "提醒日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] remindTime; - - @Schema(description = "客户名称", example = "18026") - private Long customerId; - - @Schema(description = "合同名称", example = "3473") - private Long contractId; - - @Schema(description = "负责人", example = "17828") - private Long ownerUserId; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java deleted file mode 100644 index ce49d59..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; - -@Schema(description = "管理后台 - CRM 回款计划 Response VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivablePlanRespVO extends ReceivablePlanBaseVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") - private Long id; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - private LocalDateTime createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java deleted file mode 100644 index 1f53953..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; - -@Schema(description = "管理后台 - CRM 回款计划更新 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivablePlanUpdateReqVO extends ReceivablePlanBaseVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") - @NotNull(message = "ID不能为空") - private Long id; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java deleted file mode 100644 index 1646cd5..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; - -@Schema(description = "管理后台 - CRM 回款 Response VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivableRespVO extends ReceivableBaseVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") - private Long id; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - private LocalDateTime createTime; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java deleted file mode 100644 index 008c06b..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java +++ /dev/null @@ -1,18 +0,0 @@ -package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; - -@Schema(description = "管理后台 - CRM 回款更新 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ReceivableUpdateReqVO extends ReceivableBaseVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") - @NotNull(message = "ID不能为空") - private Long id; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java new file mode 100644 index 0000000..23345fb --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.crm.convert.receivable; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; + +/** + * 回款管理 Convert + * + * @author 赤焰 + */ +@Mapper +public interface CrmReceivableConvert { + + CrmReceivableConvert INSTANCE = Mappers.getMapper(CrmReceivableConvert.class); + + CrmReceivableDO convert(CrmReceivableCreateReqVO bean); + + CrmReceivableDO convert(CrmReceivableUpdateReqVO bean); + + CrmReceivableRespVO convert(CrmReceivableDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java new file mode 100644 index 0000000..4b2d65c --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.crm.convert.receivable; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; + +/** + * 回款计划 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface CrmReceivablePlanConvert { + + CrmReceivablePlanConvert INSTANCE = Mappers.getMapper(CrmReceivablePlanConvert.class); + + CrmReceivablePlanDO convert(CrmReceivablePlanCreateReqVO bean); + + CrmReceivablePlanDO convert(CrmReceivablePlanUpdateReqVO bean); + + CrmReceivablePlanRespVO convert(CrmReceivablePlanDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java deleted file mode 100644 index 7f14aad..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.crm.convert.receivable; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; - -/** - * 回款管理 Convert - * - * @author 赤焰 - */ -@Mapper -public interface ReceivableConvert { - - ReceivableConvert INSTANCE = Mappers.getMapper(ReceivableConvert.class); - - ReceivableDO convert(ReceivableCreateReqVO bean); - - ReceivableDO convert(ReceivableUpdateReqVO bean); - - ReceivableRespVO convert(ReceivableDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java deleted file mode 100644 index 81ec646..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.crm.convert.receivable; - -import java.util.*; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; - -/** - * 回款计划 Convert - * - * @author 芋道源码 - */ -@Mapper -public interface ReceivablePlanConvert { - - ReceivablePlanConvert INSTANCE = Mappers.getMapper(ReceivablePlanConvert.class); - - ReceivablePlanDO convert(ReceivablePlanCreateReqVO bean); - - ReceivablePlanDO convert(ReceivablePlanUpdateReqVO bean); - - ReceivablePlanRespVO convert(ReceivablePlanDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - - List convertList02(List list); - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java new file mode 100644 index 0000000..b74507d --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java @@ -0,0 +1,109 @@ +package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +import java.time.LocalDateTime; + +/** + * 回款管理 DO + * + * @author 赤焰 + */ +@TableName("crm_receivable") +@KeySequence("crm_receivable_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CrmReceivableDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 回款编号 + */ + private String no; + /** + * 回款计划 + * + * 对应实体 {@link CrmReceivablePlanDO} + */ + private Long planId; + /** + * 客户ID + * + * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO} + */ + private Long customerId; + /** + * 合同ID + * + * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO} + */ + private Long contractId; + /** + * 审批状态 + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS} + */ + private Integer checkStatus; + /** + * 工作流编号 + * + * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 + */ + private Long processInstanceId; + /** + * 回款日期 + */ + private LocalDateTime returnTime; + /** + * 回款方式 + */ + private String returnType; + /** + * 回款金额 + */ + private Integer price; + /** + * 负责人 + */ + private Long ownerUserId; + /** + * 批次 + */ + private Long batchId; + /** + * 显示顺序 + */ + private Integer sort; + // TODO 芋艿:dataScope、dataScopeDeptIds 在想下; + /** + * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) + */ + private Integer dataScope; + /** + * 数据范围(指定部门数组) + */ + private String dataScopeDeptIds; + /** + * 状态 + * + * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} + * + */ + private Integer status; + /** + * 备注 + */ + private String remark; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java new file mode 100644 index 0000000..4274250 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java @@ -0,0 +1,91 @@ +package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 回款计划 DO + * + * @author 芋道源码 + */ +@TableName("crm_receivable_plan") +@KeySequence("crm_receivable_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CrmReceivablePlanDO extends BaseDO { + + /** + * ID + */ + @TableId + private Long id; + /** + * 期数 + */ + private Integer period; + /** + * 回款ID + */ + private Long receivableId; + /** + * 状态 + * + * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} + * + */ + private Integer status; + /** + * 审批状态 + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS} + */ + private Integer checkStatus; + /** + * 工作流编号 + */ + private Long processInstanceId; + /** + * 计划回款金额 + */ + private Integer price; + /** + * 计划回款日期 + */ + private LocalDateTime returnTime; + /** + * 提前几天提醒 + */ + private Integer remindDays; + /** + * 提醒日期 + */ + private LocalDateTime remindTime; + /** + * 客户ID + */ + private Long customerId; + /** + * 合同ID + */ + private Long contractId; + /** + * 负责人 + */ + private Long ownerUserId; + /** + * 显示顺序 + */ + private Integer sort; + /** + * 备注 + */ + private String remark; + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java deleted file mode 100644 index 0cf2423..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java +++ /dev/null @@ -1,109 +0,0 @@ -package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; - -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.*; - -import java.time.LocalDateTime; - -/** - * 回款管理 DO - * - * @author 赤焰 - */ -@TableName("crm_receivable") -@KeySequence("crm_receivable_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ReceivableDO extends BaseDO { - - /** - * ID - */ - @TableId - private Long id; - /** - * 回款编号 - */ - private String no; - /** - * 回款计划 - * - * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO} - */ - private Long planId; - /** - * 客户ID - * - * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO} - */ - private Long customerId; - /** - * 合同ID - * - * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO} - */ - private Long contractId; - /** - * 审批状态 - * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS} - */ - private Integer checkStatus; - /** - * 工作流编号 - * - * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 - */ - private Long processInstanceId; - /** - * 回款日期 - */ - private LocalDateTime returnTime; - /** - * 回款方式 - */ - private String returnType; - /** - * 回款金额 - */ - private Integer price; - /** - * 负责人 - */ - private Long ownerUserId; - /** - * 批次 - */ - private Long batchId; - /** - * 显示顺序 - */ - private Integer sort; - // TODO 芋艿:dataScope、dataScopeDeptIds 在想下; - /** - * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) - */ - private Integer dataScope; - /** - * 数据范围(指定部门数组) - */ - private String dataScopeDeptIds; - /** - * 状态 - * - * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} - * - */ - private Integer status; - /** - * 备注 - */ - private String remark; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java deleted file mode 100644 index caaee72..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java +++ /dev/null @@ -1,92 +0,0 @@ -package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; - -import lombok.*; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.baomidou.mybatisplus.annotation.*; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; - -/** - * 回款计划 DO - * - * @author 芋道源码 - */ -@TableName("crm_receivable_plan") -@KeySequence("crm_receivable_plan_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ReceivablePlanDO extends BaseDO { - - /** - * ID - */ - @TableId - private Long id; - /** - * 期数 - */ - private Integer period; - /** - * 回款ID - */ - private Long receivableId; - /** - * 状态 - * - * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} - * - */ - private Integer status; - /** - * 审批状态 - * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS} - */ - private Integer checkStatus; - /** - * 工作流编号 - */ - private Long processInstanceId; - /** - * 计划回款金额 - */ - private Integer price; - /** - * 计划回款日期 - */ - private LocalDateTime returnTime; - /** - * 提前几天提醒 - */ - private Integer remindDays; - /** - * 提醒日期 - */ - private LocalDateTime remindTime; - /** - * 客户ID - */ - private Long customerId; - /** - * 合同ID - */ - private Long contractId; - /** - * 负责人 - */ - private Long ownerUserId; - /** - * 显示顺序 - */ - private Integer sort; - /** - * 备注 - */ - private String remark; - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java new file mode 100644 index 0000000..716704f --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.crm.dal.mysql.receivable; + +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.crm.dal.dataobject.receivable.CrmReceivableDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; + +/** + * 回款管理 Mapper + * + * @author 赤焰 + */ +@Mapper +public interface CrmReceivableMapper extends BaseMapperX { + + default PageResult selectPage(CrmReceivablePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo()) + .eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId()) + .eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId()) + .eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus()) + .betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime()) + .eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType()) + .eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice()) + .eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) + .eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(CrmReceivableDO::getId)); + } + + default List selectList(CrmReceivableExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo()) + .eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId()) + .eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId()) + .eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus()) + .betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime()) + .eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType()) + .eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice()) + .eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) + .eqIfPresent(CrmReceivableDO::getBatchId, reqVO.getBatchId()) + .eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus()) + .eqIfPresent(CrmReceivableDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(CrmReceivableDO::getId)); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java new file mode 100644 index 0000000..62b2c0c --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java @@ -0,0 +1,49 @@ +package cn.iocoder.yudao.module.crm.dal.mysql.receivable; + +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.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; + +/** + * 回款计划 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface CrmReceivablePlanMapper extends BaseMapperX { + + default PageResult selectPage(CrmReceivablePlanPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus()) + .eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) + .betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) + .betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) + .eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId()) + .eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) + .betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(CrmReceivablePlanDO::getId)); + } + + default List selectList(CrmReceivablePlanExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(CrmReceivablePlanDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus()) + .eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) + .betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) + .eqIfPresent(CrmReceivablePlanDO::getRemindDays, reqVO.getRemindDays()) + .betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) + .eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId()) + .eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) + .eqIfPresent(CrmReceivablePlanDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(CrmReceivablePlanDO::getId)); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java deleted file mode 100644 index 0ef7165..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.yudao.module.crm.dal.mysql.receivable; - -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.crm.dal.dataobject.receivable.ReceivableDO; -import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; - -/** - * 回款管理 Mapper - * - * @author 赤焰 - */ -@Mapper -public interface ReceivableMapper extends BaseMapperX { - - default PageResult selectPage(ReceivablePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(ReceivableDO::getNo, reqVO.getNo()) - .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId()) - .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId()) - .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId()) - .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus()) - .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime()) - .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType()) - .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice()) - .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) - .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(ReceivableDO::getId)); - } - - default List selectList(ReceivableExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(ReceivableDO::getNo, reqVO.getNo()) - .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId()) - .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId()) - .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId()) - .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus()) - .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime()) - .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType()) - .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice()) - .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId()) - .eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId()) - .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus()) - .eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark()) - .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(ReceivableDO::getId)); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java deleted file mode 100644 index 516f20c..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.yudao.module.crm.dal.mysql.receivable; - -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.crm.dal.dataobject.receivable.ReceivablePlanDO; -import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; - -/** - * 回款计划 Mapper - * - * @author 芋道源码 - */ -@Mapper -public interface ReceivablePlanMapper extends BaseMapperX { - - default PageResult selectPage(ReceivablePlanPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus()) - .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) - .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) - .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) - .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) - .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId()) - .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) - .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(ReceivablePlanDO::getId)); - } - - default List selectList(ReceivablePlanExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .eqIfPresent(ReceivablePlanDO::getPeriod, reqVO.getPeriod()) - .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus()) - .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus()) - .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime()) - .eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays()) - .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime()) - .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId()) - .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId()) - .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId()) - .eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark()) - .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(ReceivablePlanDO::getId)); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java new file mode 100644 index 0000000..b8c472f --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 回款计划 Service 接口 + * + * @author 芋道源码 + */ +public interface CrmReceivablePlanService { + + /** + * 创建回款计划 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createReceivablePlan(@Valid CrmReceivablePlanCreateReqVO createReqVO); + + /** + * 更新回款计划 + * + * @param updateReqVO 更新信息 + */ + void updateReceivablePlan(@Valid CrmReceivablePlanUpdateReqVO updateReqVO); + + /** + * 删除回款计划 + * + * @param id 编号 + */ + void deleteReceivablePlan(Long id); + + /** + * 获得回款计划 + * + * @param id 编号 + * @return 回款计划 + */ + CrmReceivablePlanDO getReceivablePlan(Long id); + + /** + * 获得回款计划列表 + * + * @param ids 编号 + * @return 回款计划列表 + */ + List getReceivablePlanList(Collection ids); + + /** + * 获得回款计划分页 + * + * @param pageReqVO 分页查询 + * @return 回款计划分页 + */ + PageResult getReceivablePlanPage(CrmReceivablePlanPageReqVO pageReqVO); + + /** + * 获得回款计划列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 回款计划列表 + */ + List getReceivablePlanList(CrmReceivablePlanExportReqVO exportReqVO); + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java new file mode 100644 index 0000000..b3497b6 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java @@ -0,0 +1,129 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanCreateReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanExportReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanPageReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanUpdateReqVO; +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivablePlanConvert; +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper; +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; +import cn.iocoder.yudao.module.crm.service.contract.ContractService; +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*; + +/** + * 回款计划 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService { + + @Resource + private CrmReceivablePlanMapper crmReceivablePlanMapper; + @Resource + private ContractService contractService; + @Resource + private CrmCustomerService crmCustomerService; + + @Override + public Long createReceivablePlan(CrmReceivablePlanCreateReqVO createReqVO) { + // 插入 + CrmReceivablePlanDO receivablePlan = CrmReceivablePlanConvert.INSTANCE.convert(createReqVO); + if (ObjectUtil.isNull(receivablePlan.getStatus())){ + receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus()); + } + if (ObjectUtil.isNull(receivablePlan.getCheckStatus())){ + receivablePlan.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue()); + } + + checkReceivablePlan(receivablePlan); + + crmReceivablePlanMapper.insert(receivablePlan); + // 返回 + return receivablePlan.getId(); + } + + private void checkReceivablePlan(CrmReceivablePlanDO receivablePlan) { + + if(ObjectUtil.isNull(receivablePlan.getContractId())){ + throw exception(CONTRACT_NOT_EXISTS); + } + + ContractDO contract = contractService.getContract(receivablePlan.getContractId()); + if(ObjectUtil.isNull(contract)){ + throw exception(CONTRACT_NOT_EXISTS); + } + + CrmCustomerDO customer = crmCustomerService.getCustomer(receivablePlan.getCustomerId()); + if(ObjectUtil.isNull(customer)){ + throw exception(CUSTOMER_NOT_EXISTS); + } + + } + + @Override + public void updateReceivablePlan(CrmReceivablePlanUpdateReqVO updateReqVO) { + // 校验存在 + validateReceivablePlanExists(updateReqVO.getId()); + + // 更新 + CrmReceivablePlanDO updateObj = CrmReceivablePlanConvert.INSTANCE.convert(updateReqVO); + crmReceivablePlanMapper.updateById(updateObj); + } + + @Override + public void deleteReceivablePlan(Long id) { + // 校验存在 + validateReceivablePlanExists(id); + // 删除 + crmReceivablePlanMapper.deleteById(id); + } + + private void validateReceivablePlanExists(Long id) { + if (crmReceivablePlanMapper.selectById(id) == null) { + throw exception(RECEIVABLE_PLAN_NOT_EXISTS); + } + } + + @Override + public CrmReceivablePlanDO getReceivablePlan(Long id) { + return crmReceivablePlanMapper.selectById(id); + } + + @Override + public List getReceivablePlanList(Collection ids) { + if (CollUtil.isEmpty(ids)) { + return ListUtil.empty(); + } + return crmReceivablePlanMapper.selectBatchIds(ids); + } + + @Override + public PageResult getReceivablePlanPage(CrmReceivablePlanPageReqVO pageReqVO) { + return crmReceivablePlanMapper.selectPage(pageReqVO); + } + + @Override + public List getReceivablePlanList(CrmReceivablePlanExportReqVO exportReqVO) { + return crmReceivablePlanMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java new file mode 100644 index 0000000..8875faa --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import java.util.*; +import javax.validation.*; + +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 回款管理 Service 接口 + * + * @author 赤焰 + */ +public interface CrmReceivableService { + + /** + * 创建回款管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createReceivable(@Valid CrmReceivableCreateReqVO createReqVO); + + /** + * 更新回款管理 + * + * @param updateReqVO 更新信息 + */ + void updateReceivable(@Valid CrmReceivableUpdateReqVO updateReqVO); + + /** + * 删除回款管理 + * + * @param id 编号 + */ + void deleteReceivable(Long id); + + /** + * 获得回款管理 + * + * @param id 编号 + * @return 回款管理 + */ + CrmReceivableDO getReceivable(Long id); + + /** + * 获得回款管理列表 + * + * @param ids 编号 + * @return 回款管理列表 + */ + List getReceivableList(Collection ids); + + /** + * 获得回款管理分页 + * + * @param pageReqVO 分页查询 + * @return 回款管理分页 + */ + PageResult getReceivablePage(CrmReceivablePageReqVO pageReqVO); + + /** + * 获得回款管理列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 回款管理列表 + */ + List getReceivableList(CrmReceivableExportReqVO exportReqVO); + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java new file mode 100644 index 0000000..ff751bc --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java @@ -0,0 +1,138 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableCreateReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableExportReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePageReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableUpdateReqVO; +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivableConvert; +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper; +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; +import cn.iocoder.yudao.module.crm.service.contract.ContractService; +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*; + +/** + * 回款管理 Service 实现类 + * + * @author 赤焰 + */ +@Service +@Validated +public class CrmReceivableServiceImpl implements CrmReceivableService { + + @Resource + private CrmReceivableMapper crmReceivableMapper; + @Resource + private ContractService contractService; + @Resource + private CrmCustomerService crmCustomerService; + @Resource + private CrmReceivablePlanService crmReceivablePlanService; + + @Override + public Long createReceivable(CrmReceivableCreateReqVO createReqVO) { + // 插入 + CrmReceivableDO receivable = CrmReceivableConvert.INSTANCE.convert(createReqVO); + if (ObjectUtil.isNull(receivable.getStatus())){ + receivable.setStatus(CommonStatusEnum.ENABLE.getStatus()); + } + if (ObjectUtil.isNull(receivable.getCheckStatus())){ + receivable.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue()); + } + + //校验 + checkReceivable(receivable); + + crmReceivableMapper.insert(receivable); + // 返回 + return receivable.getId(); + } + + private void checkReceivable(CrmReceivableDO receivable) { + + if(ObjectUtil.isNull(receivable.getContractId())){ + throw exception(CONTRACT_NOT_EXISTS); + } + + ContractDO contract = contractService.getContract(receivable.getContractId()); + if(ObjectUtil.isNull(contract)){ + throw exception(CONTRACT_NOT_EXISTS); + } + + CrmCustomerDO customer = crmCustomerService.getCustomer(receivable.getCustomerId()); + if(ObjectUtil.isNull(customer)){ + throw exception(CUSTOMER_NOT_EXISTS); + } + + CrmReceivablePlanDO receivablePlan = crmReceivablePlanService.getReceivablePlan(receivable.getPlanId()); + if(ObjectUtil.isNull(receivablePlan)){ + throw exception(RECEIVABLE_PLAN_NOT_EXISTS); + } + + } + + @Override + public void updateReceivable(CrmReceivableUpdateReqVO updateReqVO) { + // 校验存在 + validateReceivableExists(updateReqVO.getId()); + + // 更新 + CrmReceivableDO updateObj = CrmReceivableConvert.INSTANCE.convert(updateReqVO); + crmReceivableMapper.updateById(updateObj); + } + + @Override + public void deleteReceivable(Long id) { + // 校验存在 + validateReceivableExists(id); + // 删除 + crmReceivableMapper.deleteById(id); + } + + private void validateReceivableExists(Long id) { + if (crmReceivableMapper.selectById(id) == null) { + throw exception(RECEIVABLE_NOT_EXISTS); + } + } + + @Override + public CrmReceivableDO getReceivable(Long id) { + return crmReceivableMapper.selectById(id); + } + + @Override + public List getReceivableList(Collection ids) { + if (CollUtil.isEmpty(ids)) { + return ListUtil.empty(); + } + return crmReceivableMapper.selectBatchIds(ids); + } + + @Override + public PageResult getReceivablePage(CrmReceivablePageReqVO pageReqVO) { + return crmReceivableMapper.selectPage(pageReqVO); + } + + @Override + public List getReceivableList(CrmReceivableExportReqVO exportReqVO) { + return crmReceivableMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java deleted file mode 100644 index 163ebc2..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import java.util.*; -import javax.validation.*; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -/** - * 回款计划 Service 接口 - * - * @author 芋道源码 - */ -public interface ReceivablePlanService { - - /** - * 创建回款计划 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createReceivablePlan(@Valid ReceivablePlanCreateReqVO createReqVO); - - /** - * 更新回款计划 - * - * @param updateReqVO 更新信息 - */ - void updateReceivablePlan(@Valid ReceivablePlanUpdateReqVO updateReqVO); - - /** - * 删除回款计划 - * - * @param id 编号 - */ - void deleteReceivablePlan(Long id); - - /** - * 获得回款计划 - * - * @param id 编号 - * @return 回款计划 - */ - ReceivablePlanDO getReceivablePlan(Long id); - - /** - * 获得回款计划列表 - * - * @param ids 编号 - * @return 回款计划列表 - */ - List getReceivablePlanList(Collection ids); - - /** - * 获得回款计划分页 - * - * @param pageReqVO 分页查询 - * @return 回款计划分页 - */ - PageResult getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO); - - /** - * 获得回款计划列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 回款计划列表 - */ - List getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO); - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java deleted file mode 100644 index f8493a1..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.ListUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO; -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert; -import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; -import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; -import cn.iocoder.yudao.module.crm.service.contract.ContractService; -import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import javax.annotation.Resource; -import java.util.Collection; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*; - -/** - * 回款计划 Service 实现类 - * - * @author 芋道源码 - */ -@Service -@Validated -public class ReceivablePlanServiceImpl implements ReceivablePlanService { - - @Resource - private ReceivablePlanMapper receivablePlanMapper; - @Resource - private ContractService contractService; - @Resource - private CrmCustomerService crmCustomerService; - - @Override - public Long createReceivablePlan(ReceivablePlanCreateReqVO createReqVO) { - // 插入 - ReceivablePlanDO receivablePlan = ReceivablePlanConvert.INSTANCE.convert(createReqVO); - if (ObjectUtil.isNull(receivablePlan.getStatus())){ - receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus()); - } - if (ObjectUtil.isNull(receivablePlan.getCheckStatus())){ - receivablePlan.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue()); - } - - checkReceivablePlan(receivablePlan); - - receivablePlanMapper.insert(receivablePlan); - // 返回 - return receivablePlan.getId(); - } - - private void checkReceivablePlan(ReceivablePlanDO receivablePlan) { - - if(ObjectUtil.isNull(receivablePlan.getContractId())){ - throw exception(CONTRACT_NOT_EXISTS); - } - - ContractDO contract = contractService.getContract(receivablePlan.getContractId()); - if(ObjectUtil.isNull(contract)){ - throw exception(CONTRACT_NOT_EXISTS); - } - - CrmCustomerDO customer = crmCustomerService.getCustomer(receivablePlan.getCustomerId()); - if(ObjectUtil.isNull(customer)){ - throw exception(CUSTOMER_NOT_EXISTS); - } - - } - - @Override - public void updateReceivablePlan(ReceivablePlanUpdateReqVO updateReqVO) { - // 校验存在 - validateReceivablePlanExists(updateReqVO.getId()); - - // 更新 - ReceivablePlanDO updateObj = ReceivablePlanConvert.INSTANCE.convert(updateReqVO); - receivablePlanMapper.updateById(updateObj); - } - - @Override - public void deleteReceivablePlan(Long id) { - // 校验存在 - validateReceivablePlanExists(id); - // 删除 - receivablePlanMapper.deleteById(id); - } - - private void validateReceivablePlanExists(Long id) { - if (receivablePlanMapper.selectById(id) == null) { - throw exception(RECEIVABLE_PLAN_NOT_EXISTS); - } - } - - @Override - public ReceivablePlanDO getReceivablePlan(Long id) { - return receivablePlanMapper.selectById(id); - } - - @Override - public List getReceivablePlanList(Collection ids) { - if (CollUtil.isEmpty(ids)) { - return ListUtil.empty(); - } - return receivablePlanMapper.selectBatchIds(ids); - } - - @Override - public PageResult getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO) { - return receivablePlanMapper.selectPage(pageReqVO); - } - - @Override - public List getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO) { - return receivablePlanMapper.selectList(exportReqVO); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java deleted file mode 100644 index a673ec9..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java +++ /dev/null @@ -1,71 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import java.util.*; -import javax.validation.*; - -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -/** - * 回款管理 Service 接口 - * - * @author 赤焰 - */ -public interface ReceivableService { - - /** - * 创建回款管理 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createReceivable(@Valid ReceivableCreateReqVO createReqVO); - - /** - * 更新回款管理 - * - * @param updateReqVO 更新信息 - */ - void updateReceivable(@Valid ReceivableUpdateReqVO updateReqVO); - - /** - * 删除回款管理 - * - * @param id 编号 - */ - void deleteReceivable(Long id); - - /** - * 获得回款管理 - * - * @param id 编号 - * @return 回款管理 - */ - ReceivableDO getReceivable(Long id); - - /** - * 获得回款管理列表 - * - * @param ids 编号 - * @return 回款管理列表 - */ - List getReceivableList(Collection ids); - - /** - * 获得回款管理分页 - * - * @param pageReqVO 分页查询 - * @return 回款管理分页 - */ - PageResult getReceivablePage(ReceivablePageReqVO pageReqVO); - - /** - * 获得回款管理列表, 用于 Excel 导出 - * - * @param exportReqVO 查询条件 - * @return 回款管理列表 - */ - List getReceivableList(ReceivableExportReqVO exportReqVO); - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java b/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java deleted file mode 100644 index d3c7a16..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.ListUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO; -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert; -import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper; -import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum; -import cn.iocoder.yudao.module.crm.service.contract.ContractService; -import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import javax.annotation.Resource; -import java.util.Collection; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*; - -/** - * 回款管理 Service 实现类 - * - * @author 赤焰 - */ -@Service -@Validated -public class ReceivableServiceImpl implements ReceivableService { - - @Resource - private ReceivableMapper receivableMapper; - @Resource - private ContractService contractService; - @Resource - private CrmCustomerService crmCustomerService; - @Resource - private ReceivablePlanService receivablePlanService; - - @Override - public Long createReceivable(ReceivableCreateReqVO createReqVO) { - // 插入 - ReceivableDO receivable = ReceivableConvert.INSTANCE.convert(createReqVO); - if (ObjectUtil.isNull(receivable.getStatus())){ - receivable.setStatus(CommonStatusEnum.ENABLE.getStatus()); - } - if (ObjectUtil.isNull(receivable.getCheckStatus())){ - receivable.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue()); - } - - //校验 - checkReceivable(receivable); - - receivableMapper.insert(receivable); - // 返回 - return receivable.getId(); - } - - private void checkReceivable(ReceivableDO receivable) { - - if(ObjectUtil.isNull(receivable.getContractId())){ - throw exception(CONTRACT_NOT_EXISTS); - } - - ContractDO contract = contractService.getContract(receivable.getContractId()); - if(ObjectUtil.isNull(contract)){ - throw exception(CONTRACT_NOT_EXISTS); - } - - CrmCustomerDO customer = crmCustomerService.getCustomer(receivable.getCustomerId()); - if(ObjectUtil.isNull(customer)){ - throw exception(CUSTOMER_NOT_EXISTS); - } - - ReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(receivable.getPlanId()); - if(ObjectUtil.isNull(receivablePlan)){ - throw exception(RECEIVABLE_PLAN_NOT_EXISTS); - } - - } - - @Override - public void updateReceivable(ReceivableUpdateReqVO updateReqVO) { - // 校验存在 - validateReceivableExists(updateReqVO.getId()); - - // 更新 - ReceivableDO updateObj = ReceivableConvert.INSTANCE.convert(updateReqVO); - receivableMapper.updateById(updateObj); - } - - @Override - public void deleteReceivable(Long id) { - // 校验存在 - validateReceivableExists(id); - // 删除 - receivableMapper.deleteById(id); - } - - private void validateReceivableExists(Long id) { - if (receivableMapper.selectById(id) == null) { - throw exception(RECEIVABLE_NOT_EXISTS); - } - } - - @Override - public ReceivableDO getReceivable(Long id) { - return receivableMapper.selectById(id); - } - - @Override - public List getReceivableList(Collection ids) { - if (CollUtil.isEmpty(ids)) { - return ListUtil.empty(); - } - return receivableMapper.selectBatchIds(ids); - } - - @Override - public PageResult getReceivablePage(ReceivablePageReqVO pageReqVO) { - return receivableMapper.selectPage(pageReqVO); - } - - @Override - public List getReceivableList(ReceivableExportReqVO exportReqVO) { - return receivableMapper.selectList(exportReqVO); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml new file mode 100644 index 0000000..b2ab204 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml new file mode 100644 index 0000000..3b18148 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml deleted file mode 100644 index b87beb0..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml b/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml deleted file mode 100644 index f0e4c2e..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java new file mode 100644 index 0000000..09993f8 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java @@ -0,0 +1,225 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanCreateReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanExportReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanPageReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanUpdateReqVO; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO; +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PLAN_NOT_EXISTS; +import static org.junit.jupiter.api.Assertions.*; + +// TODO 芋艿:后续,需要补充测试用例 +/** + * {@link CrmReceivablePlanServiceImpl} 的单元测试类 + * + * @author 芋道源码 + */ +@Import(CrmReceivablePlanServiceImpl.class) +public class CrmCrmReceivablePlanServiceImplTest extends BaseDbUnitTest { + + @Resource + private CrmReceivablePlanServiceImpl receivablePlanService; + + @Resource + private CrmReceivablePlanMapper crmReceivablePlanMapper; + + @Test + public void testCreateReceivablePlan_success() { + // 准备参数 + CrmReceivablePlanCreateReqVO reqVO = randomPojo(CrmReceivablePlanCreateReqVO.class); + + // 调用 + Long receivablePlanId = receivablePlanService.createReceivablePlan(reqVO); + // 断言 + assertNotNull(receivablePlanId); + // 校验记录的属性是否正确 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanMapper.selectById(receivablePlanId); + assertPojoEquals(reqVO, receivablePlan); + } + + @Test + public void testUpdateReceivablePlan_success() { + // mock 数据 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class); + crmReceivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 + // 准备参数 + CrmReceivablePlanUpdateReqVO reqVO = randomPojo(CrmReceivablePlanUpdateReqVO.class, o -> { + o.setId(dbReceivablePlan.getId()); // 设置更新的 ID + }); + + // 调用 + receivablePlanService.updateReceivablePlan(reqVO); + // 校验是否更新正确 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, receivablePlan); + } + + @Test + public void testUpdateReceivablePlan_notExists() { + // 准备参数 + CrmReceivablePlanUpdateReqVO reqVO = randomPojo(CrmReceivablePlanUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> receivablePlanService.updateReceivablePlan(reqVO), RECEIVABLE_PLAN_NOT_EXISTS); + } + + @Test + public void testDeleteReceivablePlan_success() { + // mock 数据 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class); + crmReceivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbReceivablePlan.getId(); + + // 调用 + receivablePlanService.deleteReceivablePlan(id); + // 校验数据不存在了 + assertNull(crmReceivablePlanMapper.selectById(id)); + } + + @Test + public void testDeleteReceivablePlan_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> receivablePlanService.deleteReceivablePlan(id), RECEIVABLE_PLAN_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetReceivablePlanPage() { + // mock 数据 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class, o -> { // 等会查询到 + o.setPeriod(null); + o.setStatus(null); + o.setCheckStatus(null); + o.setReturnTime(null); + o.setRemindDays(null); + o.setRemindTime(null); + o.setCustomerId(null); + o.setContractId(null); + o.setOwnerUserId(null); + o.setRemark(null); + o.setCreateTime(null); + }); + crmReceivablePlanMapper.insert(dbReceivablePlan); + // 测试 Period 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null))); + // 测试 status 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); + // 测试 checkStatus 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); + // 测试 returnTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); + // 测试 remindDays 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); + // 测试 remindTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); + // 测试 customerId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); + // 测试 contractId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); + // 测试 ownerUserId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); + // 测试 remark 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); + // 测试 createTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); + // 准备参数 + CrmReceivablePlanPageReqVO reqVO = new CrmReceivablePlanPageReqVO(); + reqVO.setStatus(null); + reqVO.setCheckStatus(null); + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setCustomerId(null); + reqVO.setContractId(null); + reqVO.setOwnerUserId(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + PageResult pageResult = receivablePlanService.getReceivablePlanPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbReceivablePlan, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetReceivablePlanList() { + // mock 数据 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class, o -> { // 等会查询到 + o.setPeriod(null); + o.setStatus(null); + o.setCheckStatus(null); + o.setReturnTime(null); + o.setRemindDays(null); + o.setRemindTime(null); + o.setCustomerId(null); + o.setContractId(null); + o.setOwnerUserId(null); + o.setRemark(null); + o.setCreateTime(null); + }); + crmReceivablePlanMapper.insert(dbReceivablePlan); + // 测试 Period 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null))); + // 测试 status 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); + // 测试 checkStatus 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); + // 测试 returnTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); + // 测试 remindDays 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); + // 测试 remindTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); + // 测试 customerId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); + // 测试 contractId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); + // 测试 ownerUserId 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); + // 测试 remark 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); + // 测试 createTime 不匹配 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); + // 准备参数 + CrmReceivablePlanExportReqVO reqVO = new CrmReceivablePlanExportReqVO(); + reqVO.setPeriod(null); + reqVO.setStatus(null); + reqVO.setCheckStatus(null); + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setRemindDays(null); + reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setCustomerId(null); + reqVO.setContractId(null); + reqVO.setOwnerUserId(null); + reqVO.setRemark(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + List list = receivablePlanService.getReceivablePlanList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbReceivablePlan, list.get(0)); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java new file mode 100644 index 0000000..6d65231 --- /dev/null +++ b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java @@ -0,0 +1,266 @@ +package cn.iocoder.yudao.module.crm.service.receivable; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableCreateReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableExportReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePageReqVO; +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableUpdateReqVO; +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO; +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_NOT_EXISTS; +import static org.junit.jupiter.api.Assertions.*; + +// TODO 芋艿:等实现完,在校验下; +/** + * {@link CrmReceivableServiceImpl} 的单元测试类 + * + * @author 赤焰 + */ +@Import(CrmReceivableServiceImpl.class) +public class CrmCrmReceivableServiceImplTest extends BaseDbUnitTest { + + @Resource + private CrmReceivableServiceImpl receivableService; + + @Resource + private CrmReceivableMapper crmReceivableMapper; + + @Test + public void testCreateReceivable_success() { + // 准备参数 + CrmReceivableCreateReqVO reqVO = randomPojo(CrmReceivableCreateReqVO.class); + + // 调用 + Long receivableId = receivableService.createReceivable(reqVO); + // 断言 + assertNotNull(receivableId); + // 校验记录的属性是否正确 + CrmReceivableDO receivable = crmReceivableMapper.selectById(receivableId); + assertPojoEquals(reqVO, receivable); + } + + @Test + public void testUpdateReceivable_success() { + // mock 数据 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class); + crmReceivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 + // 准备参数 + CrmReceivableUpdateReqVO reqVO = randomPojo(CrmReceivableUpdateReqVO.class, o -> { + o.setId(dbReceivable.getId()); // 设置更新的 ID + }); + + // 调用 + receivableService.updateReceivable(reqVO); + // 校验是否更新正确 + CrmReceivableDO receivable = crmReceivableMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, receivable); + } + + @Test + public void testUpdateReceivable_notExists() { + // 准备参数 + CrmReceivableUpdateReqVO reqVO = randomPojo(CrmReceivableUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> receivableService.updateReceivable(reqVO), RECEIVABLE_NOT_EXISTS); + } + + @Test + public void testDeleteReceivable_success() { + // mock 数据 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class); + crmReceivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbReceivable.getId(); + + // 调用 + receivableService.deleteReceivable(id); + // 校验数据不存在了 + assertNull(crmReceivableMapper.selectById(id)); + } + + @Test + public void testDeleteReceivable_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> receivableService.deleteReceivable(id), RECEIVABLE_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetReceivablePage() { + // mock 数据 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class, o -> { // 等会查询到 + o.setNo(null); + o.setPlanId(null); + o.setCustomerId(null); + o.setContractId(null); + o.setCheckStatus(null); + o.setProcessInstanceId(null); + o.setReturnTime(null); + o.setReturnType(null); + o.setPrice(null); + o.setOwnerUserId(null); + o.setBatchId(null); + o.setSort(null); + o.setDataScope(null); + o.setDataScopeDeptIds(null); + o.setStatus(null); + o.setRemark(null); + o.setCreateTime(null); + }); + crmReceivableMapper.insert(dbReceivable); + // 测试 no 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); + // 测试 planId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); + // 测试 customerId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); + // 测试 contractId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); + // 测试 checkStatus 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); + // 测试 processInstanceId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); + // 测试 returnTime 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); + // 测试 returnType 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); + // 测试 price 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); + // 测试 ownerUserId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); + // 测试 batchId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); + // 测试 sort 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); + // 测试 dataScope 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); + // 测试 dataScopeDeptIds 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); + // 测试 status 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); + // 测试 remark 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); + // 测试 createTime 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); + // 准备参数 + CrmReceivablePageReqVO reqVO = new CrmReceivablePageReqVO(); + reqVO.setNo(null); + reqVO.setPlanId(null); + reqVO.setCustomerId(null); + reqVO.setContractId(null); + reqVO.setCheckStatus(null); + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setReturnType(null); + reqVO.setPrice(null); + reqVO.setOwnerUserId(null); + reqVO.setStatus(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + PageResult pageResult = receivableService.getReceivablePage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbReceivable, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetReceivableList() { + // mock 数据 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class, o -> { // 等会查询到 + o.setNo(null); + o.setPlanId(null); + o.setCustomerId(null); + o.setContractId(null); + o.setCheckStatus(null); + o.setProcessInstanceId(null); + o.setReturnTime(null); + o.setReturnType(null); + o.setPrice(null); + o.setOwnerUserId(null); + o.setBatchId(null); + o.setSort(null); + o.setDataScope(null); + o.setDataScopeDeptIds(null); + o.setStatus(null); + o.setRemark(null); + o.setCreateTime(null); + }); + crmReceivableMapper.insert(dbReceivable); + // 测试 no 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); + // 测试 planId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); + // 测试 customerId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); + // 测试 contractId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); + // 测试 checkStatus 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); + // 测试 processInstanceId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); + // 测试 returnTime 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); + // 测试 returnType 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); + // 测试 price 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); + // 测试 ownerUserId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); + // 测试 batchId 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); + // 测试 sort 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); + // 测试 dataScope 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); + // 测试 dataScopeDeptIds 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); + // 测试 status 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); + // 测试 remark 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); + // 测试 createTime 不匹配 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); + // 准备参数 + CrmReceivableExportReqVO reqVO = new CrmReceivableExportReqVO(); + reqVO.setNo(null); + reqVO.setPlanId(null); + reqVO.setCustomerId(null); + reqVO.setContractId(null); + reqVO.setCheckStatus(null); + reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setReturnType(null); + reqVO.setPrice(null); + reqVO.setOwnerUserId(null); + reqVO.setBatchId(null); + reqVO.setStatus(null); + reqVO.setRemark(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + List list = receivableService.getReceivableList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbReceivable, list.get(0)); + } + +} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java deleted file mode 100644 index 952514e..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java +++ /dev/null @@ -1,225 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.Import; - -import javax.annotation.Resource; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PLAN_NOT_EXISTS; -import static org.junit.jupiter.api.Assertions.*; - -// TODO 芋艿:后续,需要补充测试用例 -/** - * {@link ReceivablePlanServiceImpl} 的单元测试类 - * - * @author 芋道源码 - */ -@Import(ReceivablePlanServiceImpl.class) -public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { - - @Resource - private ReceivablePlanServiceImpl receivablePlanService; - - @Resource - private ReceivablePlanMapper receivablePlanMapper; - - @Test - public void testCreateReceivablePlan_success() { - // 准备参数 - ReceivablePlanCreateReqVO reqVO = randomPojo(ReceivablePlanCreateReqVO.class); - - // 调用 - Long receivablePlanId = receivablePlanService.createReceivablePlan(reqVO); - // 断言 - assertNotNull(receivablePlanId); - // 校验记录的属性是否正确 - ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(receivablePlanId); - assertPojoEquals(reqVO, receivablePlan); - } - - @Test - public void testUpdateReceivablePlan_success() { - // mock 数据 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class); - receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 - // 准备参数 - ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class, o -> { - o.setId(dbReceivablePlan.getId()); // 设置更新的 ID - }); - - // 调用 - receivablePlanService.updateReceivablePlan(reqVO); - // 校验是否更新正确 - ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, receivablePlan); - } - - @Test - public void testUpdateReceivablePlan_notExists() { - // 准备参数 - ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> receivablePlanService.updateReceivablePlan(reqVO), RECEIVABLE_PLAN_NOT_EXISTS); - } - - @Test - public void testDeleteReceivablePlan_success() { - // mock 数据 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class); - receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Long id = dbReceivablePlan.getId(); - - // 调用 - receivablePlanService.deleteReceivablePlan(id); - // 校验数据不存在了 - assertNull(receivablePlanMapper.selectById(id)); - } - - @Test - public void testDeleteReceivablePlan_notExists() { - // 准备参数 - Long id = randomLongId(); - - // 调用, 并断言异常 - assertServiceException(() -> receivablePlanService.deleteReceivablePlan(id), RECEIVABLE_PLAN_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetReceivablePlanPage() { - // mock 数据 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到 - o.setPeriod(null); - o.setStatus(null); - o.setCheckStatus(null); - o.setReturnTime(null); - o.setRemindDays(null); - o.setRemindTime(null); - o.setCustomerId(null); - o.setContractId(null); - o.setOwnerUserId(null); - o.setRemark(null); - o.setCreateTime(null); - }); - receivablePlanMapper.insert(dbReceivablePlan); - // 测试 Period 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null))); - // 测试 status 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); - // 测试 checkStatus 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); - // 测试 returnTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); - // 测试 remindDays 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); - // 测试 remindTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); - // 测试 customerId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); - // 测试 contractId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); - // 测试 ownerUserId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); - // 测试 remark 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); - // 测试 createTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); - // 准备参数 - ReceivablePlanPageReqVO reqVO = new ReceivablePlanPageReqVO(); - reqVO.setStatus(null); - reqVO.setCheckStatus(null); - reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setCustomerId(null); - reqVO.setContractId(null); - reqVO.setOwnerUserId(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - PageResult pageResult = receivablePlanService.getReceivablePlanPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbReceivablePlan, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetReceivablePlanList() { - // mock 数据 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到 - o.setPeriod(null); - o.setStatus(null); - o.setCheckStatus(null); - o.setReturnTime(null); - o.setRemindDays(null); - o.setRemindTime(null); - o.setCustomerId(null); - o.setContractId(null); - o.setOwnerUserId(null); - o.setRemark(null); - o.setCreateTime(null); - }); - receivablePlanMapper.insert(dbReceivablePlan); - // 测试 Period 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null))); - // 测试 status 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); - // 测试 checkStatus 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); - // 测试 returnTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); - // 测试 remindDays 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); - // 测试 remindTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); - // 测试 customerId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); - // 测试 contractId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); - // 测试 ownerUserId 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); - // 测试 remark 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); - // 测试 createTime 不匹配 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); - // 准备参数 - ReceivablePlanExportReqVO reqVO = new ReceivablePlanExportReqVO(); - reqVO.setPeriod(null); - reqVO.setStatus(null); - reqVO.setCheckStatus(null); - reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setRemindDays(null); - reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setCustomerId(null); - reqVO.setContractId(null); - reqVO.setOwnerUserId(null); - reqVO.setRemark(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - List list = receivablePlanService.getReceivablePlanList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbReceivablePlan, list.get(0)); - } - -} diff --git a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java b/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java deleted file mode 100644 index 906fdb4..0000000 --- a/yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java +++ /dev/null @@ -1,266 +0,0 @@ -package cn.iocoder.yudao.module.crm.service.receivable; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO; -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO; -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.context.annotation.Import; - -import javax.annotation.Resource; -import java.util.List; - -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_NOT_EXISTS; -import static org.junit.jupiter.api.Assertions.*; - -// TODO 芋艿:等实现完,在校验下; -/** - * {@link ReceivableServiceImpl} 的单元测试类 - * - * @author 赤焰 - */ -@Import(ReceivableServiceImpl.class) -public class ReceivableServiceImplTest extends BaseDbUnitTest { - - @Resource - private ReceivableServiceImpl receivableService; - - @Resource - private ReceivableMapper receivableMapper; - - @Test - public void testCreateReceivable_success() { - // 准备参数 - ReceivableCreateReqVO reqVO = randomPojo(ReceivableCreateReqVO.class); - - // 调用 - Long receivableId = receivableService.createReceivable(reqVO); - // 断言 - assertNotNull(receivableId); - // 校验记录的属性是否正确 - ReceivableDO receivable = receivableMapper.selectById(receivableId); - assertPojoEquals(reqVO, receivable); - } - - @Test - public void testUpdateReceivable_success() { - // mock 数据 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class); - receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 - // 准备参数 - ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class, o -> { - o.setId(dbReceivable.getId()); // 设置更新的 ID - }); - - // 调用 - receivableService.updateReceivable(reqVO); - // 校验是否更新正确 - ReceivableDO receivable = receivableMapper.selectById(reqVO.getId()); // 获取最新的 - assertPojoEquals(reqVO, receivable); - } - - @Test - public void testUpdateReceivable_notExists() { - // 准备参数 - ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> receivableService.updateReceivable(reqVO), RECEIVABLE_NOT_EXISTS); - } - - @Test - public void testDeleteReceivable_success() { - // mock 数据 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class); - receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Long id = dbReceivable.getId(); - - // 调用 - receivableService.deleteReceivable(id); - // 校验数据不存在了 - assertNull(receivableMapper.selectById(id)); - } - - @Test - public void testDeleteReceivable_notExists() { - // 准备参数 - Long id = randomLongId(); - - // 调用, 并断言异常 - assertServiceException(() -> receivableService.deleteReceivable(id), RECEIVABLE_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetReceivablePage() { - // mock 数据 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 - o.setNo(null); - o.setPlanId(null); - o.setCustomerId(null); - o.setContractId(null); - o.setCheckStatus(null); - o.setProcessInstanceId(null); - o.setReturnTime(null); - o.setReturnType(null); - o.setPrice(null); - o.setOwnerUserId(null); - o.setBatchId(null); - o.setSort(null); - o.setDataScope(null); - o.setDataScopeDeptIds(null); - o.setStatus(null); - o.setRemark(null); - o.setCreateTime(null); - }); - receivableMapper.insert(dbReceivable); - // 测试 no 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); - // 测试 planId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); - // 测试 customerId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); - // 测试 contractId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); - // 测试 checkStatus 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); - // 测试 processInstanceId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); - // 测试 returnTime 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); - // 测试 returnType 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); - // 测试 price 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); - // 测试 ownerUserId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); - // 测试 batchId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); - // 测试 sort 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); - // 测试 dataScope 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); - // 测试 dataScopeDeptIds 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); - // 测试 status 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); - // 测试 remark 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); - // 测试 createTime 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); - // 准备参数 - ReceivablePageReqVO reqVO = new ReceivablePageReqVO(); - reqVO.setNo(null); - reqVO.setPlanId(null); - reqVO.setCustomerId(null); - reqVO.setContractId(null); - reqVO.setCheckStatus(null); - reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setReturnType(null); - reqVO.setPrice(null); - reqVO.setOwnerUserId(null); - reqVO.setStatus(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - PageResult pageResult = receivableService.getReceivablePage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbReceivable, pageResult.getList().get(0)); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetReceivableList() { - // mock 数据 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 - o.setNo(null); - o.setPlanId(null); - o.setCustomerId(null); - o.setContractId(null); - o.setCheckStatus(null); - o.setProcessInstanceId(null); - o.setReturnTime(null); - o.setReturnType(null); - o.setPrice(null); - o.setOwnerUserId(null); - o.setBatchId(null); - o.setSort(null); - o.setDataScope(null); - o.setDataScopeDeptIds(null); - o.setStatus(null); - o.setRemark(null); - o.setCreateTime(null); - }); - receivableMapper.insert(dbReceivable); - // 测试 no 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); - // 测试 planId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); - // 测试 customerId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); - // 测试 contractId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); - // 测试 checkStatus 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); - // 测试 processInstanceId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); - // 测试 returnTime 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); - // 测试 returnType 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); - // 测试 price 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); - // 测试 ownerUserId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); - // 测试 batchId 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); - // 测试 sort 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); - // 测试 dataScope 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); - // 测试 dataScopeDeptIds 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); - // 测试 status 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); - // 测试 remark 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); - // 测试 createTime 不匹配 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); - // 准备参数 - ReceivableExportReqVO reqVO = new ReceivableExportReqVO(); - reqVO.setNo(null); - reqVO.setPlanId(null); - reqVO.setCustomerId(null); - reqVO.setContractId(null); - reqVO.setCheckStatus(null); - reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - reqVO.setReturnType(null); - reqVO.setPrice(null); - reqVO.setOwnerUserId(null); - reqVO.setBatchId(null); - reqVO.setStatus(null); - reqVO.setRemark(null); - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); - - // 调用 - List list = receivableService.getReceivableList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbReceivable, list.get(0)); - } - -} -- libgit2 0.21.4