From 7ab77cfbf7a7449d4b152fdc91d33f75fac9d2db Mon Sep 17 00:00:00 2001 From: hjx <577364224@qq.com> Date: Mon, 9 Feb 2026 14:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90bms=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_bms/Dockerfile | 17 + mhd_bms/pom.xml | 177 ++++ .../com/mhd/bms/BmsServiceApplication.java | 21 + .../BillManageApplicationService.java | 494 +++++++++++ .../BillOperationLogApplicationService.java | 72 ++ .../BillingRulesApplicationService.java | 167 ++++ .../CostCalculationApplicationService.java | 340 ++++++++ .../BillingStatementApplicationService.java | 501 ++++++++++++ .../BusinessDocumentApplicationService.java | 725 +++++++++++++++++ .../ConditionalMappingApplicationService.java | 102 +++ .../DocumentTypeApplicationService.java | 174 ++++ .../MappingMethodApplicationService.java | 100 +++ .../PaymentManageApplicationService.java | 110 +++ .../PaymentOrderApplicationService.java | 118 +++ .../PaymentWalletApplicationService.java | 136 ++++ .../ReceiptManageApplicationService.java | 131 +++ .../FormQueryManageApplicationService.java | 134 +++ .../FormQueryParamsApplicationService.java | 90 ++ .../ReportFormApplicationService.java | 768 ++++++++++++++++++ ...SettlementCustomersApplicationService.java | 313 +++++++ .../TaskFlowRecordsApplicationService.java | 180 ++++ .../domain/billManage/entity/BillDetail.java | 78 ++ .../domain/billManage/entity/BillManage.java | 186 +++++ .../repository/facade/IBillDetailService.java | 41 + .../repository/facade/IBillManageService.java | 43 + .../repository/mapper/BillDetailMapper.java | 20 + .../repository/mapper/BillManageMapper.java | 22 + .../persistence/BillDetailImpl.java | 78 ++ .../persistence/BillManageImpl.java | 81 ++ .../repository/po/BillDetailPO.java | 124 +++ .../repository/po/BillManagePO.java | 197 +++++ .../repository/todo/BillDetailDO.java | 81 ++ .../repository/todo/BillManageDO.java | 208 +++++ .../service/BillDetailDomainService.java | 155 ++++ .../service/BillManageDomainService.java | 506 ++++++++++++ .../entity/BillOperationLog.java | 54 ++ .../facade/IBillOperationLogService.java | 48 ++ .../mapper/BillOperationLogMapper.java | 23 + .../persistence/BillOperationLogImpl.java | 89 ++ .../repository/po/BillOperationLogPO.java | 54 ++ .../repository/todo/BillOperationLogDO.java | 61 ++ .../BillOperationLogDomainService.java | 164 ++++ .../billingRules/entity/BillingParams.java | 64 ++ .../billingRules/entity/BillingRules.java | 94 +++ .../facade/IBillingParamsService.java | 48 ++ .../facade/IBillingRulesService.java | 43 + .../mapper/BillingParamsMapper.java | 23 + .../repository/mapper/BillingRulesMapper.java | 22 + .../persistence/BillingParamsImpl.java | 86 ++ .../persistence/BillingRulesImpl.java | 83 ++ .../repository/po/BillingParamsPO.java | 91 +++ .../repository/po/BillingRulesPO.java | 97 +++ .../repository/todo/BillingParamsDO.java | 68 ++ .../repository/todo/BillingRulesDO.java | 107 +++ .../service/BillingParamsDomainService.java | 139 ++++ .../service/BillingRulesDomainService.java | 184 +++++ .../entity/BillingStatement.java | 192 +++++ .../facade/IBillingStatementService.java | 59 ++ .../mapper/BillingStatementMapper.java | 45 + .../persistence/BillingStatementImpl.java | 109 +++ .../po/BillingStatementCollectPO.java | 68 ++ .../repository/po/BillingStatementPO.java | 199 +++++ .../todo/BillingStatementCollectDO.java | 58 ++ .../repository/todo/BillingStatementDO.java | 224 +++++ .../BillingStatementDomainService.java | 511 ++++++++++++ .../entity/BusinessDocument.java | 173 ++++ .../facade/IBusinessDocumentService.java | 45 + .../mapper/BusinessDocumentMapper.java | 22 + .../persistence/BusinessDocumentImpl.java | 96 +++ .../repository/po/BusinessDocumentPO.java | 177 ++++ .../repository/todo/BusinessDocumentDO.java | 197 +++++ .../BusinessDocumentDomainService.java | 196 +++++ .../entity/ConditionalMapping.java | 58 ++ .../facade/IConditionalMappingService.java | 43 + .../mapper/ConditionalMappingMapper.java | 22 + .../persistence/ConditionalMappingImpl.java | 81 ++ .../repository/po/ConditionalMappingPO.java | 58 ++ .../repository/todo/ConditionalMappingDO.java | 61 ++ .../ConditionalMappingDomainService.java | 64 ++ .../entity/BillingOutputEntity.java | 27 + .../entity/BillingParamsEntity.java | 38 + .../costCalculation/po/BillingCostPo.java | 34 + .../entity/DocumentFromEntity.java | 31 + .../documentType/entity/DocumentType.java | 70 ++ .../facade/IDocumentTypeService.java | 43 + .../repository/mapper/DocumentTypeMapper.java | 22 + .../persistence/DocumentTypeImpl.java | 81 ++ .../repository/po/DocumentTypePO.java | 70 ++ .../repository/todo/DocumentTypeDO.java | 84 ++ .../service/DocumentTypeDomainService.java | 74 ++ .../mappingMethod/entity/MappingMethod.java | 58 ++ .../facade/IMappingMethodService.java | 43 + .../mapper/MappingMethodMapper.java | 22 + .../persistence/MappingMethodImpl.java | 81 ++ .../repository/po/MappingMethodPO.java | 58 ++ .../repository/todo/MappingMethodDO.java | 64 ++ .../service/MappingMethodDomainService.java | 76 ++ .../paymentManage/entity/PaymentManage.java | 50 ++ .../facade/IPaymentManageService.java | 43 + .../mapper/PaymentManageMapper.java | 22 + .../persistence/PaymentManageImpl.java | 81 ++ .../repository/po/PaymentManagePO.java | 50 ++ .../repository/todo/PaymentManageDO.java | 53 ++ .../service/PaymentManageDomainService.java | 83 ++ .../paymentOrder/entity/PaymentOrder.java | 112 +++ .../entity/PaymentOrderDetails.java | 69 ++ .../facade/IPaymentOrderDetailsService.java | 45 + .../facade/IPaymentOrderService.java | 45 + .../mapper/PaymentOrderDetailsMapper.java | 18 + .../repository/mapper/PaymentOrderMapper.java | 23 + .../persistence/PaymentOrderDetailsImpl.java | 94 +++ .../persistence/PaymentOrderImpl.java | 86 ++ .../repository/po/PaymentOrderDetailsPO.java | 69 ++ .../repository/po/PaymentOrderPO.java | 117 +++ .../repository/todo/PaymentOrderDO.java | 129 +++ .../todo/PaymentOrderDetailsDO.java | 76 ++ .../PaymentOrderDetailsDomainService.java | 78 ++ .../service/PaymentOrderDomainService.java | 315 +++++++ .../paymentWallet/entity/PaymentWallet.java | 74 ++ .../facade/IPaymentWalletService.java | 43 + .../mapper/PaymentWalletMapper.java | 22 + .../persistence/PaymentWalletImpl.java | 81 ++ .../repository/po/PaymentWalletPO.java | 74 ++ .../repository/todo/PaymentWalletDO.java | 77 ++ .../service/PaymentWalletDomainService.java | 64 ++ .../receiptManage/entity/ReceiptDetail.java | 82 ++ .../receiptManage/entity/ReceiptManage.java | 139 ++++ .../facade/IReceiptDetailService.java | 43 + .../facade/IReceiptManageService.java | 49 ++ .../mapper/ReceiptDetailMapper.java | 22 + .../mapper/ReceiptManageMapper.java | 28 + .../persistence/ReceiptDetailImpl.java | 81 ++ .../persistence/ReceiptManageImpl.java | 92 +++ .../repository/po/ReceiptDetailPO.java | 142 ++++ .../repository/po/ReceiptManagePO.java | 144 ++++ .../repository/todo/ReceiptDetailDO.java | 85 ++ .../repository/todo/ReceiptManageDO.java | 168 ++++ .../service/ReceiptDetailDomainService.java | 100 +++ .../service/ReceiptManageDomainService.java | 315 +++++++ .../reportForm/entity/FormQueryManage.java | 56 ++ .../reportForm/entity/FormQueryParams.java | 75 ++ .../domain/reportForm/entity/ReportForm.java | 66 ++ .../facade/IFormQueryManageService.java | 46 ++ .../facade/IFormQueryParamsService.java | 45 + .../repository/facade/IReportFormService.java | 43 + .../mapper/FormQueryManageMapper.java | 22 + .../mapper/FormQueryParamsMapper.java | 23 + .../repository/mapper/ReportFormMapper.java | 22 + .../persistence/FormQueryManageImpl.java | 100 +++ .../persistence/FormQueryParamsImpl.java | 86 ++ .../persistence/ReportFormImpl.java | 81 ++ .../repository/po/FormQueryManagePO.java | 59 ++ .../repository/po/FormQueryParamsPO.java | 77 ++ .../repository/po/ReportFormPO.java | 68 ++ .../repository/todo/FormQueryManageDO.java | 64 ++ .../repository/todo/FormQueryParamsDO.java | 82 ++ .../repository/todo/ReportFormDO.java | 72 ++ .../service/FormQueryManageDomainService.java | 127 +++ .../service/FormQueryParamsDomainService.java | 141 ++++ .../service/ReportFormDomainService.java | 93 +++ .../entity/SettlementCustomers.java | 95 +++ .../facade/ISettlementCustomersService.java | 48 ++ .../mapper/SettlementCustomersMapper.java | 27 + .../persistence/SettlementCustomersImpl.java | 91 +++ .../repository/po/SettlementCustomersPO.java | 95 +++ .../todo/SettlementCustomersDO.java | 107 +++ .../SettlementCustomersDomainService.java | 87 ++ .../entity/TaskFlowRecords.java | 134 +++ .../facade/ITaskFlowRecordsService.java | 43 + .../mapper/TaskFlowRecordsMapper.java | 22 + .../persistence/TaskFlowRecordsImpl.java | 81 ++ .../repository/po/TaskFlowRecordsPO.java | 134 +++ .../repository/todo/TaskFlowRecordsDO.java | 148 ++++ .../service/TaskFlowRecordsDomainService.java | 86 ++ .../constant/BillLogsConstants.java | 99 +++ .../feign/vo/ContractManageDetailPO.java | 100 +++ .../feign/vo/ContractManagePO.java | 172 ++++ .../feign/vo/ExpenseAccountPO.java | 105 +++ .../feign/vo/ServiceItemsManagePO.java | 57 ++ .../utils/CheckPasswordUtil.java | 65 ++ .../utils/DynamicCalculationUtil.java | 41 + .../infrastructure/utils/UniqueKeyUtil.java | 20 + .../com/mhd/bms/interfaces/JobApi/JobApi.java | 33 + .../billManage/BillDetailAssembler.java | 65 ++ .../billManage/BillManageAssembler.java | 86 ++ .../BillOperationLogAssembler.java | 65 ++ .../billingRules/BillingParamsAssembler.java | 65 ++ .../billingRules/BillingRulesAssembler.java | 65 ++ .../BillingStatementAssembler.java | 105 +++ .../BusinessDocumentAssembler.java | 83 ++ .../ConditionalMappingAssembler.java | 65 ++ .../documentType/DocumentTypeAssembler.java | 65 ++ .../mappingMethod/MappingMethodAssembler.java | 65 ++ .../paymentManage/PaymentManageAssembler.java | 65 ++ .../paymentOrder/PaymentOrderAssembler.java | 65 ++ .../PaymentOrderDetailsAssembler.java | 65 ++ .../paymentWallet/PaymentWalletAssembler.java | 65 ++ .../receiptManage/ReceiptDetailAssembler.java | 65 ++ .../receiptManage/ReceiptManageAssembler.java | 65 ++ .../reportForm/FormQueryManageAssembler.java | 65 ++ .../reportForm/FormQueryParamsAssembler.java | 65 ++ .../reportForm/ReportFormAssembler.java | 65 ++ .../SettlementCustomersAssembler.java | 65 ++ .../TaskFlowRecordsAssembler.java | 65 ++ .../dto/billManage/BillDetailDTO.java | 127 +++ .../dto/billManage/BillManageDTO.java | 214 +++++ .../billOperationLog/BillOperationLogDTO.java | 56 ++ .../dto/billingRules/BillingParamsDTO.java | 68 ++ .../dto/billingRules/BillingRulesDTO.java | 108 +++ .../dto/billingRules/CostCalculationDTO.java | 42 + .../BillingStatementCollectDTO.java | 57 ++ .../billingStatement/BillingStatementDTO.java | 230 ++++++ .../businessDocument/BusinessDocumentDTO.java | 199 +++++ .../ConditionalMappingDTO.java | 64 ++ .../dto/documentType/DocumentTypeDTO.java | 82 ++ .../dto/mappingMethod/MappingMethodDTO.java | 64 ++ .../dto/paymentManage/PaymentManageDTO.java | 56 ++ .../dto/paymentOrder/PaymentOrderDTO.java | 128 +++ .../paymentOrder/PaymentOrderDetailsDTO.java | 73 ++ .../dto/paymentWallet/PaymentWalletDTO.java | 80 ++ .../dto/receiptManage/ReceiptDetailDTO.java | 85 ++ .../dto/receiptManage/ReceiptManageDTO.java | 167 ++++ .../dto/reportForm/FormQueryManageDTO.java | 61 ++ .../dto/reportForm/FormQueryParamsDTO.java | 82 ++ .../dto/reportForm/ReportFormDTO.java | 69 ++ .../SettlementCustomersDTO.java | 105 +++ .../taskFlowRecords/TaskFlowRecordsDTO.java | 151 ++++ .../interfaces/facadeApi/BillManageApi.java | 284 +++++++ .../facadeApi/BillOperationLogApi.java | 99 +++ .../interfaces/facadeApi/BillingRulesApi.java | 120 +++ .../facadeApi/BillingStatementApi.java | 330 ++++++++ .../facadeApi/BusinessDocumentApi.java | 219 +++++ .../facadeApi/ConditionalMappingApi.java | 93 +++ .../facadeApi/CostCalculationApi.java | 45 + .../interfaces/facadeApi/DocumentTypeApi.java | 118 +++ .../facadeApi/FormQueryManageApi.java | 96 +++ .../facadeApi/FormQueryParamsApi.java | 84 ++ .../facadeApi/MappingMethodApi.java | 102 +++ .../facadeApi/PaymentManageApi.java | 115 +++ .../interfaces/facadeApi/PaymentOrderApi.java | 157 ++++ .../facadeApi/PaymentWalletApi.java | 114 +++ .../facadeApi/ReceiptManageApi.java | 185 +++++ .../interfaces/facadeApi/ReportFormApi.java | 145 ++++ .../facadeApi/SettlementCustomersApi.java | 134 +++ .../facadeApi/TaskFlowRecordsApi.java | 97 +++ mhd_bms/src/main/resources/bootstrap.yml | 33 + .../resources/mapper/BillDetailMapper.xml | 31 + .../resources/mapper/BillManageMapper.xml | 76 ++ .../mapper/BillOperationLogMapper.xml | 67 ++ .../resources/mapper/BillingParamsMapper.xml | 82 ++ .../resources/mapper/BillingRulesMapper.xml | 105 +++ .../mapper/BillingStatementMapper.xml | 257 ++++++ .../mapper/BusinessDocumentMapper.xml | 191 +++++ .../mapper/ConditionalMappingMapper.xml | 34 + .../resources/mapper/DocumentTypeMapper.xml | 94 +++ .../mapper/FormQueryManageMapper.xml | 32 + .../mapper/FormQueryParamsMapper.xml | 41 + .../resources/mapper/MappingMethodMapper.xml | 31 + .../resources/mapper/PaymentManageMapper.xml | 50 ++ .../mapper/PaymentOrderDetailsMapper.xml | 7 + .../resources/mapper/PaymentOrderMapper.xml | 58 ++ .../resources/mapper/PaymentWalletMapper.xml | 80 ++ .../resources/mapper/ReceiptDetailMapper.xml | 64 ++ .../resources/mapper/ReceiptManageMapper.xml | 99 +++ .../resources/mapper/ReportFormMapper.xml | 33 + .../mapper/SettlementCustomersMapper.xml | 112 +++ .../mapper/TaskFlowRecordsMapper.xml | 157 ++++ 267 files changed, 27070 insertions(+) create mode 100644 mhd_bms/Dockerfile create mode 100644 mhd_bms/pom.xml create mode 100644 mhd_bms/src/main/java/com/mhd/bms/BmsServiceApplication.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/billOperationLog/BillOperationLogApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/BillingRulesApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/billingStatement/BillingStatementApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/conditionalMapping/ConditionalMappingApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/documentType/DocumentTypeApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/mappingMethod/MappingMethodApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/paymentManage/PaymentManageApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/paymentOrder/PaymentOrderApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/paymentWallet/PaymentWalletApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/receiptManage/ReceiptManageApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryManageApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryParamsApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/ReportFormApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/settlementCustomers/SettlementCustomersApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/application/server/taskFlowRecords/TaskFlowRecordsApplicationService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillDetail.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillManage.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillDetailService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillManageService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillDetailMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillDetailImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillDetailPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillDetailDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillManageDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillDetailDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillManageDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/entity/BillOperationLog.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/facade/IBillOperationLogService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/mapper/BillOperationLogMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/persistence/BillOperationLogImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/po/BillOperationLogPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/todo/BillOperationLogDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/service/BillOperationLogDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingParams.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingRules.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingParamsService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingRulesService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingParamsMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingRulesMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingParamsImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingRulesImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingParamsPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingRulesPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingParamsDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingRulesDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingParamsDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingRulesDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/facade/IBillingStatementService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/mapper/BillingStatementMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/persistence/BillingStatementImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementCollectPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementCollectDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/service/BillingStatementDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/facade/IBusinessDocumentService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/mapper/BusinessDocumentMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/persistence/BusinessDocumentImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/service/BusinessDocumentDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/entity/ConditionalMapping.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/facade/IConditionalMappingService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/mapper/ConditionalMappingMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/persistence/ConditionalMappingImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/po/ConditionalMappingPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/todo/ConditionalMappingDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/service/ConditionalMappingDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingOutputEntity.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentFromEntity.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentType.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/facade/IDocumentTypeService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/mapper/DocumentTypeMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/persistence/DocumentTypeImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/po/DocumentTypePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/todo/DocumentTypeDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/documentType/service/DocumentTypeDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/entity/MappingMethod.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/facade/IMappingMethodService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/mapper/MappingMethodMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/persistence/MappingMethodImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/po/MappingMethodPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/todo/MappingMethodDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/service/MappingMethodDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/entity/PaymentManage.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/facade/IPaymentManageService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/mapper/PaymentManageMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/persistence/PaymentManageImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/po/PaymentManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/todo/PaymentManageDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/service/PaymentManageDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrder.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrderDetails.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderDetailsService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderDetailsMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderDetailsImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderDetailsPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDetailsDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDetailsDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/entity/PaymentWallet.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/facade/IPaymentWalletService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/mapper/PaymentWalletMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/persistence/PaymentWalletImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/po/PaymentWalletPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/todo/PaymentWalletDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/service/PaymentWalletDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptDetail.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptManage.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptDetailService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptManageService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptDetailMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptManageMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptDetailImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptManageImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptDetailPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptDetailDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptManageDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptDetailDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptManageDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryManage.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryParams.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/ReportForm.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryManageService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryParamsService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IReportFormService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryManageMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryParamsMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/ReportFormMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryManageImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryParamsImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/ReportFormImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryParamsPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/ReportFormPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryManageDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryParamsDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/ReportFormDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryManageDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryParamsDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/ReportFormDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/entity/SettlementCustomers.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/facade/ISettlementCustomersService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/mapper/SettlementCustomersMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/persistence/SettlementCustomersImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/todo/SettlementCustomersDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/service/SettlementCustomersDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/entity/TaskFlowRecords.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/facade/ITaskFlowRecordsService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/mapper/TaskFlowRecordsMapper.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/persistence/TaskFlowRecordsImpl.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/po/TaskFlowRecordsPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/todo/TaskFlowRecordsDO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/service/TaskFlowRecordsDomainService.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/constant/BillLogsConstants.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManageDetailPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ServiceItemsManagePO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/CheckPasswordUtil.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/DynamicCalculationUtil.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/UniqueKeyUtil.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/JobApi/JobApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillDetailAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillManageAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billOperationLog/BillOperationLogAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingParamsAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingRulesAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingStatement/BillingStatementAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/businessDocument/BusinessDocumentAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/conditionalMapping/ConditionalMappingAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/documentType/DocumentTypeAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/mappingMethod/MappingMethodAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentManage/PaymentManageAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderDetailsAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentWallet/PaymentWalletAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptDetailAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptManageAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryManageAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryParamsAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/ReportFormAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/settlementCustomers/SettlementCustomersAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/taskFlowRecords/TaskFlowRecordsAssembler.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillDetailDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillManageDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billOperationLog/BillOperationLogDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingParamsDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingRulesDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/CostCalculationDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementCollectDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/businessDocument/BusinessDocumentDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/conditionalMapping/ConditionalMappingDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/documentType/DocumentTypeDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/mappingMethod/MappingMethodDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentManage/PaymentManageDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDetailsDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentWallet/PaymentWalletDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptDetailDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptManageDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryManageDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryParamsDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/ReportFormDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/settlementCustomers/SettlementCustomersDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/taskFlowRecords/TaskFlowRecordsDTO.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillManageApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillOperationLogApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingRulesApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingStatementApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BusinessDocumentApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ConditionalMappingApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/CostCalculationApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/DocumentTypeApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryManageApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryParamsApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/MappingMethodApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentManageApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentOrderApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentWalletApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReceiptManageApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReportFormApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/SettlementCustomersApi.java create mode 100644 mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/TaskFlowRecordsApi.java create mode 100644 mhd_bms/src/main/resources/bootstrap.yml create mode 100644 mhd_bms/src/main/resources/mapper/BillDetailMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BillManageMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BillOperationLogMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BillingParamsMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BillingRulesMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BillingStatementMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/BusinessDocumentMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/ConditionalMappingMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/DocumentTypeMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/FormQueryManageMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/FormQueryParamsMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/MappingMethodMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/PaymentManageMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/PaymentOrderDetailsMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/PaymentOrderMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/PaymentWalletMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/ReceiptDetailMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/ReceiptManageMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/ReportFormMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml create mode 100644 mhd_bms/src/main/resources/mapper/TaskFlowRecordsMapper.xml diff --git a/mhd_bms/Dockerfile b/mhd_bms/Dockerfile new file mode 100644 index 000000000..04fc6ed22 --- /dev/null +++ b/mhd_bms/Dockerfile @@ -0,0 +1,17 @@ +# 基础镜像 +FROM kdvolder/jdk8 +# author +MAINTAINER manhuoda +#指定东八区时区 +ENV TZ Asia/Shanghai +#指定utf-8编码格 +ENV JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8" +# VOLUME 指定了临时文件目录为/tmp。 +# 其效果是在主机 /var/lib/docker 目录下创建了一个临时文件,并链接到容器的/tmp +VOLUME /tmp +#将当前jar 复制到容器根目录下 +ADD mhd_bms.jar mhd_bms.jar +#暴露容器端口 Docker镜像告知Docker宿主机应用监听了端口 +EXPOSE 8019 +# 运行jar包 +ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Xms1000m", "-Xmx1500m","-jar","/mhd_bms.jar"] diff --git a/mhd_bms/pom.xml b/mhd_bms/pom.xml new file mode 100644 index 000000000..bc3d095d1 --- /dev/null +++ b/mhd_bms/pom.xml @@ -0,0 +1,177 @@ + + + + mhd + com.mhd + 3.6.0 + + 4.0.0 + + mhd_bms + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + io.github.openfeign + feign-httpclient + + + org.springframework.cloud + spring-cloud-loadbalancer + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.alibaba.csp + sentinel-datasource-nacos + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + org.springframework.cloud + spring-cloud-stream + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + + + + com.fasterxml.jackson.core + jackson-databind + + + + + com.alibaba.fastjson2 + fastjson2 + + + + com.mhd + mhd-common-core + + + + com.mhd + mhd-common-redis + + + + mysql + mysql-connector-java + + + + com.alibaba + druid-spring-boot-starter + 1.2.11 + + + + org.projectlombok + lombok + 1.18.4 + provided + + + + com.baomidou + mybatis-plus-boot-starter + 3.3.2 + + + + org.springframework.cloud + spring-cloud-starter-sleuth + + + + org.springframework.cloud + spring-cloud-starter-zipkin + 2.2.8.RELEASE + + + + + com.mhd + mhd-common-security + + + + com.mhd + mhd-common-log + + + + + jep + jep + 2.24 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + 2.1.1.RELEASE + + + + repackage + + + + + + + + + 8 + 8 + + + + mhd_bms + + + + com.spotify + dockerfile-maven-plugin + + + + + + diff --git a/mhd_bms/src/main/java/com/mhd/bms/BmsServiceApplication.java b/mhd_bms/src/main/java/com/mhd/bms/BmsServiceApplication.java new file mode 100644 index 000000000..47202aba8 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/BmsServiceApplication.java @@ -0,0 +1,21 @@ +package com.mhd.bms; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; + +@SpringBootApplication(scanBasePackages = {"com.mhd"}) +@EnableDiscoveryClient +@EnableFeignClients(basePackages = {"com.mhd"}) +@MapperScan("com.mhd.bms.domain.**.mapper") +@EnableAsync +public class BmsServiceApplication { + + public static void main(String[] args) { + SpringApplication.run(BmsServiceApplication.class, args); + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java new file mode 100644 index 000000000..ff58b8a28 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java @@ -0,0 +1,494 @@ +package com.mhd.bms.application.server.billManage; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.application.server.billingStatement.BillingStatementApplicationService; +import com.mhd.bms.application.server.receiptManage.ReceiptManageApplicationService; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import com.mhd.bms.domain.billManage.service.BillDetailDomainService; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.domain.paymentOrder.service.PaymentOrderDomainService; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.service.ReceiptManageDomainService; +import com.mhd.bms.infrastructure.constant.BillLogsConstants; +import com.mhd.bms.interfaces.assembler.billManage.BillManageAssembler; +import com.mhd.bms.interfaces.dto.billManage.BillDetailDTO; +import com.mhd.bms.interfaces.dto.billManage.BillManageDTO; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 账单管理ApplicationService + * + * @author gen + * @date 2024-07-02 + */ +@Service +@Slf4j +public class BillManageApplicationService { + @Autowired + private BillManageDomainService billManageDomainService; + @Autowired + private BillingStatementDomainService billingStatementDomainService; + @Autowired + private BillDetailDomainService billDetailDomainService; + @Autowired + private BillingStatementApplicationService billingStatementApplicationService; + @Autowired + private BillOperationLogDomainService billOperationLogDomainService; + @Autowired + private ReceiptManageDomainService receiptManageDomainService; + @Autowired + private PaymentOrderDomainService paymentOrderDomainService; + + + /** + * 分页查询账单管理列表 + */ + + public List queryList(BillManageDO billManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + billManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return billManageDomainService.queryList(billManageDO); + } + + + /** + * 新增账单管理 + */ + public Boolean insert(BillManageDO billManageDO) { + return billManageDomainService.insert(billManageDO); + } + + /** + * 修改账单管理 + */ + public Boolean update(BillManageDO billManageDO) { + return billManageDomainService.update(billManageDO); + } + + /** + * 批量删除账单管理 + */ + public boolean delete(Long[] billManageIds) { + return billManageDomainService.delete(billManageIds); + } + + /** + * 获取账单管理详细信息 + */ + public BillManagePO getInfo(Long billManageId) + { + return billManageDomainService.getInfo(billManageId); + } + + + /** + * 保存账单 + */ + public Boolean saveBill(BillingStatementDTO billingStatementDTO) { + return billManageDomainService.save(billingStatementDTO); + } + + /** + * 批量删除账单管理 + */ + @Transactional + public Boolean deleteByIds(BillManageDTO billManageDTO) { + if(!StringUtils.isNotEmpty(billManageDTO.getBillManageIds())){ + throw new ServiceException("账单管理ids不能为空"); + } + Set billManageIds = Stream.of(billManageDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + Long[] billManageIdsLong = billManageIds.stream().map(Long::valueOf).toArray(Long[]::new); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,billManageIds); + List billManageList = billManageDomainService.queryListLambda(queryWrapper); + //校验状态,如果不是未确认状态,则不允许作废 + for (BillManage billManage : billManageList) { + if(billManage.getBillState() != 6){ + throw new ServiceException("选中数据"+ billManage.getBillNumber() + "状态不为未作废,不可操作删除"); + } + } + //校验通过删除明细 + boolean flag = billDetailDomainService.deletByManageIds(billManageIds); + boolean flagTwo = billManageDomainService.delete(billManageIdsLong); + //保存账单操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageIdSet(billManageIds); + billOperationLogDO.setOperationInfo(BillLogsConstants.delete_bill_text); + billOperationLogDO.setOperationType(9); + boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO); + return flag && flagTwo && three; + } + + /** + * 批量作废账单 + */ + @Transactional + public Boolean nullifyByIds(BillManageDTO billManageDTO) { + if(!StringUtils.isNotEmpty(billManageDTO.getBillManageIds())){ + throw new ServiceException("账单管理ids不能为空"); + } + Set billManageIds = Stream.of(billManageDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,billManageIds); + List billManageList = billManageDomainService.queryListLambda(queryWrapper); + //校验状态,如果不是未确认状态,则不允许作废 + for (BillManage billManage : billManageList) { + if(billManage.getBillState() != 1){ + throw new ServiceException("选中数据"+ billManage.getBillNumber() + "状态不为未确认,不可操作作废"); + } + } + //符合条件后,账单作废,且计费流水状态还原到已审核状态 + Boolean flag = billManageDomainService.nullifyByIds(billManageIds); + //查询账单包含所有计费流水 + List billDetailList = billDetailDomainService.queryByLambda(new LambdaQueryWrapper().in(BillDetail::getBillManageId,billManageIds)); + Set billingStatementIds = billDetailList.stream().map(BillDetail::getBillingStatementId).collect(Collectors.toSet()); + Boolean flagTwo = billingStatementDomainService.billNullify(billingStatementIds); + return flag && flagTwo; + } + + /** + * 发起对账 + */ + @Transactional + public Boolean reconciliation(BillManageDTO billManageDTO) { + //发起对账:账单状态变更到对账中,只有未确认的状态才能进行发起对账 + if(!StringUtils.isNotEmpty(billManageDTO.getBillManageIds())){ + throw new ServiceException("账单管理ids不能为空"); + } + //校验 + Set billManageIds = Stream.of(billManageDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + BillManageDO billManageDO = new BillManageDO(); + billManageDO.setBillManageIdSet(billManageIds); + List billManageList = billManageDomainService.queryList(billManageDO); + for (BillManagePO billManage : billManageList) { + if(billManage.getBillState() != 1){ + throw new ServiceException("选中数据"+ billManage.getBillNumber() + "状态不为未确认,不可操作发起对账"); + } + } + //发起对账 + return billManageDomainService.reconciliation(billManageDO); + } + + /** + * 确认账单 + */ + @Transactional + public Boolean confirmBilling(BillManageDTO billManageDTO) { + //确认账单:未收款状态之前都可以进行确认账单,跳过核账流程,直接到未收款状态 + if(!StringUtils.isNotEmpty(billManageDTO.getBillManageIds())){ + throw new ServiceException("账单管理ids不能为空"); + } + //校验 + Set billManageIds = Stream.of(billManageDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + BillManageDO billManageDO = new BillManageDO(); + billManageDO.setBillManageIdSet(billManageIds); + List billManageList = billManageDomainService.queryList(billManageDO); + for (BillManagePO billManage : billManageList) { + if(billManage.getBillState() > 2){ + throw new ServiceException("选中数据"+ billManage.getBillNumber() + "状态不可操作确认账单"); + } + } + return billManageDomainService.confirmBilling(billManageDO); + } + + /** + * 查询对账详情 + */ + public BillManagePO getInfoById(BillManageDTO billManageDTO) { + + BillManagePO billManagePO = billManageDomainService.getInfo(billManageDTO.getBillManageId()); + if(billManagePO == null){ + throw new ServiceException("账单信息不存在"); + } + List billDetailPOList = billDetailDomainService.getDetailsByBillManageId(billManageDTO.getBillManageId()); + billManagePO.setBillDetailPOList(billDetailPOList); + return billManagePO; + } + + /** + * 调整账单 + */ + @Transactional + public Boolean confirmChangeBill(BillManageDTO billManageDTO) { + /* + 删除该账单的所有明细,并将所有新数据新增并绑定当前账单,并重新计算账单总额,与传来的是否一致,如果不一致则进行报错,如果一致,则修改账单总额信息 + */ + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(billManageDTO.getBillDetailDTOList()==null || billManageDTO.getBillDetailDTOList().size()==0){ + throw new ServiceException("账单明细不能为空"); + } + BillManagePO billManagePO = billManageDomainService.getInfo(billManageDTO.getBillManageId()); + if(null == billManagePO){ + throw new ServiceException("账单信息未找到"); + } + if(billManagePO.getBillState() != 1){ + throw new ServiceException("账单状态不为未确认,不可操作调整账单"); + } + List billDetailDTOList = billManageDTO.getBillDetailDTOList(); + Boolean deleteFlag = billDetailDomainService.removeByBillManageId(billManageDTO.getBillManageId()); + if(!deleteFlag){ + throw new ServiceException("调整失败,请重试"); + } + //计算集合中所有账单总额、账单金额、账单优惠金额 + BigDecimal billingTotalAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billingAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billingDiscountAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + //比较传来的账单总额、账单金额、账单优惠金额与计算的是否一致,不一致则报错 + if(billingTotalAmount.compareTo(billManageDTO.getBillTotalAmount())!=0 || billingAmount.compareTo(billManageDTO.getBillAmount())!=0 || billingDiscountAmount.compareTo(billManageDTO.getBillDiscountAmount())!=0){ + throw new ServiceException("账单金额不一致,调整失败,请重试"); + } + //将集合中没有计费流水id的过滤到另一个集合,将添加费用的集合保存到计费流水并返回计费流水id + List billDetailDTOListNoBillingStatementId = billDetailDTOList.stream().filter(billDetailDTO -> billDetailDTO.getBillingStatementId()==null).collect(Collectors.toList()); + //遍历集合并保存流水 + for (BillDetailDTO billDetailDTO : billDetailDTOListNoBillingStatementId) { + BillingStatementDTO billingStatementDTO = new BillingStatementDTO(); + BeanUtils.copyProperties(billDetailDTO,billingStatementDTO); + billingStatementDTO.setAccountExpenseType(billDetailDTO.getBillType()); + Long billingStatementId = billingStatementApplicationService.insertAndReturnId(billingStatementDTO); + //遍历billDetailDTOList集合,将计费流水号相同的,赋值计费流水id + billDetailDTOList.stream().filter(item -> item.getBillingFlow().equals(billDetailDTO.getBillingFlow())).forEach(billDetailDTO1 -> { + billDetailDTO1.setBillingStatementId(billingStatementId); + billDetailDTO1.setBillType(billManagePO.getBillType()); + billDetailDTO1.setBillManageId(billManagePO.getBillManageId()); + billDetailDTO1.setBillNumber(billManagePO.getBillNumber()); + }); + } + //保存账单明细 + Boolean flag = billDetailDomainService.saveBatch(billDetailDTOList); + //更新账单金额 + BillManageDO billManageDO = new BillManageDO(); + BeanUtils.copyProperties(billManagePO,billManageDO); + billManageDO.setBillAmount(billingAmount); + billManageDO.setBillAmountUnsettled(billingAmount); + billManageDO.setBillDiscountAmount(billingDiscountAmount); + billManageDO.setBillTotalAmount(billingTotalAmount); + billManageDO.setCostAccuracyCode(billManageDTO.getCostAccuracyCode()); + billManageDO.setTailCalculationCode(billManageDTO.getTailCalculationCode()); + billManageDO.setAmountAccuracyCode(billManageDTO.getAmountAccuracyCode()); + billManageDO.setBillDiscount(billManageDTO.getBillDiscount()); + billManageDO.setBillDiscountLimit(billManageDTO.getBillDiscountLimit()); + billManageDO.setCreateTime(billManageDTO.getCreateTime()); + billManageDO.setUpdateTime(new Date()); + billManageDO.setUpdateBy(loginUser.getUserid()); + billManageDO.setUpdateByName(loginUser.getUserPo().getUserName()); + billManageDomainService.handlData(billManageDO); + Boolean flagTwo = billManageDomainService.update(billManageDO); + //调整账单操作日志 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageId(billManageDO.getBillManageId()); + billOperationLogDO.setOperationInfo(StringUtils.format(BillLogsConstants.change_bill_text, billManageDO.getBillAmount())); + billOperationLogDO.setOperationType(2); + boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO); + return flag && flagTwo && three; + } + + /** + * 应收账单-客户确认 + */ + @Transactional + public Boolean customerConfirmation(BillManageDTO billManageDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillManagePO billManagePO = billManageDomainService.getInfo(billManageDTO.getBillManageId()); + if(null == billManagePO){ + throw new ServiceException("账单信息未找到"); + } + if(billManageDTO.getBillDetailDTOList()==null || billManageDTO.getBillDetailDTOList().size()==0){ + throw new ServiceException("账单明细不能为空"); + } + if(billManagePO.getBillState() != 2 || billManagePO.getBillStep() != 2){ + throw new ServiceException("账单状态错误,不可操作客户确认"); + } + List billDetailDTOList = billManageDTO.getBillDetailDTOList(); + //更新账单金额 + BillManageDO billManageDO = new BillManageDO(); + billManageDO.setBillManageId(billManagePO.getBillManageId()); + billManageDO.setReconciliationStatus(billManageDTO.getReconciliationStatus()); + billManageDO.setReconciliationOpinion(billManageDTO.getReconciliationOpinion()); + billManageDO.setVoucherAddress(billManageDTO.getVoucherAddress()); + billManageDO.setBillStep(3); + billManageDO.setUpdateTime(new Date()); + billManageDO.setUpdateBy(loginUser.getUserid()); + billManageDO.setUpdateByName(loginUser.getUserPo().getUserName()); + //只有申请调账,才去修改明细 + Boolean flag = true; + String operationInfo = BillLogsConstants.customer_confirm_text_one; + if(billManageDTO.getReconciliationStatus() == 2){ + flag = billDetailDomainService.changeAmount(billDetailDTOList); + //计算集合期望金额 + BigDecimal billExpectedAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingExpectedAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + billManageDO.setBillExpectedAmount(billExpectedAmount); + operationInfo = StringUtils.format(BillLogsConstants.customer_confirm_text_two,billManageDTO.getReconciliationOpinion(),billExpectedAmount); + } + //保存操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageId(billManageDO.getBillManageId()); + billOperationLogDO.setOperationInfo(operationInfo); + billOperationLogDO.setOperationType(5); + Boolean flagTwo = billManageDomainService.update(billManageDO); + Boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO); + return flag && flagTwo && three; + } + + + /** + * 财务审核 + */ + public Boolean financialReview(BillManageDTO billManageDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillManagePO billManagePO = billManageDomainService.getInfo(billManageDTO.getBillManageId()); + if(null == billManagePO){ + throw new ServiceException("账单信息未找到"); + } + if(billManageDTO.getBillDetailDTOList()==null || billManageDTO.getBillDetailDTOList().size()==0){ + throw new ServiceException("账单明细不能为空"); + } + if(billManagePO.getBillState() != 2 || billManagePO.getBillStep() != 3 || (billManagePO.getReconciliationStatus() != 4 && billManagePO.getReconciliationStatus() != 2)){ + throw new ServiceException("账单状态错误,不可操作审核"); + } + List billDetailDTOList = billManageDTO.getBillDetailDTOList(); + //只有审核拒绝,才去修改明细 + Boolean flag = billDetailDomainService.changeAmount(billDetailDTOList); + + //计算集合中所有账单总额、账单金额、账单优惠金额 + BigDecimal billingTotalAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billingAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billingDiscountAmount = billDetailDTOList.stream().map(BillDetailDTO::getBillingDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + + //更新账单金额 + BillManageDO billManageDO = new BillManageDO(); + billManageDO.setBillManageId(billManagePO.getBillManageId()); + billManageDO.setReconciliationStatus(billManageDTO.getReconciliationStatus()); + billManageDO.setReconciliationOpinion(billManageDTO.getReconciliationOpinion()); + billManageDO.setFinancialReviewOpinion(billManageDTO.getFinancialReviewOpinion()); + billManageDO.setBillAmount(billingAmount); + billManageDO.setBillAmountUnsettled(billingAmount); + billManageDO.setBillDiscountAmount(billingDiscountAmount); + billManageDO.setBillTotalAmount(billingTotalAmount); + billManageDO.setCostAccuracyCode(billManageDTO.getCostAccuracyCode()); + billManageDO.setTailCalculationCode(billManageDTO.getTailCalculationCode()); + billManageDO.setAmountAccuracyCode(billManageDTO.getAmountAccuracyCode()); + billManageDO.setBillDiscount(billManageDTO.getBillDiscount()); + billManageDO.setBillDiscountLimit(billManageDTO.getBillDiscountLimit()); + billManageDO.setUpdateTime(new Date()); + billManageDO.setUpdateBy(loginUser.getUserid()); + billManageDO.setUpdateByName(loginUser.getUserPo().getUserName()); + billManageDO.setFinancialReviewFlag(billManageDTO.getFinancialReviewFlag()); + billManageDomainService.handlData(billManageDO); + String operationInfo = ""; + if(billManageDTO.getFinancialReviewFlag()==1){ + //同意审核 + billManageDO.setReconciliationStatus(4); + billManageDO.setBillStep(4); + billManageDO.setBillState(3); + operationInfo = StringUtils.format(BillLogsConstants.financial_review_text_one,billManageDO.getFinancialReviewOpinion(),billManageDO.getBillAmount()); + }else { + //拒绝审核 + billManageDO.setReconciliationStatus(1); + billManageDO.setBillStep(2); + operationInfo = StringUtils.format(BillLogsConstants.financial_review_text_two,billManageDO.getFinancialReviewOpinion(),billManageDO.getBillAmount()); + } + //保存操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageId(billManageDO.getBillManageId()); + billOperationLogDO.setOperationInfo(operationInfo); + billOperationLogDO.setOperationType(6); + Boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO); + Boolean flagTwo = billManageDomainService.update(billManageDO); + return flag && flagTwo && three; + } + + + /** + * 获取账单详情 + */ + public Map getDetailsById(BillManageDTO billManageDTO) { + //该详情由三部分组成:账单信息、收款信息、操作日志 + if(billManageDTO.getBillManageId() == null){ + throw new ServiceException("账单id不能为空"); + } + Map result = new HashMap<>(); + BillManagePO billManagePO = billManageDomainService.getDetailsById(billManageDTO.getBillManageId()); + result.put("billManage",billManagePO); + if(billManagePO.getBillType()==1){ + List receiptManagePOList = receiptManageDomainService.getDetailsByBillManageId(billManageDTO.getBillManageId()); + result.put("billPayment",receiptManagePOList); + }else { + List paymentOrderPOList = paymentOrderDomainService.getDetailsByBillManageId(billManageDTO.getBillManageId()); + result.put("billPayment",paymentOrderPOList); + } + result.put("billOperationLog",billOperationLogDomainService.getDetailsById(billManageDTO.getBillManageId())); + return result; + } + + /** + * 列表查询统计 + */ + public Map listCount(BillManageDO billManageDO) { + Map result = new HashMap<>(); + result.put("all","0"); + result.put("uncleared","0"); + result.put("settled","0"); + result.put("invalid","0"); + billManageDO.setQueryParam(0); + List billManagePOList = queryList(billManageDO); + //过滤出账单状态billState<5的为uncleared + long uncleared = billManagePOList.stream().filter(billManagePO -> billManagePO.getBillState() < 5).count(); + long settled = billManagePOList.stream().filter(billManagePO -> billManagePO.getBillState() == 5).count(); + long invalid = billManagePOList.stream().filter(billManagePO -> billManagePO.getBillState() == 6).count(); + result.put("all", String.valueOf(billManagePOList.size())); + result.put("uncleared",String.valueOf(uncleared)); + result.put("settled",String.valueOf(settled)); + result.put("invalid",String.valueOf(invalid)); + return result; + } + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billOperationLog/BillOperationLogApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billOperationLog/BillOperationLogApplicationService.java new file mode 100644 index 000000000..0f37ced97 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billOperationLog/BillOperationLogApplicationService.java @@ -0,0 +1,72 @@ +package com.mhd.bms.application.server.billOperationLog; + +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; +/** + * 账单操作日志ApplicationService + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class BillOperationLogApplicationService { + @Autowired + private BillOperationLogDomainService billOperationLogDomainService; + + + /** + * 分页查询账单操作日志列表 + */ + + public List queryList(BillOperationLogDO billOperationLogDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + billOperationLogDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return billOperationLogDomainService.queryList(billOperationLogDO); + } + + + /** + * 新增账单操作日志 + */ + public Boolean insert(BillOperationLogDO billOperationLogDO) { + + return billOperationLogDomainService.insert(billOperationLogDO); + } + + /** + * 修改账单操作日志 + */ + public Boolean update(BillOperationLogDO billOperationLogDO) { + return billOperationLogDomainService.update(billOperationLogDO); + } + + /** + * 批量删除账单操作日志 + */ + public boolean delete(Long[] billOperationLogIds) { + return billOperationLogDomainService.delete(billOperationLogIds); + } + + /** + * 获取账单操作日志详细信息 + */ + public BillOperationLogPO getInfo(Long billOperationLogId) + { + return billOperationLogDomainService.getInfo(billOperationLogId); + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/BillingRulesApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/BillingRulesApplicationService.java new file mode 100644 index 000000000..53d08e7b2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/BillingRulesApplicationService.java @@ -0,0 +1,167 @@ +package com.mhd.bms.application.server.billingRules; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import com.mhd.bms.domain.billingRules.service.BillingParamsDomainService; +import com.mhd.bms.domain.billingRules.service.BillingRulesDomainService; +import com.mhd.bms.interfaces.dto.billingRules.BillingRulesDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 计费规则ApplicationService + * + * @author gen + * @date 2024-07-12 + */ +@Service +@Slf4j +public class BillingRulesApplicationService { + @Autowired + private BillingRulesDomainService billingRulesDomainService; + @Autowired + private BillingParamsDomainService billingParamsDomainService; + + + /** + * 分页查询计费规则列表 + */ + + public List queryList(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + billingRulesDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return billingRulesDomainService.queryList(billingRulesDO); + } + + + /** + * 新增计费规则 + */ + @Transactional + public Boolean insert(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(billingRulesDO.getBillingParamsDTOList()==null || billingRulesDO.getBillingParamsDTOList().size()==0){ + throw new ServiceException("计费参数不能为空"); + } + //校验计费规则编码是否重复 + BillingRulesPO billingRulesPO = billingRulesDomainService.getInfoByCode(billingRulesDO.getBillingRulesCode()); + if (ObjectUtil.isNotEmpty(billingRulesPO)) { + throw new ServiceException("计费规则编码重复"); + } + //保存计费规则 + boolean flag = billingRulesDomainService.insert(billingRulesDO); + //保存计费参数(计费参数在表单中缓存,在最终提交时保存) + boolean flagTwo = billingParamsDomainService.saveBillParam(billingRulesDO); + return flag && flagTwo; + } + + + /** + * 修改计费规则 + */ + public Boolean update(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(billingRulesDO.getBillingParamsDTOList()==null || billingRulesDO.getBillingParamsDTOList().size()==0){ + throw new ServiceException("计费参数不能为空"); + } + //校验计费规则编码是否重复 + BillingRulesPO billingRulesPO = billingRulesDomainService.getInfoByCode(billingRulesDO.getBillingRulesCode()); + if (billingRulesPO != null && !Objects.equals(billingRulesPO.getBillingRulesId(), billingRulesDO.getBillingRulesId())) { + throw new ServiceException("计费规则编码重复"); + } + //更新计费规则 + boolean flag = billingRulesDomainService.update(billingRulesDO); + //更新计费参数(计费参数在表单中缓存,在最终提交时保存) + boolean flagTwo = billingParamsDomainService.updateBillParam(billingRulesDO); + return flag && flagTwo; + } + + /** + * 批量删除计费规则 + */ + public boolean delete(Long[] billingRulesIds) { + return billingRulesDomainService.delete(billingRulesIds); + } + + /** + * 获取计费规则详细信息 + */ + public BillingRulesPO getInfo(Long billingRulesId) + { + if(null == billingRulesId){ + throw new ServiceException("计费规则id不能为空"); + } + return billingRulesDomainService.getInfo(billingRulesId); + } + + + /** + * 根据id删除 + */ + public Boolean deleteByIds(BillingRulesDTO billingRulesDTO) { + if(!StringUtils.isNotEmpty(billingRulesDTO.getBillingRulesIds())){ + throw new ServiceException("选中计费规则不能为空"); + } + Set billingRulesIdSet = Stream.of(billingRulesDTO.getBillingRulesIds().split(",")).collect(Collectors.toSet()); + Long[] billingRulesIds = billingRulesIdSet.stream().map(Long::valueOf).toArray(Long[]::new); + return billingRulesDomainService.delete(billingRulesIds); + } + + /** + * 修改计费规则状态 + */ + public Boolean changeStates(BillingRulesDTO billingRulesDTO) { + if(billingRulesDTO.getBillingRulesId() == null){ + throw new ServiceException("计费规则id不能为空"); + } + return billingRulesDomainService.changeStates(billingRulesDTO); + } + + + /** + * 根据id查询计费规则信息 + */ + public BillingRulesPO getInfoById(BillingRulesDTO billingRulesDTO) { + if(billingRulesDTO.getBillingRulesId() == null){ + throw new ServiceException("计费规则id不能为空"); + } + return billingRulesDomainService.getInfoById(billingRulesDTO.getBillingRulesId()); + } + + /** + * 根据编码查询计费规则信息 + */ + public BillingRulesPO getInfoByCode(String billingRulesCode) { + if(StringUtils.isEmpty(billingRulesCode)){ + throw new ServiceException("计费策略编码不能为空"); + } + return billingRulesDomainService.getInfoByCode(billingRulesCode); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java new file mode 100644 index 000000000..71c83d8cb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingRules/CostCalculationApplicationService.java @@ -0,0 +1,340 @@ +package com.mhd.bms.application.server.billingRules; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.service.BillingParamsDomainService; +import com.mhd.bms.domain.billingRules.service.BillingRulesDomainService; +import com.mhd.bms.domain.costCalculation.entity.BillingOutputEntity; +import com.mhd.bms.domain.costCalculation.entity.BillingParamsEntity; +import com.mhd.bms.domain.costCalculation.po.BillingCostPo; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import com.mhd.bms.domain.taskFlowRecords.service.TaskFlowRecordsDomainService; +import com.mhd.bms.infrastructure.feign.vo.ContractManageDetailPO; +import com.mhd.bms.infrastructure.feign.vo.ContractManagePO; +import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO; +import com.mhd.bms.infrastructure.utils.DynamicCalculationUtil; +import com.mhd.bms.interfaces.dto.billingRules.CostCalculationDTO; +import com.mhd.common.core.domain.po.UserRoleMenuPO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.RegexUtil; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + + +/** + * 费用计算 + * + */ +@Service +@Slf4j +public class CostCalculationApplicationService { + + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private BillingRulesDomainService billingRulesDomainService; + @Autowired + private BillingParamsDomainService billingParamsDomainService; + @Autowired + private TaskFlowRecordsDomainService taskFlowRecordsDomainService; + @Autowired + private DocumentTypeDomainService documentTypeDomainService; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + + + + /** + * 费用计算器 + */ + public BillingCostPo costCalculation(CostCalculationDTO costCalculationDTO) { + /* 1:根据合同编码查询合同并根据费用科目,获取计费策略,查询计费策略计算对应的字段,判断传来的计费参数必填项是否完整 + 2:根据计费策略公式进行替换,并根据配置的公式计算结果 + 3:产生计费任务记录 + */ + //获取当前登录人信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillingCostPo result = new BillingCostPo(); + BeanUtils.copyProperties(costCalculationDTO, result); + TaskFlowRecordsDO taskFlowRecordsDO = new TaskFlowRecordsDO(); + //第一步 根据合同编码查询合同并根据费用科目,获取计费策略,查询计费策略计算对应的字段,判断传来的计费参数必填项是否完整 + BillingRulesPO billingRulesPO = chooseBillingParams(costCalculationDTO,taskFlowRecordsDO); + + //第二步 根据计费策略公式进行替换,并根据配置的公式计算结果 + BigDecimal computationalCost = computational(billingRulesPO,costCalculationDTO,taskFlowRecordsDO); + result.setComputationalCost(computationalCost); + + //第三步 产生计费任务记录 + taskFlowRecordsDO.setBillingResults(computationalCost.toString()); + taskFlowRecordsDO.setTaskFlow(OrderSequence.getOrderCode("JFRW")); + taskFlowRecordsDO.setRequestParams(JSON.toJSONString(costCalculationDTO)); + taskFlowRecordsDO.setOriginalBusinessNum(costCalculationDTO.getOriginalBusinessNum()); + Boolean flag = taskFlowRecordsDomainService.saveInCost(taskFlowRecordsDO); + if (!flag) { + throw new ServiceException("计费任务记录保存失败,请重试"); + } + + return result; + } + + + /** + * 校验必填,并获取本次计算合适的计费参数公式 + * @param costCalculationDTO 计算参数 + * @return 计费规则实体 + */ + private BillingRulesPO chooseBillingParams(CostCalculationDTO costCalculationDTO,TaskFlowRecordsDO taskFlowRecordsDO) { + //获取合同信息 + AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(costCalculationDTO.getContractNumber()); + if (!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("合同信息未找到"); + } + ContractManagePO contractPO = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class); + if (null == contractPO) { + throw new ServiceException("合同信息未找到"); + } + if(contractPO.getContractManageDetailPOList() == null || contractPO.getContractManageDetailPOList().size() == 0){ + throw new ServiceException("合同详情列表为空,无法进行计算"); + } + + //查询单据信息 + DocumentType documentType = documentTypeDomainService.queryByCode(costCalculationDTO.getDocumentTypeCode()); + if(documentType == null){ + throw new ServiceException("单据类型未找到"); + } + //遍历费用科目取出对应配置的费用科目项 + AjaxResult expenseAccountAjax = systemServiceFeign.getSubInfoByCode(costCalculationDTO.getSubjectCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("费用科目不存在或已被删除"); + } + ExpenseAccountPO expenseAccountPO = JSON.parseObject(JSONObject.toJSONString(expenseAccountAjax.get("data")), ExpenseAccountPO.class); + if (null == expenseAccountPO) { + throw new ServiceException("费用科目信息未找到"); + } + ContractManageDetailPO contractManageDetailPO = null; + //如果是一级科目 + if(expenseAccountPO.getFirstSubjectFlag()==1){ + contractManageDetailPO = contractPO.getContractManageDetailPOList().stream().filter(item -> ObjectUtil.equal(item.getFirstSubjectCode(),costCalculationDTO.getSubjectCode())).findAny().orElse(null); + taskFlowRecordsDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); + taskFlowRecordsDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); + }else { + contractManageDetailPO = contractPO.getContractManageDetailPOList().stream().filter(item -> ObjectUtil.equal(item.getSecondSubjectCode(),costCalculationDTO.getSubjectCode())).findAny().orElse(null); + taskFlowRecordsDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); + taskFlowRecordsDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); + taskFlowRecordsDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); + taskFlowRecordsDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + } + if(null == contractManageDetailPO){ + throw new ServiceException("合同中不包含该费用科目的计费策略,请查正后重试"); + } + //根据计费策略查询计费规则信息 + BillingRulesPO billingRulesPO = billingRulesDomainService.getInfo(contractManageDetailPO.getAccountingStrategyId()); + if(null == billingRulesPO){ + throw new ServiceException("计费策略信息未找到"); + } + //查询计费参数表获取参数字段,并判断所需字段是否必填 + List billingParamsPOList = billingParamsDomainService.getInfoByRuleId(billingRulesPO.getBillingRulesId()); + //先默认一个计费规则中有一个计费参数表 + if(billingParamsPOList ==null || billingParamsPOList.size() != 1){ + throw new ServiceException("计费规则未配置计费参数或参数不合规"); + } + //校验计算参数是否完整 + BillingParamsPO billingParamsPO = billingParamsPOList.get(0); + //使用反射校验字段必填是否完整 + List billingParamsEntityList = JSON.parseArray(billingParamsPO.getBillingParamsJson(), BillingParamsEntity.class); + JSONObject paramObj = JSONObject.parseObject(costCalculationDTO.getFormJson()); + billingParamsEntityList.forEach(item -> { + if(paramObj.get(item.getFields()) == null){ + throw new ServiceException("计费参数"+ item.getFields() +"不能为空"); + } + }); + billingRulesPO.setBillingParamsPOList(billingParamsPOList); + //查询结算对象信息 + if(contractPO.getSettlementCustomersId() != null){ + SettlementCustomersPO settlementCustomersPO = settlementCustomersDomainService.getInfo(contractPO.getSettlementCustomersId()); + if(null != settlementCustomersPO){ + taskFlowRecordsDO.setSettlementCustomersId(settlementCustomersPO.getSettlementCustomersId()); + taskFlowRecordsDO.setSettlementEntity(settlementCustomersPO.getSettlementEntity()); + taskFlowRecordsDO.setMainRole(settlementCustomersPO.getMainRole()); + } + } + taskFlowRecordsDO.setBelongModule(documentType.getBelongModule()); + taskFlowRecordsDO.setBelongModuleCode(documentType.getBelongModuleCode()); + taskFlowRecordsDO.setDocumentTypeId(documentType.getDocumentTypeId()); + taskFlowRecordsDO.setDocumentType(documentType.getDocumentType()); + taskFlowRecordsDO.setDocumentTypeCode(documentType.getDocumentTypeCode()); + taskFlowRecordsDO.setContractName(contractPO.getContractName()); + taskFlowRecordsDO.setContractNumber(contractPO.getContractNumber()); + taskFlowRecordsDO.setBillingRulesId(billingRulesPO.getBillingRulesId()); + taskFlowRecordsDO.setBillingRulesCode(billingRulesPO.getBillingRulesCode()); + taskFlowRecordsDO.setBillingRules(billingRulesPO.getBillingRulesName()); + return billingRulesPO; + } + + + /** + * 根据计费公式、计费参数 计算费用 + * @param billingRulesPO 计费策略 + * @param costCalculationDTO 计费参数 + * @param taskFlowRecordsDO 计费任务实体 + * @return 计费金额 + */ + private BigDecimal computational(BillingRulesPO billingRulesPO, CostCalculationDTO costCalculationDTO, TaskFlowRecordsDO taskFlowRecordsDO) { + String billingFormula = billingRulesPO.getBillingFormula(); + //第一版先默认计费规则中只有一条计费参数 + BillingParamsPO billingParamsPO = billingRulesPO.getBillingParamsPOList().get(0); + JSONObject paramObj = JSONObject.parseObject(costCalculationDTO.getFormJson()); + //需要判断阶梯类型进行获取各计费标志的取值,拼接公式 + List billingParamsEntityList = JSON.parseArray(billingParamsPO.getBillingParamsJson(), BillingParamsEntity.class); + //将计费参数实体分成两组,即:固定参数和条件参数 + List fixedParamsEntityList = billingParamsEntityList.stream().filter(item -> ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList()); + List ladderParamsEntityList = billingParamsEntityList.stream().filter(item -> !ObjectUtil.equal(item.getLadderType(),1)).collect(Collectors.toList()); + //获取输出字段 + List billingOutputEntityList = JSON.parseArray(billingParamsPO.getBillingOutputJson(), BillingOutputEntity.class); + //获取预制规则 + String preSetRules = billingParamsPO.getPreSetRules(); + //获取字段序号下,所有有值的预置规则 + JSONArray preSetRulesArray = JSONArray.parseArray(preSetRules); + + //==============固定参数直接替换=============== + if(fixedParamsEntityList.size()>0){ + for (BillingParamsEntity billingParamsEntity : fixedParamsEntityList) { + String flagValue = paramObj.getString(billingParamsEntity.getFields()); + //替换计费公式中的代号 + billingFormula = billingFormula.replace(billingParamsEntity.getChargingId(), flagValue); + } + } + + //=============条件参数需要根据条件满足情况取值预置规则中的数据=========== + if(ladderParamsEntityList.size() > 0){ + if(preSetRulesArray.size()==0){ + throw new ServiceException("阶梯计算没有预置规则,请检查后重试"); + } + BillingParamsEntity ladderParamsEntity = ladderParamsEntityList.stream().filter(item -> item.getLadderType()>2).findAny().orElse(null); + //循环预置规则,根据条件参数,找出满足条件的唯一规则,并替换公式 + JSONObject ladderParams = new JSONObject(); + for (Object rule : preSetRulesArray) { + JSONObject jsonObject = (JSONObject) rule; + //参数集合map + Map params = new HashMap<>(); + for (BillingParamsEntity billingParamsEntity : ladderParamsEntityList) { + String flagValue = paramObj.getString(billingParamsEntity.getFields()); + params.put("fields"+billingParamsEntity.getSort(), flagValue); + } + if(null != ladderParamsEntity){ + //有特殊阶梯时,需要对特殊阶梯特殊处理 + String ladderParam = "fields" + ladderParamsEntity.getSort(); + //先满足阶梯,在判断无阶梯 + String ladderNum = params.get(ladderParam); + String outLadderNum = jsonObject.get(ladderParam).toString(); + if(determineParam(ladderNum,outLadderNum)){ + //将该特殊阶梯从jsonObject集合中移除 +// jsonObject.remove(ladderParam); + ladderParams = jsonObject; + break; + } + } + else { + //全部是无阶梯时 + //判断jsonObject中的取值是否和参数集合paramObj中的值一致 + if(params.values().containsAll(jsonObject.values())){ + ladderParams = jsonObject; + break; + } + } + } + for (BillingParamsEntity billingParamsEntity : ladderParamsEntityList) { + String flagValue = ladderParams.getString("outFields" + billingParamsEntity.getSort()); + //替换计费公式中的代号 + billingFormula = billingFormula.replace(billingParamsEntity.getChargingId(), flagValue); + } + //拿到满足条件的预置规则后,替换输出字段,和输入字段 + if(billingOutputEntityList.size()>0){ + for (BillingOutputEntity billingOutputEntity : billingOutputEntityList) { + //获取输出字段的序号,并取对应序号下的 + String outFields = ladderParams.getString("outFields" + billingOutputEntity.getSort()); + //替换公式 + billingFormula = billingFormula.replace(billingOutputEntity.getOutChargingId(), outFields); + } + } + } + else { + //==================没有条件参数的时候,也要过滤输出字段,输出字段直接替换=============== + if(billingOutputEntityList.size()>0){ + if(preSetRulesArray.size()==0){ + throw new ServiceException("输出字段没有预置规则,请检查后重试"); + } + //直接取值输出字段对应的预置规则信息,没有条件参数时,预置规则默认只取第一条 + JSONObject jsonObject = preSetRulesArray.getJSONObject(0); + for (BillingOutputEntity billingOutputEntity : billingOutputEntityList) { + //获取输出字段的序号,并取对应序号下的 + String outFields = jsonObject.getString("outFields" + billingOutputEntity.getSort()); + //替换公式 + billingFormula = billingFormula.replace(billingOutputEntity.getOutChargingId(), outFields); + } + } + } + //这里用正则校验是否还含有英文或者汉字 + if(RegexUtil.isEngOrChinese(billingFormula)){ + throw new ServiceException("计费公式不合规,请重试"); + } + taskFlowRecordsDO.setBillingProcess(billingFormula); + //用拼接好的公式,计算 + return DynamicCalculationUtil.calculate(billingFormula); + } + + /** + * 判断阶梯参数是否满足 + * @param ladderNum 传来的阶梯参数 + * @param outLadderNum 预置规则参数 + * @return 是否满足 + */ + private boolean determineParam(String ladderNum, String outLadderNum) { + int ladderNumInt = Integer.parseInt(ladderNum); + //将outLadderNum中的 (替换为>, )替换为<,[替换为<=,]替换为>=,并且判断ladderNum是否在条件范围中 + //将数值用逗号拆分 + int lowerBound = Integer.parseInt(outLadderNum.substring(1, outLadderNum.indexOf(','))); + int upperBound = Integer.parseInt(outLadderNum.substring(outLadderNum.indexOf(',') + 1, outLadderNum.length() - 1)); + + if(outLadderNum.contains("(") && outLadderNum.contains("]")){ + if(ladderNumInt > lowerBound && ladderNumInt <= upperBound){ + return true; + } + } + if(outLadderNum.contains("[") && outLadderNum.contains(")")){ + if(ladderNumInt >= lowerBound && ladderNumInt < upperBound){ + return true; + } + } + return false; + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billingStatement/BillingStatementApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingStatement/BillingStatementApplicationService.java new file mode 100644 index 000000000..ed74c5807 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billingStatement/BillingStatementApplicationService.java @@ -0,0 +1,501 @@ +package com.mhd.bms.application.server.billingStatement; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.mhd.bms.application.server.billManage.BillManageApplicationService; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.infrastructure.feign.vo.ContractManagePO; +import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO; +import com.mhd.bms.interfaces.assembler.billingStatement.BillingStatementAssembler; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.domain.po.OrganizationPo; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.domain.po.projectManagement.ProjectManagementPO; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.ProductServiceFeign; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 计费流水ApplicationService + * + * @author gen + * @date 2024-06-26 + */ +@Service +@Slf4j +public class BillingStatementApplicationService { + @Autowired + private BillingStatementDomainService billingStatementDomainService; + @Autowired + private ProductServiceFeign productServiceFeign; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + @Autowired + private BillManageApplicationService billManageApplicationService; + @Autowired + private BillManageDomainService billManageDomainService; + + + /** + * 分页查询计费流水列表 + */ + + public List queryList(BillingStatementDO billingStatementDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return billingStatementDomainService.queryList(billingStatementDO); + } + + /** + * 查询出账汇总 + */ + public List queryCollectList(BillingStatementCollectDO billingStatementCollectDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + billingStatementCollectDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return billingStatementDomainService.queryCollectList(billingStatementCollectDO); + } + + /** + * 查询出账未出账全部 + */ + public Map collectListSize(BillingStatementCollectDO billingStatementCollectDO) { + Map map = new HashMap<>(); + map.put("notBeen","0"); + map.put("been","0"); + map.put("all","0"); + billingStatementCollectDO.setBillingState(0); + List all = queryCollectList(billingStatementCollectDO); + //统计出all集合中billingStateCount字段中含有的1和2的数量 + long notBeen = all.stream().filter(billingStatementCollectPO -> billingStatementCollectPO.getBillingStateCount().contains("1") || billingStatementCollectPO.getBillingStateCount().contains("2")).count(); + //统计出all集合中billingStateCount字段中含有的3的数量 + long been = all.stream().filter(billingStatementCollectPO -> billingStatementCollectPO.getBillingStateCount().contains("3")).count(); + map.put("notBeen",String.valueOf(notBeen)); + map.put("been",String.valueOf(been)); + map.put("all", String.valueOf(all.size())); + return map; + } + + /** + * 查询出账详情 + */ + public List queryDetails(BillingStatementCollectDO bdo) { + return billingStatementDomainService.queryDetails(bdo); + } + + + /** + * 新增计费流水 + */ + public Boolean insert(BillingStatementDO billingStatementDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //处理数据 + handleDate(billingStatementDO); + + billingStatementDO.setDataSources(2); + billingStatementDO.setBillingFlow(OrderSequence.getOrderCode("JFLS")); + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return billingStatementDomainService.insert(billingStatementDO); + } + + /** + * 处理数据 + */ + private void handleDate(BillingStatementDO billingStatementDO) { + if (billingStatementDO.getOrganizationId() != null) { + //获取组织信息 + AjaxResult ajaxResult = productServiceFeign.getOrganizationInfo(billingStatementDO.getOrganizationId()); + if (!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("选中组织信息未找到"); + } + OrganizationPo organizationPo = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), OrganizationPo.class); + if (null == organizationPo) { + throw new ServiceException("组织信息未找到"); + } + billingStatementDO.setOrganizationName(organizationPo.getOrganizationName()); + billingStatementDO.setTopOrganizationId(organizationPo.getParentOrganizationId()); + } + //根据费用科目code查询费用信息,并赋值 + if (StringUtils.isNotEmpty(billingStatementDO.getSecondSubjectCode())) { + AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(billingStatementDO.getSecondSubjectCode()); + if ("200".equals(String.valueOf(ajaxResult.get("code")))) { + ExpenseAccountPO expenseAccountPO = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class); + if (null == expenseAccountPO) { + throw new ServiceException("费用科目信息未找到"); + } + if (expenseAccountPO.getFirstSubjectFlag() == 1) { + //如果是一级科目 + billingStatementDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); + billingStatementDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); + billingStatementDO.setSecondSubjectCode(""); + billingStatementDO.setSecondSubjectName(""); + } else { + //不是一级科目 + billingStatementDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); + billingStatementDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); + billingStatementDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); + billingStatementDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + } + billingStatementDO.setBelongModuleCode(expenseAccountPO.getBelongModuleCode()); + billingStatementDO.setBelongModule(expenseAccountPO.getBelongModule()); + } + } + //根据结算对象id查询结算对象数据,并赋值 + if (StringUtils.isNotEmpty(billingStatementDO.getSettlementCustomersCode())) { + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(billingStatementDO.getSettlementCustomersCode()); + if (null != settlementCustomers) { + billingStatementDO.setSettlementCustomersCode(settlementCustomers.getSettlementCustomersCode()); + billingStatementDO.setSettlementEntity(settlementCustomers.getSettlementEntity()); + billingStatementDO.setSettlementCustomersId(settlementCustomers.getSettlementCustomersId()); + } + } + //根据费用类型id查询费用类型对象数据,并赋值 + if (StringUtils.isNotEmpty(billingStatementDO.getServiceItemsCode())) { + AjaxResult ajaxResult = systemServiceFeign.getServiceItemsByCode(billingStatementDO.getServiceItemsCode()); + if (!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("费用类型未找到"); + } + billingStatementDO.setServiceItemsManageId(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getLong("serviceItemsManageId")); + billingStatementDO.setServiceItemsName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("serviceItemsName")); + } + //根据合同编码查询合同信息,并赋值 + if (StringUtils.isNotEmpty(billingStatementDO.getContractNumber())) { + AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(billingStatementDO.getContractNumber()); + if (!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("合同信息未找到"); + } + ContractManagePO contractPO = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class); + if (null == contractPO) { + throw new ServiceException("合同信息未找到"); + } + billingStatementDO.setContractName(contractPO.getContractName()); + billingStatementDO.setContractManageId(contractPO.getContractManageId()); + billingStatementDO.setContractType(contractPO.getContractType()); + } + //根据项目编码,查询项目信息并赋值 + if (StringUtils.isNotEmpty(billingStatementDO.getProjectCode())) { + AjaxResult ajaxResult = systemServiceFeign.getProjectByCode(billingStatementDO.getProjectCode()); + if (!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("项目信息未找到"); + } + ProjectManagementPO projectManagePO = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ProjectManagementPO.class); + if (null == projectManagePO) { + throw new ServiceException("项目信息未找到"); + } + billingStatementDO.setProjectManageId(projectManagePO.getProjectManagementId()); + billingStatementDO.setProjectName(projectManagePO.getProjectManagementName()); + } + //来源系统 + if (StringUtils.isNotEmpty(billingStatementDO.getBelongModuleCode())){ + List modulesTypeList = null; + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.MODULES.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + modulesTypeList = JSON.parseArray(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if (modulesTypeList != null && modulesTypeList.size() > 0){ + for (SysDictDataVo sysDictDataVo : modulesTypeList) { + if (billingStatementDO.getBelongModuleCode().equals(sysDictDataVo.getDictValue())){ + billingStatementDO.setBelongModule(sysDictDataVo.getDictLabel()); + break; + } + } + } + } + + } + + /** + * 修改计费流水 + */ + public Boolean update(BillingStatementDO billingStatementDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //处理数据 + handleDate(billingStatementDO); + + return billingStatementDomainService.update(billingStatementDO); + } + + /** + * 批量删除计费流水 + */ + public boolean delete(Long[] billingStatementIds) { + return billingStatementDomainService.delete(billingStatementIds); + } + + /** + * 获取计费流水详细信息 + */ + public BillingStatementPO getInfo(Long billingStatementId) { + return billingStatementDomainService.getInfo(billingStatementId); + } + + + /** + * 根据id删除计费流水 + */ + public Boolean deleteByIds(BillingStatementDTO billingStatementDTO) { + //只有已作废状态的记录可以操作删除 + if (!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())) { + throw new ServiceException("所选数据不能为空"); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Set billingStatementIds = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + Long[] documentTypeIds = billingStatementIds.stream().map(Long::valueOf).toArray(Long[]::new); + return billingStatementDomainService.delete(documentTypeIds); + } + + /** + * 批量审核 + */ + @Transactional + public void reviewBilling(BillingStatementDTO billingStatementDTO) { + if (!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())) { + throw new ServiceException("所选审核对象不能为空"); + } + billingStatementDomainService.reviewBilling(billingStatementDTO); + } + + + /** + * 批量费用红冲 + */ + @Transactional + public void redFlushBilling(BillingStatementDTO billingStatementDTO) { + if (!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())) { + throw new ServiceException("所选红冲对象不能为空"); + } + billingStatementDomainService.redFlushBilling(billingStatementDTO); + } + + + /** + * 生成账单 + */ + @Transactional + public Boolean generateBills(BillingStatementDTO billingStatementDTO) { + //获取当前登录用户信息 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + /* + 首先对账单主体、来源系统、账单类型、组织进行唯一校验 + 对要生成账单的流水加锁 + 然后判断流水状态是否满足生成账单需求 + 最后生成账单 + */ + billingStatementDomainService.checkUniqueEntity(billingStatementDTO.getBillingStatementIds()); + //校验完成后,生成账单 + Boolean flag1 = billManageApplicationService.saveBill(billingStatementDTO); + //修改流水状态 + billingStatementDTO.setBillingState(3); + Boolean flag2 = billingStatementDomainService.updateBillingState(billingStatementDTO); + if (flag1 && flag2) { + return true; + } else { + throw new ServiceException("生成账单失败"); + } + } + + + /** + * 批量流水作废 + */ + @Transactional + public void nullifyByIds(BillingStatementDTO billingStatementDTO) { + + if (!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())) { + throw new ServiceException("所选作废对象不能为空"); + } + billingStatementDomainService.nullifyByIds(billingStatementDTO); + } + + + /** + * 查询批量出账列表 + */ + public List queryPaymentOutList(BillingStatementDO billingStatementDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + List billManagePOList = new ArrayList<>(); + List billingStatementPOList = billingStatementDomainService.queryPaymentOutList(billingStatementDO); + if(billingStatementPOList != null && billingStatementPOList.size() > 0){ + //按 结算对象、来源系统、收支类型、组织进行分组 + Map> billingStatementPOSMap = billingStatementPOList.stream().collect(Collectors.groupingBy(billingStatementPO -> billingStatementPO.getOrganizationId()+"_"+billingStatementPO.getSettlementCustomersCode()+"_"+billingStatementPO.getAccountExpenseType()+"_"+billingStatementPO.getBelongModuleCode())); + billingStatementPOSMap.forEach((key,value)->{ + if(value.size()>0){ + //生成账单浏览 + BillManagePO billManagePO = billManageDomainService.getBillBrowse(value); + billManagePOList.add(billManagePO); + } + }); + } + return billManagePOList; + } + + + /** + * 批量生成账单 + */ + @Transactional + public void batchGenerateBills(BillingStatementDTO billingStatementDTO) { + /* + 首先查询所有数据,并根据结算对象、来源系统、收支类型、组织进行分组 + 然后每组分别调用生成账单 + 如果生成失败,则回滚流水账单到已审核状态,如果成功则状态更新到已出账 + */ + //校验是否可进行生成账单操作 + if (!billingStatementDomainService.checkGenerateBills(billingStatementDTO)) { + throw new ServiceException("生成账单失败,请刷新后再试"); + } + billingStatementDomainService.batchGenerateBills(billingStatementDTO); + } + + + /** + * 查询计费流水列表统计 + */ + public Map queryListCount(BillingStatementDO billingStatementDO) { + Map result = new HashMap<>(); + result.put("all","0"); + result.put("outgoing","0"); + result.put("unpaidAccount","0"); + result.put("other","0"); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + List billingStatementPOS = billingStatementDomainService.queryList(billingStatementDO); + if(billingStatementPOS != null && billingStatementPOS.size() > 0){ + //过滤出流水状态为待审核和已审核的并统计 + long unpaidAccount = billingStatementPOS.stream().filter(billingStatementPO -> billingStatementPO.getBillingState() == 1 || billingStatementPO.getBillingState() == 2).count(); + long outgoing = billingStatementPOS.stream().filter(billingStatementPO -> billingStatementPO.getBillingState() == 3).count(); + long other = billingStatementPOS.stream().filter(billingStatementPO -> billingStatementPO.getBillingState() == 4 || billingStatementPO.getBillingState() == 5).count(); + result.put("all",String.valueOf(billingStatementPOS.size())); + result.put("outgoing",String.valueOf(outgoing)); + result.put("unpaidAccount",String.valueOf(unpaidAccount)); + result.put("other",String.valueOf(other)); + } + return result; + } + + + /** + * 新增并返回id + */ + public Long insertAndReturnId(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillingStatementDO billingStatementDO = new BillingStatementAssembler().toDO(billingStatementDTO); + //处理数据 + handleDate(billingStatementDO); + + billingStatementDO.setDataSources(2); + if(StringUtils.isEmpty(billingStatementDO.getBillingFlow())){ + billingStatementDO.setBillingFlow(OrderSequence.getOrderCode("JFLS")); + } + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return billingStatementDomainService.insertAndReturnId(billingStatementDO); + } + + /** + * 应收账单-添加费用 + */ + public BillingStatementPO addCost(BillingStatementDO billingStatementDO) { + /* + 此方法只进行实体返回,并不进行数据保存 + */ + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillingStatementPO billingStatementPO = new BillingStatementPO(); + //处理数据 + handleDate(billingStatementDO); + BeanUtils.copyProperties(billingStatementDO,billingStatementPO); + billingStatementPO.setBillingTotalAmount(billingStatementDO.getBillingAmount()); + billingStatementPO.setDataSources(2); + billingStatementPO.setBillingFlow(OrderSequence.getOrderCode("JFLS")); + billingStatementPO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingStatementPO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingStatementPO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return billingStatementPO; + } + + /** + * 应收账单-添加明细 + */ + public List getBillDetailsList(BillingStatementDO billingStatementDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + return billingStatementDomainService.getBillDetailsList(billingStatementDO); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java new file mode 100644 index 000000000..21f2bd2ee --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/businessDocument/BusinessDocumentApplicationService.java @@ -0,0 +1,725 @@ +package com.mhd.bms.application.server.businessDocument; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.application.server.billingRules.CostCalculationApplicationService; +import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; +import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import com.mhd.bms.domain.businessDocument.service.BusinessDocumentDomainService; +import com.mhd.bms.domain.costCalculation.po.BillingCostPo; +import com.mhd.bms.domain.documentType.entity.DocumentFromEntity; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.infrastructure.feign.vo.ContractManageDetailPO; +import com.mhd.bms.infrastructure.feign.vo.ContractManagePO; +import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO; +import com.mhd.bms.interfaces.assembler.businessDocument.BusinessDocumentAssembler; +import com.mhd.bms.interfaces.dto.billingRules.CostCalculationDTO; +import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO; +import com.mhd.common.core.domain.dto.BusinessDataPushDTO; +import com.mhd.common.core.domain.po.OrganizationPo; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.enums.BelongModuleCode; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.ProductServiceFeign; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 业务单据ApplicationService + * + * @author gen + * @date 2024-06-21 + */ +@Service +@Slf4j +public class BusinessDocumentApplicationService { + @Autowired + private BusinessDocumentDomainService businessDocumentDomainService; + @Autowired + private ProductServiceFeign productServiceFeign; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private DocumentTypeDomainService documentTypeDomainService; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + @Autowired + private BillingStatementDomainService billingStatementDomainService; + @Autowired + private CostCalculationApplicationService costCalculationApplicationService; + + + /** + * 分页查询业务单据列表 + */ + + public List queryList(BusinessDocumentDO businessDocumentDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return businessDocumentDomainService.queryList(businessDocumentDO); + } + + + /** + * 新增业务单据 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean insert(BusinessDocumentDO businessDocumentDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验使用的表单是否必填校验 + checkDoucumentType(businessDocumentDO); + //处理数据 + handleDate(businessDocumentDO); + businessDocumentDO.setDataSources(2); + businessDocumentDO.setBusinessFlow(OrderSequence.getOrderCode("LS")); + businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + businessDocumentDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + businessDocumentDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + //调用费用计算,计算费用金额进行保存 + CostCalculationDTO costCalculationDTO = new CostCalculationDTO(); + costCalculationDTO.setOriginalBusinessNum(businessDocumentDO.getOriginalBusinessNum()); + costCalculationDTO.setContractNumber(businessDocumentDO.getContractNumber()); + costCalculationDTO.setFormJson(businessDocumentDO.getDocumentFormJson()); + costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocumentDO.getSecondSubjectCode()) ? businessDocumentDO.getFirstSubjectCode():businessDocumentDO.getSecondSubjectCode()); + costCalculationDTO.setDocumentTypeCode(businessDocumentDO.getDocumentTypeCode()); + BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); + businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost()); +// businessDocumentDO.setEstimatedCost(new BigDecimal("100")); + return businessDocumentDomainService.insert(businessDocumentDO); + } + + /** + * 校验表单单据类型必填 + * @param businessDocumentDO + */ + private void checkDoucumentType(BusinessDocumentDO businessDocumentDO) { + if(!StringUtils.isNotEmpty(businessDocumentDO.getDocumentTypeCode())){ + throw new ServiceException("所选表单不能为空"); + } + DocumentType documentType = documentTypeDomainService.queryByCode(businessDocumentDO.getDocumentTypeCode()); + if(null == documentType){ + throw new ServiceException("表单类型信息未找到"); + } + if(StringUtils.isNotEmpty(documentType.getFormJson())){ + //将form的json数据转换为DocumentFromEntity实体集合 + List documentFromEntityList = JSONObject.parseArray(documentType.getFormJson(), DocumentFromEntity.class); + //将传来的documentFormJson表单json数据和查询出的集合比较,判断是否必填 + //将documentFormJson转为jsonObject + JSONObject businessDocumentDOJsonObject = JSONObject.parseObject(businessDocumentDO.getDocumentFormJson()); + documentFromEntityList.forEach(documentFromEntity -> { + if(documentFromEntity.getNotNull() == 1){ + if(businessDocumentDOJsonObject.get(documentFromEntity.getField()) == null){ + throw new ServiceException(documentFromEntity.getTitle()+"不能为空"); + } + } + }); + } + } + + /** + * 处理数据 + */ + private void handleDate(BusinessDocumentDO businessDocumentDO) { + if(businessDocumentDO.getOrganizationId() != null){ + //获取组织信息 + AjaxResult ajaxResult = productServiceFeign.getOrganizationInfo(businessDocumentDO.getOrganizationId()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ + throw new ServiceException("选中组织信息未找到"); + } + OrganizationPo organizationPo = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), OrganizationPo.class); + if(null == organizationPo){ + throw new ServiceException("组织信息未找到"); + } + businessDocumentDO.setOrganizationName(organizationPo.getOrganizationName()); + businessDocumentDO.setTopOrganizationId(organizationPo.getParentOrganizationId()); + if(organizationPo.getParentOrganizationId()==0){ + businessDocumentDO.setTopOrganizationId(businessDocumentDO.getOrganizationId()); + } + } + if(StringUtils.isNotEmpty(businessDocumentDO.getProjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getProjectByCode(businessDocumentDO.getProjectCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("项目信息未找到"); + } + businessDocumentDO.setProjectName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("projectName")); + businessDocumentDO.setProjectManageId(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getLong("projectManageId")); + } + //根据单据类型id查询单据类型数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getDocumentTypeCode())){ + DocumentType documentType = documentTypeDomainService.queryByCode(businessDocumentDO.getDocumentTypeCode()); + if(null != documentType){ + businessDocumentDO.setDocumentType(documentType.getDocumentType()); + businessDocumentDO.setDocumentTypeCode(documentType.getDocumentTypeCode()); + businessDocumentDO.setDocumentTypeId(documentType.getDocumentTypeId()); + } + } + //来源系统 + if (StringUtils.isNotEmpty(businessDocumentDO.getBelongModuleCode())){ + List modulesTypeList = null; + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.MODULES.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + modulesTypeList = JSON.parseArray(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if (modulesTypeList != null && modulesTypeList.size() > 0){ + for (SysDictDataVo sysDictDataVo : modulesTypeList) { + if (businessDocumentDO.getBelongModuleCode().equals(sysDictDataVo.getDictValue())){ + businessDocumentDO.setBelongModule(sysDictDataVo.getDictLabel()); + break; + } + } + } + } + + //根据结算对象code查询结算对象数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getSettlementCustomersCode())){ + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(businessDocumentDO.getSettlementCustomersCode()); + if(null == settlementCustomers){ + throw new ServiceException("结算对象信息未找到"); + } + businessDocumentDO.setSettlementCustomersCode(settlementCustomers.getSettlementCustomersCode()); + businessDocumentDO.setSettlementEntity(settlementCustomers.getSettlementEntity()); + businessDocumentDO.setSettlementCustomersId(settlementCustomers.getSettlementCustomersId()); + //如果前端没传项目code则从结算对象中获取 + if(StringUtils.isEmpty(businessDocumentDO.getProjectCode())){ + businessDocumentDO.setProjectCode(settlementCustomers.getProjectCode()); + businessDocumentDO.setProjectName(settlementCustomers.getProjectName()); + } + } + + //根据费用类型id查询费用类型对象数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getServiceItemsCode())){ + AjaxResult ajaxResult = systemServiceFeign.getServiceItemsByCode(businessDocumentDO.getServiceItemsCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("费用类型未找到"); + } + businessDocumentDO.setServiceItemsManageId(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getLong("serviceItemsManageId")); + businessDocumentDO.setServiceItemsName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("serviceItemsName")); + } + //根据费用科目code查询费用信息,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getSecondSubjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(businessDocumentDO.getSecondSubjectCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + ExpenseAccountPO expenseAccountPO = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class); + if(null == expenseAccountPO || expenseAccountPO.getExpenseAccountId()==null){ + throw new ServiceException("费用科目信息未找到"); + } + if(expenseAccountPO.getFirstSubjectFlag()==1){ + //如果是一级科目 + businessDocumentDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); + businessDocumentDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); + businessDocumentDO.setSecondSubjectCode(""); + }else { + //不是一级科目 + businessDocumentDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); + businessDocumentDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); + businessDocumentDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); + businessDocumentDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + } + //判断如果前端没有传费用类别,则此处根据费用科目获取关联费用类别 + if(StringUtils.isEmpty(businessDocumentDO.getServiceItemsCode())){ + AjaxResult ajaxResultServiceItems = systemServiceFeign.getServiceItemsById(businessDocumentDO.getServiceItemsManageId()); + if("200".equals(String.valueOf(ajaxResultServiceItems.get("code")))) { + businessDocumentDO.setServiceItemsCode(JSONObject.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResultServiceItems.get("data"))).getString("serviceItemsCode")); + businessDocumentDO.setServiceItemsName(JSONObject.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResultServiceItems.get("data"))).getString("serviceItemsName")); + } + } + } + } + //根据结算对象和费用科目,获取合同 + int contractType = 2; + if(businessDocumentDO.getBelongModuleCode().equals(BelongModuleCode.WMS.getCode())){ + contractType = 1; + } + AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomer(businessDocumentDO.getSettlementCustomersCode(),contractType); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("合同信息未找到"); + } + ContractManagePO contractPO = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class); + if (null == contractPO) { + throw new ServiceException("合同信息未找到"); + } + businessDocumentDO.setContractName(contractPO.getContractName()); + businessDocumentDO.setContractNumber(contractPO.getContractNumber()); + } + + /** + * 修改业务单据 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean update(BusinessDocumentDO businessDocumentDO) { + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.getInfo(businessDocumentDO.getBusinessDocumentId()); + if(null == businessDocumentPO){ + throw new ServiceException("业务单据信息未找到"); + } + if(businessDocumentPO.getDataSources()==1){ + throw new ServiceException("非手工录入数据,无法修改"); + } + //校验使用的表单是否必填校验 + checkDoucumentType(businessDocumentDO); + //处理数据 + handleDate(businessDocumentDO); + return businessDocumentDomainService.update(businessDocumentDO); + } + + /** + * 批量删除业务单据 + */ + public boolean delete(Long[] businessDocumentIds) { + return businessDocumentDomainService.delete(businessDocumentIds); + } + + /** + * 获取业务单据详细信息 + */ + public BusinessDocumentPO getInfo(Long businessDocumentId) + { + return businessDocumentDomainService.getInfo(businessDocumentId); + } + + + /** + * 同步业务单据数据 + */ + public String syncData(BusinessDocumentDO businessDocumentDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验必填项 + checkDoucumentType(businessDocumentDO); + //处理数据 + handleDate(businessDocumentDO); + String flow = OrderSequence.getOrderCode("LS"); + businessDocumentDO.setBusinessFlow(flow); + businessDocumentDO.setDataSources(1); + businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + businessDocumentDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + businessDocumentDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + + //TODO 计算费用并保存 + + businessDocumentDomainService.insert(businessDocumentDO); + return flow; + } + + + /** + * 费用重算(批量) + */ + @Transactional + public Boolean costRecalculation(List businessDocumentDTOList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(businessDocumentDTOList == null || businessDocumentDTOList.size()==0){ + throw new ServiceException("所选记录不能为空"); + } + //循环遍历并保存重算后金额 + List businessDocumentList = new ArrayList<>(); + for (BusinessDocumentDTO businessDocumentDTO : businessDocumentDTOList) { + BusinessDocument businessDocument = new BusinessDocument(); + businessDocument.setBusinessDocumentId(businessDocumentDTO.getBusinessDocumentId()); + businessDocument.setBillAmount(businessDocumentDTO.getNewBillAmount()); + businessDocument.setEstimatedCost(businessDocumentDTO.getRecalculateCost()); + businessDocument.setUpdateBy(loginUser.getUserPo().getUserId()); + businessDocument.setUpdateByName(loginUser.getUserPo().getUserName()); + businessDocument.setUpdateTime(new Date()); + businessDocumentList.add(businessDocument); + } + return businessDocumentDomainService.saveOrUpdateBatch(businessDocumentList); + } + + /** + * 批量删除业务单据 + * @param businessDocumentDTO + * @return + */ + @Transactional + public void deleteByIds(BusinessDocumentDTO businessDocumentDTO) { + //只有已作废状态的记录可以操作删除 + if(!StringUtils.isNotEmpty(businessDocumentDTO.getBusinessDocumentIds())){ + throw new ServiceException("所选数据不能为空"); + } + List businessDocumentIdLongList = new ArrayList<>(); + Set businessDocumentIds = Stream.of(businessDocumentDTO.getBusinessDocumentIds().split(",")).collect(Collectors.toSet()); + for (String businessDocumentId : businessDocumentIds) { + Long businessDocumentIdLong = Long.valueOf(businessDocumentId); + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.getInfo(businessDocumentIdLong); + if(null == businessDocumentPO){ + throw new ServiceException("业务单据信息未找到"); + } + if(businessDocumentPO.getBusinessState()!=5){ + throw new ServiceException("所选记录"+ businessDocumentPO.getBusinessFlow() +"未作废不可删除"); + } + businessDocumentIdLongList.add(businessDocumentIdLong); + } + if(businessDocumentIdLongList.size()>0){ + businessDocumentDomainService.deleteByIds(businessDocumentIdLongList); + } + } + + + /** + * 作废业务单据 + */ + @Transactional + public void nullifyByIds(BusinessDocumentDTO businessDocumentDTO) { + //只有未生效状态的记录可以操作作废 + if(!StringUtils.isNotEmpty(businessDocumentDTO.getBusinessDocumentIds())){ + throw new ServiceException("所选数据不能为空"); + } + List businessDocumentIdLongList = new ArrayList<>(); + Set businessDocumentIds = Stream.of(businessDocumentDTO.getBusinessDocumentIds().split(",")).collect(Collectors.toSet()); + for (String businessDocumentId : businessDocumentIds) { + Long businessDocumentIdLong = Long.valueOf(businessDocumentId); + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.getInfo(businessDocumentIdLong); + if(null == businessDocumentPO){ + throw new ServiceException("业务单据信息未找到"); + } + if(businessDocumentPO.getBusinessState()!=1){ + throw new ServiceException("所选记录"+ businessDocumentPO.getBusinessFlow() +"已生效不可作废"); + } + businessDocumentIdLongList.add(businessDocumentIdLong); + } + if(businessDocumentIdLongList.size()>0){ + businessDocumentDomainService.nullifyByIds(businessDocumentIdLongList); + } + } + + /** + * 生效业务单据 + */ + @Transactional + public void takeEffectByIds(BusinessDocumentDTO businessDocumentDTO) { + //只有未生效状态的记录可以操作生效变更为已生效状态 + if(!StringUtils.isNotEmpty(businessDocumentDTO.getBusinessDocumentIds())){ + throw new ServiceException("所选数据不能为空"); + } + List businessDocumentIdLongList = new ArrayList<>(); + Set businessDocumentIds = Stream.of(businessDocumentDTO.getBusinessDocumentIds().split(",")).collect(Collectors.toSet()); + for (String businessDocumentId : businessDocumentIds) { + Long businessDocumentIdLong = Long.valueOf(businessDocumentId); + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.getInfo(businessDocumentIdLong); + if(null == businessDocumentPO){ + throw new ServiceException("业务单据信息未找到"); + } + if(businessDocumentPO.getBusinessState()!=1 && businessDocumentPO.getBusinessState()!=4){ + throw new ServiceException("所选记录"+ businessDocumentPO.getBusinessFlow() +"已生效不可操作"); + } + businessDocumentIdLongList.add(businessDocumentIdLong); + } + if(businessDocumentIdLongList.size()>0){ + businessDocumentDomainService.takeEffectByIds(businessDocumentIdLongList); + } + } + + /** + * 审核业务单据 + */ + @Transactional + public void auditByIds(BusinessDocumentDTO businessDocumentDTO) { + //只有已生效状态的记录可以操作审核变更为已计费状态并生成计费流水 + if(!StringUtils.isNotEmpty(businessDocumentDTO.getBusinessDocumentIds())){ + throw new ServiceException("所选数据不能为空"); + } + List businessDocumentIdLongList = new ArrayList<>(); + Set businessDocumentIds = Stream.of(businessDocumentDTO.getBusinessDocumentIds().split(",")).collect(Collectors.toSet()); + for (String businessDocumentId : businessDocumentIds) { + Long businessDocumentIdLong = Long.valueOf(businessDocumentId); + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.getInfo(businessDocumentIdLong); + if(null == businessDocumentPO){ + throw new ServiceException("业务单据信息未找到"); + } + if(businessDocumentPO.getBusinessState()!=2){ + throw new ServiceException("所选记录"+ businessDocumentPO.getBusinessFlow() +"不是已生效状态不可操作"); + } + //生成计费流水 + billingStatementDomainService.generateFlow(businessDocumentPO); + businessDocumentIdLongList.add(businessDocumentIdLong); + } + if(businessDocumentIdLongList.size()>0){ + businessDocumentDomainService.auditByIds(businessDocumentIdLongList,businessDocumentDTO); + } + + } + + + /** + * 导入业务单据 + */ + public Boolean importDocument(List businessDocumentDTOList) { + List businessDocumentList = new ArrayList<>(); + if(businessDocumentDTOList != null && businessDocumentDTOList.size()>0){ + for (BusinessDocumentDTO businessDocumentDTO : businessDocumentDTOList) { + BusinessDocument businessDocument = new BusinessDocument(); + //处理导入业务单据 + + + BeanUtils.copyProperties(businessDocumentDTO,businessDocument); + businessDocument.setDataSources(2); + businessDocumentList.add(businessDocument); + } + } + return businessDocumentDomainService.saveBatch(businessDocumentList); + } + + /** + * 费用重算列表查询 + * @param businessDocumentDO + * @return + */ + public List costRecalculationList(BusinessDocumentDO businessDocumentDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(!StringUtils.isNotEmpty(businessDocumentDO.getBusinessDocumentIds())){ + throw new ServiceException("所选记录不能为空"); + } + Set businessDocumentIds = Stream.of(businessDocumentDO.getBusinessDocumentIds().split(",")).collect(Collectors.toSet()); + if(businessDocumentIds.size()>10){ + throw new ServiceException("重算数量过大,建议选中十条以内"); + } + //查询业务单据 + BusinessDocumentDO queryParam = new BusinessDocumentDO(); + queryParam.setBusinessDocumentIdSet(businessDocumentIds); + List businessDocumentPOList = businessDocumentDomainService.queryList(queryParam); + if(null == businessDocumentPOList || businessDocumentPOList.size()==0){ + throw new ServiceException("业务单据信息未找到"); + } + //判断是否可进行费用重算,盘算业务状态是否已计费,计费之前可进行费用重算并保存 + long count = businessDocumentPOList.stream().filter(businessDocumentPO -> businessDocumentPO.getBusinessState() > 2).count(); + if(count >0){ + throw new ServiceException("所选数据中包含已计费等状态,无法进行费用重算"); + } + //循环集合,重新计算费用 + for (BusinessDocumentPO businessDocumentPO : businessDocumentPOList) { + //计算费用 + CostCalculationDTO costCalculationDTO = new CostCalculationDTO(); + costCalculationDTO.setOriginalBusinessNum(businessDocumentPO.getOriginalBusinessNum()); + costCalculationDTO.setContractNumber(businessDocumentPO.getContractNumber()); + costCalculationDTO.setFormJson(businessDocumentPO.getDocumentFormJson()); + costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocumentPO.getSecondSubjectCode()) ? businessDocumentPO.getFirstSubjectCode():businessDocumentPO.getSecondSubjectCode()); + costCalculationDTO.setDocumentTypeCode(businessDocumentPO.getDocumentTypeCode()); + BillingCostPo billingCostPo = null; + try { + billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); + }catch (Exception e){ + businessDocumentPO.setRecalculateCostFailRemark(e.getMessage()); + } + if(null != billingCostPo){ + businessDocumentPO.setRecalculateCost(billingCostPo.getComputationalCost()); + } + } + return businessDocumentPOList; + } + + + /** + * 业务系统推送BMS业务单据保存 + */ + @Transactional + public Boolean pushSyncData(BusinessDocumentDO businessDocumentDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验使用的表单是否必填校验 + checkDoucumentType(businessDocumentDO); + //根据结算对象和费用科目,获取合同 + int contractType = 2; + if(businessDocumentDO.getBelongModuleCode().equals(BelongModuleCode.WMS.getCode())){ + contractType = 1; + } + AjaxResult ajaxResult = systemServiceFeign.getInfoByCustomer(businessDocumentDO.getSettlementCustomersCode(),contractType); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("合同信息未找到"); + } + ContractManagePO contractPO = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class); + if (null == contractPO) { + throw new ServiceException("合同信息未找到"); + } + businessDocumentDO.setContractName(contractPO.getContractName()); + businessDocumentDO.setContractNumber(contractPO.getContractNumber()); + //处理数据 + businessDocumentDO.setDataSources(1); + businessDocumentDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + businessDocumentDO.setOrganizationId(businessDocumentDO.getOrganizationId()==null ? loginUser.getUserPo().getOrganizationId() : businessDocumentDO.getOrganizationId()); + handleDateSync(businessDocumentDO); + + List businessDocumentList = new ArrayList<>(); + //根据合同获取合同明细信息 + List contractManageDetailPOList = contractPO.getContractManageDetailPOList(); + //遍历contractManageDetailPOList集合,根据合同维护的费用科目,生成业务单据 + for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOList) { + /* + 判断合同详情中的单据类型,如果传来的单据类型在合同中,则生成对应的费用科目所对应的业务单据 + 校验根据原始业务单号和费用科目,查询业务单据是否已存在,如果已存在则修改,如果不存在则新增 + 业务系统只传业务数据,同时还要传结算主体,bms根据结算主体获取合同信息,进而进行下一步操作 + */ + Set documentTypeCodeSet = Stream.of(contractManageDetailPO.getDocumentTypeCode().split(",")).collect(Collectors.toSet()); + if(documentTypeCodeSet.contains(businessDocumentDO.getDocumentTypeCode())){ + //生成一条业务单据 + BusinessDocument businessDocument = new BusinessDocument(); + BeanUtils.copyProperties(businessDocumentDO,businessDocument); + BusinessDocumentDO params = new BusinessDocumentDO(); + params.setOriginalBusinessNum(businessDocumentDO.getOriginalBusinessNum()); + params.setSecondSubjectCode(StringUtils.isEmpty(contractManageDetailPO.getSecondSubjectCode()) ? contractManageDetailPO.getFirstSubjectCode():contractManageDetailPO.getSecondSubjectCode()); + BusinessDocumentPO businessDocumentPO = businessDocumentDomainService.queryByOriginalBusinessNumAndSubjectCode(params); + if(null != businessDocumentPO){ + businessDocument.setBusinessDocumentId(businessDocumentPO.getBusinessDocumentId()); + } + businessDocument.setBusinessFlow(OrderSequence.getOrderCode("LS")); + businessDocument.setFirstSubjectCode(contractManageDetailPO.getFirstSubjectCode()); + businessDocument.setFirstSubjectName(contractManageDetailPO.getFirstSubjectName()); + businessDocument.setSecondSubjectCode(contractManageDetailPO.getSecondSubjectCode()); + businessDocument.setSecondSubjectName(contractManageDetailPO.getSecondSubjectName()); + //调用费用计算,计算费用金额进行保存 + CostCalculationDTO costCalculationDTO = new CostCalculationDTO(); + costCalculationDTO.setOriginalBusinessNum(businessDocument.getOriginalBusinessNum()); + costCalculationDTO.setContractNumber(businessDocument.getContractNumber()); + costCalculationDTO.setFormJson(businessDocument.getDocumentFormJson()); + costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocument.getSecondSubjectCode()) ? businessDocument.getFirstSubjectCode():businessDocument.getSecondSubjectCode()); + costCalculationDTO.setDocumentTypeCode(businessDocument.getDocumentTypeCode()); + BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); + businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost()); + businessDocumentList.add(businessDocument); + } + } + return businessDocumentDomainService.saveOrUpdateBatch(businessDocumentList); + } + + private void handleDateSync(BusinessDocumentDO businessDocumentDO) { + if(businessDocumentDO.getOrganizationId() != null){ + //获取组织信息 + AjaxResult ajaxResult = productServiceFeign.getOrganizationInfo(businessDocumentDO.getOrganizationId()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ + throw new ServiceException("选中组织信息未找到"); + } + OrganizationPo organizationPo = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), OrganizationPo.class); + if(null == organizationPo){ + throw new ServiceException("组织信息未找到"); + } + businessDocumentDO.setOrganizationName(organizationPo.getOrganizationName()); + businessDocumentDO.setTopOrganizationId(organizationPo.getParentOrganizationId()); + if(organizationPo.getParentOrganizationId()==0){ + businessDocumentDO.setTopOrganizationId(businessDocumentDO.getOrganizationId()); + } + } + if(StringUtils.isNotEmpty(businessDocumentDO.getProjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getProjectByCode(businessDocumentDO.getProjectCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("项目信息未找到"); + } + businessDocumentDO.setProjectName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("projectName")); + businessDocumentDO.setProjectManageId(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getLong("projectManageId")); + } + //根据单据类型id查询单据类型数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getDocumentTypeCode())){ + DocumentType documentType = documentTypeDomainService.queryByCode(businessDocumentDO.getDocumentTypeCode()); + if(null != documentType){ + businessDocumentDO.setDocumentType(documentType.getDocumentType()); + businessDocumentDO.setDocumentTypeCode(documentType.getDocumentTypeCode()); + businessDocumentDO.setDocumentTypeId(documentType.getDocumentTypeId()); + } + } + //来源系统 + if (StringUtils.isNotEmpty(businessDocumentDO.getBelongModuleCode())){ + List modulesTypeList = null; + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.MODULES.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + modulesTypeList = JSON.parseArray(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if (modulesTypeList != null && modulesTypeList.size() > 0){ + for (SysDictDataVo sysDictDataVo : modulesTypeList) { + if (businessDocumentDO.getBelongModuleCode().equals(sysDictDataVo.getDictValue())){ + businessDocumentDO.setBelongModule(sysDictDataVo.getDictLabel()); + break; + } + } + } + } + + //根据结算对象code查询结算对象数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getSettlementCustomersCode())){ + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(businessDocumentDO.getSettlementCustomersCode()); + if(null == settlementCustomers){ + throw new ServiceException("结算对象信息未找到"); + } + businessDocumentDO.setSettlementCustomersCode(settlementCustomers.getSettlementCustomersCode()); + businessDocumentDO.setSettlementEntity(settlementCustomers.getSettlementEntity()); + businessDocumentDO.setSettlementCustomersId(settlementCustomers.getSettlementCustomersId()); + //如果前端没传项目code则从结算对象中获取 + if(StringUtils.isEmpty(businessDocumentDO.getProjectCode())){ + businessDocumentDO.setProjectCode(settlementCustomers.getProjectCode()); + businessDocumentDO.setProjectName(settlementCustomers.getProjectName()); + } + } + + //根据费用类型id查询费用类型对象数据,并赋值 + if(StringUtils.isNotEmpty(businessDocumentDO.getServiceItemsCode())){ + AjaxResult ajaxResult = systemServiceFeign.getServiceItemsByCode(businessDocumentDO.getServiceItemsCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("费用类型未找到"); + } + businessDocumentDO.setServiceItemsManageId(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getLong("serviceItemsManageId")); + businessDocumentDO.setServiceItemsName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("serviceItemsName")); + } + + } + + /** + * 业务系统推送BMS业务单据保存 (批量) + */ + @Transactional + public Boolean pushSyncDataList(List businessDataPushDTOList) { + if(businessDataPushDTOList != null && businessDataPushDTOList.size() > 0){ + for (BusinessDataPushDTO businessDataPushDTO : businessDataPushDTOList) { + //转换实体 + BusinessDocumentDO businessDocumentDO = new BusinessDocumentAssembler().syncDataAssemble(businessDataPushDTO); + if(!pushSyncData(businessDocumentDO)){ + throw new ServiceException("保存单据失败,请重试"); + } + } + } + return true; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/conditionalMapping/ConditionalMappingApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/conditionalMapping/ConditionalMappingApplicationService.java new file mode 100644 index 000000000..35c930bac --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/conditionalMapping/ConditionalMappingApplicationService.java @@ -0,0 +1,102 @@ +package com.mhd.bms.application.server.conditionalMapping; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import com.mhd.bms.domain.conditionalMapping.service.ConditionalMappingDomainService; +import com.mhd.bms.interfaces.dto.conditionalMapping.ConditionalMappingDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 条件映射管理ApplicationService + * + * @author gen + * @date 2024-08-07 + */ +@Service +@Slf4j +public class ConditionalMappingApplicationService { + @Autowired + private ConditionalMappingDomainService conditionalMappingDomainService; + + + /** + * 分页查询条件映射管理列表 + */ + + public List queryList(ConditionalMappingDO conditionalMappingDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + conditionalMappingDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return conditionalMappingDomainService.queryList(conditionalMappingDO); + } + + + /** + * 新增条件映射管理 + */ + public Boolean insert(ConditionalMappingDO conditionalMappingDO) { + //获取当前登录人 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + conditionalMappingDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + conditionalMappingDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + conditionalMappingDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return conditionalMappingDomainService.insert(conditionalMappingDO); + } + + /** + * 修改条件映射管理 + */ + public Boolean update(ConditionalMappingDO conditionalMappingDO) { + return conditionalMappingDomainService.update(conditionalMappingDO); + } + + /** + * 批量删除条件映射管理 + */ + public boolean delete(Long[] conditionalMappingIds) { + return conditionalMappingDomainService.delete(conditionalMappingIds); + } + + /** + * 获取条件映射管理详细信息 + */ + public ConditionalMappingPO getInfo(Long conditionalMappingId) + { + return conditionalMappingDomainService.getInfo(conditionalMappingId); + } + + + /** + * 批量删除 + * @param conditionalMappingDTO + * @return + */ + public Boolean deleteByIds(ConditionalMappingDTO conditionalMappingDTO) { + if(!StringUtils.isNotEmpty(conditionalMappingDTO.getConditionalMappingIds())){ + throw new ServiceException("条件映射ID不能为空"); + } + Set conditionalMappingIds = Stream.of(conditionalMappingDTO.getConditionalMappingIds().split(",")).collect(Collectors.toSet()); + Long[] ids = conditionalMappingIds.stream().map(Long::valueOf).toArray(Long[]::new); + return conditionalMappingDomainService.delete(ids); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/documentType/DocumentTypeApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/documentType/DocumentTypeApplicationService.java new file mode 100644 index 000000000..6654b7d7a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/documentType/DocumentTypeApplicationService.java @@ -0,0 +1,174 @@ +package com.mhd.bms.application.server.documentType; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService; +import com.mhd.bms.interfaces.dto.documentType.DocumentTypeDTO; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 单据类型ApplicationService + * + * @author gen + * @date 2024-06-18 + */ +@Service +@Slf4j +public class DocumentTypeApplicationService { + @Autowired + private DocumentTypeDomainService documentTypeDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + + + /** + * 分页查询单据类型列表 + */ + + public List queryList(DocumentTypeDO documentTypeDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + documentTypeDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return documentTypeDomainService.queryList(documentTypeDO); + } + + + /** + * 新增单据类型 + */ + public Boolean insert(DocumentTypeDO documentTypeDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验编码唯一性 + checkCode(documentTypeDO); + //处理数据字典 + handleDict(documentTypeDO); + documentTypeDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + documentTypeDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + documentTypeDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return documentTypeDomainService.insert(documentTypeDO); + } + + /** + * 校验单据类型编码唯一性 + */ + private void checkCode(DocumentTypeDO documentTypeDO) { + if(!StringUtils.isNotEmpty(documentTypeDO.getDocumentTypeCode())){ + throw new ServiceException("单据类型编码不能为空"); + } + DocumentType documentType = documentTypeDomainService.queryByCode(documentTypeDO.getDocumentTypeCode()); + if (documentType != null){ + throw new ServiceException("单据类型编码已存在"); + } + } + + /** + * 处理数据字典信息 + */ + private void handleDict(DocumentTypeDO documentTypeDO) { + //查询来源模块数据字典 + if(StringUtils.isNotEmpty(documentTypeDO.getBelongModuleCode())){ + List modulesTypeList = null; + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.MODULES.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + modulesTypeList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if (modulesTypeList != null && modulesTypeList.size() > 0){ + for (SysDictDataVo sysDictDataVo : modulesTypeList) { + if (documentTypeDO.getBelongModuleCode().equals(sysDictDataVo.getDictValue())){ + documentTypeDO.setBelongModule(sysDictDataVo.getDictLabel()); + break; + } + } + } + } + } + + /** + * 修改单据类型 + */ + public Boolean update(DocumentTypeDO documentTypeDO) { + //校验编码唯一性 + if(!StringUtils.isNotEmpty(documentTypeDO.getDocumentTypeCode())){ + throw new ServiceException("单据类型编码不能为空"); + } + DocumentType documentType = documentTypeDomainService.queryByCode(documentTypeDO.getDocumentTypeCode()); + if (documentType != null && !Objects.equals(documentType.getDocumentTypeId(), documentTypeDO.getDocumentTypeId())){ + throw new ServiceException("单据类型编码已存在"); + } + //处理数据字典 + handleDict(documentTypeDO); + return documentTypeDomainService.update(documentTypeDO); + } + + /** + * 批量删除单据类型 + */ + public boolean delete(Long[] documentTypeIds) { + return documentTypeDomainService.delete(documentTypeIds); + } + + /** + * 获取单据类型详细信息 + */ + public DocumentTypePO getInfo(Long documentTypeId) + { + return documentTypeDomainService.getInfo(documentTypeId); + } + + + /** + * 批量删除单据类型 + * @param documentTypeDTO + * @return + */ + public Boolean deleteByIds(DocumentTypeDTO documentTypeDTO) { + if(!StringUtils.isNotEmpty(documentTypeDTO.getDocumentTypeIds())){ + throw new ServiceException("单据类型ids不能为空"); + } + Set idSet = Stream.of(documentTypeDTO.getDocumentTypeIds().split(",")).collect(Collectors.toSet()); + Long[] documentTypeIds = idSet.stream().map(Long::valueOf).toArray(Long[]::new); + return documentTypeDomainService.delete(documentTypeIds); + } + + public boolean changeStatus(DocumentTypeDO documentTypeDO) { + if(documentTypeDO.getDocumentTypeId()==null){ + throw new ServiceException("单据类型id不能为空"); + } + if(documentTypeDO.getEnablingStatus() != 1 && documentTypeDO.getEnablingStatus() != 2){ + throw new ServiceException("单据类型状态错误"); + } + DocumentTypeDO documentTypeSave = new DocumentTypeDO(); + documentTypeSave.setDocumentTypeId(documentTypeDO.getDocumentTypeId()); + documentTypeSave.setEnablingStatus(documentTypeDO.getEnablingStatus()); + return documentTypeDomainService.update(documentTypeSave); + + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/mappingMethod/MappingMethodApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/mappingMethod/MappingMethodApplicationService.java new file mode 100644 index 000000000..5286931f9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/mappingMethod/MappingMethodApplicationService.java @@ -0,0 +1,100 @@ +package com.mhd.bms.application.server.mappingMethod; + +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import com.mhd.bms.domain.mappingMethod.service.MappingMethodDomainService; +import com.mhd.bms.interfaces.dto.mappingMethod.MappingMethodDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 方法映射ApplicationService + * + * @author gen + * @date 2024-07-12 + */ +@Service +@Slf4j +public class MappingMethodApplicationService { + @Autowired + private MappingMethodDomainService mappingMethodDomainService; + + + /** + * 分页查询方法映射列表 + */ + + public List queryList(MappingMethodDO mappingMethodDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + mappingMethodDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return mappingMethodDomainService.queryList(mappingMethodDO); + } + + + /** + * 新增方法映射 + */ + public Boolean insert(MappingMethodDO mappingMethodDO) { + + return mappingMethodDomainService.insert(mappingMethodDO); + } + + /** + * 修改方法映射 + */ + public Boolean update(MappingMethodDO mappingMethodDO) { + return mappingMethodDomainService.update(mappingMethodDO); + } + + /** + * 批量删除方法映射 + */ + public boolean delete(Long[] mappingMethodIds) { + return mappingMethodDomainService.delete(mappingMethodIds); + } + + /** + * 获取方法映射详细信息 + */ + public MappingMethodPO getInfo(Long mappingMethodId) + { + return mappingMethodDomainService.getInfo(mappingMethodId); + } + + + /** + * 根据ID删除 + */ + @Transactional + public Boolean deleteByIds(MappingMethodDTO mappingMethodDTO) { + if(!StringUtils.isNotEmpty(mappingMethodDTO.getMappingMethodIds())){ + throw new ServiceException("方法ID不能为空"); + } + Set mappingMethodIdSet = Stream.of(mappingMethodDTO.getMappingMethodIds().split(",")).collect(Collectors.toSet()); + Long[] mappingMethodIds = mappingMethodIdSet.stream().map(Long::valueOf).toArray(Long[]::new); + return mappingMethodDomainService.delete(mappingMethodIds); + } + + public MappingMethodPO getInfoById(MappingMethodDTO mappingMethodDTO) { + if(null == mappingMethodDTO.getMappingMethodId()){ + throw new ServiceException("方法ID不能为空"); + } + return mappingMethodDomainService.getInfo(mappingMethodDTO.getMappingMethodId()); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentManage/PaymentManageApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentManage/PaymentManageApplicationService.java new file mode 100644 index 000000000..351adc201 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentManage/PaymentManageApplicationService.java @@ -0,0 +1,110 @@ +package com.mhd.bms.application.server.paymentManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import com.mhd.bms.domain.paymentManage.service.PaymentManageDomainService; +import com.mhd.bms.interfaces.dto.paymentManage.PaymentManageDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 支付管理ApplicationService + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class PaymentManageApplicationService { + @Autowired + private PaymentManageDomainService paymentManageDomainService; + + + /** + * 分页查询支付管理列表 + */ + + public List queryList(PaymentManageDO paymentManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + paymentManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return paymentManageDomainService.queryList(paymentManageDO); + } + + + /** + * 新增支付管理 + */ + public Boolean insert(PaymentManageDO paymentManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验支付编码是否重复 + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentManageDO.getPaymentMethodCode()); + if(null != paymentManage){ + throw new ServiceException("支付编码不能重复"); + } + paymentManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + paymentManageDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + paymentManageDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return paymentManageDomainService.insert(paymentManageDO); + } + + /** + * 修改支付管理 + */ + public Boolean update(PaymentManageDO paymentManageDO) { + //校验支付编码是否重复 + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentManageDO.getPaymentMethodCode()); + if(null != paymentManage && !Objects.equals(paymentManage.getPaymentManageId(), paymentManageDO.getPaymentManageId())){ + throw new ServiceException("支付编码不能重复"); + } + return paymentManageDomainService.update(paymentManageDO); + } + + /** + * 批量删除支付管理 + */ + public boolean delete(Long[] paymentManageIds) { + return paymentManageDomainService.delete(paymentManageIds); + } + + /** + * 获取支付管理详细信息 + */ + public PaymentManagePO getInfo(Long paymentManageId) + { + return paymentManageDomainService.getInfo(paymentManageId); + } + + /** + * 根据id删除支付管理 + */ + public Boolean deleteByIds(PaymentManageDTO paymentManageDTO) { + if(!StringUtils.isNotEmpty(paymentManageDTO.getPaymentManageIds())){ + throw new ServiceException("支付管理id不能为空"); + } + Set paymentManageIdSet = Stream.of(paymentManageDTO.getPaymentManageIds().split(",")).collect(Collectors.toSet()); + Long[] paymentManageIds = paymentManageIdSet.stream().map(Long::valueOf).toArray(Long[]::new); + return paymentManageDomainService.delete(paymentManageIds); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentOrder/PaymentOrderApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentOrder/PaymentOrderApplicationService.java new file mode 100644 index 000000000..67a33870e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentOrder/PaymentOrderApplicationService.java @@ -0,0 +1,118 @@ +package com.mhd.bms.application.server.paymentOrder; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.domain.paymentOrder.service.PaymentOrderDomainService; +import com.mhd.bms.infrastructure.utils.CheckPasswordUtil; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDTO; +import com.mhd.common.core.constant.PaymentChannelConstants; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + * 付款单ApplicationService + * + * @author gen + * @date 2024-07-16 + */ +@Service +@Slf4j +public class PaymentOrderApplicationService { + @Autowired + private PaymentOrderDomainService paymentOrderDomainService; + @Autowired + private BillManageDomainService billManageDomainService; + + + /** + * 分页查询付款单列表 + */ + + public List queryList(PaymentOrderDO paymentOrderDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + paymentOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return paymentOrderDomainService.queryList(paymentOrderDO); + } + + + /** + * 新增付款单 + */ + public Boolean insert(PaymentOrderDO paymentOrderDO) { + + return paymentOrderDomainService.insert(paymentOrderDO); + } + + /** + * 修改付款单 + */ + public Boolean update(PaymentOrderDO paymentOrderDO) { + return paymentOrderDomainService.update(paymentOrderDO); + } + + /** + * 批量删除付款单 + */ + public boolean delete(Long[] paymentOrderIds) { + return paymentOrderDomainService.delete(paymentOrderIds); + } + + /** + * 获取付款单详细信息 + */ + public PaymentOrderPO getInfo(Long paymentOrderId) + { + return paymentOrderDomainService.getInfo(paymentOrderId); + } + + + /** + * 批量付款 + */ +// @Transactional + public boolean batchPayment(PaymentOrderDO paymentOrderDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验支付密码 + CheckPasswordUtil.checkPayPassword(paymentOrderDO.getPayPassword(),null); + //校验账单状态是否合规 + paymentOrderDomainService.checkSettlementStatus(paymentOrderDO); + //判断支付通道类型 TODO 此处先只做线下支付 + if(ObjectUtil.equal(paymentOrderDO.getPaymentChannelCode(), PaymentChannelConstants.offline_pay)){ + //付款 + Boolean flag = paymentOrderDomainService.batchPayment(paymentOrderDO); + //更改账单状态 + Boolean flagTwo = billManageDomainService.updateBillPaymentInfo(paymentOrderDO); + return flag && flagTwo; + } + + return false; + } + + /** + * 根据id获取付款单信息 + */ + public PaymentOrderPO getInfoById(PaymentOrderDTO paymentOrderDTO) { + if(paymentOrderDTO.getPaymentOrderId() == null){ + throw new ServiceException("付款单id不能为空"); + } + return paymentOrderDomainService.getInfoById(paymentOrderDTO.getPaymentOrderId()); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentWallet/PaymentWalletApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentWallet/PaymentWalletApplicationService.java new file mode 100644 index 000000000..94651d5c6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/paymentWallet/PaymentWalletApplicationService.java @@ -0,0 +1,136 @@ +package com.mhd.bms.application.server.paymentWallet; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.service.PaymentManageDomainService; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import com.mhd.bms.domain.paymentWallet.service.PaymentWalletDomainService; +import com.mhd.bms.interfaces.dto.paymentWallet.PaymentWalletDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 支付钱包管理ApplicationService + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class PaymentWalletApplicationService { + @Autowired + private PaymentWalletDomainService paymentWalletDomainService; + @Autowired + private PaymentManageDomainService paymentManageDomainService; + + + /** + * 分页查询支付钱包管理列表 + */ + + public List queryList(PaymentWalletDO paymentWalletDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + paymentWalletDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return paymentWalletDomainService.queryList(paymentWalletDO); + } + + + /** + * 新增支付钱包管理 + */ + public Boolean insert(PaymentWalletDO paymentWalletDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //根据支付方式编码查询支付方式 + if(!StringUtils.isNotEmpty(paymentWalletDO.getPaymentMethodCode())){ + throw new ServiceException("支付方式编码不能为空"); + } + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentWalletDO.getPaymentMethodCode()); + if(null == paymentManage){ + throw new ServiceException("支付方式信息未找到"); + } + paymentWalletDO.setPaymentMethod(paymentManage.getPaymentMethod()); + paymentWalletDO.setPaymentManageId(paymentManage.getPaymentManageId()); + paymentWalletDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + paymentWalletDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + paymentWalletDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + return paymentWalletDomainService.insert(paymentWalletDO); + } + + /** + * 修改支付钱包管理 + */ + public Boolean update(PaymentWalletDO paymentWalletDO) { + //根据支付方式编码查询支付方式 + if(!StringUtils.isNotEmpty(paymentWalletDO.getPaymentMethodCode())){ + throw new ServiceException("支付方式编码不能为空"); + } + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentWalletDO.getPaymentMethodCode()); + if(null == paymentManage){ + throw new ServiceException("支付方式信息未找到"); + } + paymentWalletDO.setPaymentMethod(paymentWalletDO.getPaymentMethod()); + paymentWalletDO.setPaymentWalletId(paymentWalletDO.getPaymentWalletId()); + return paymentWalletDomainService.update(paymentWalletDO); + } + + /** + * 批量删除支付钱包管理 + */ + public boolean delete(Long[] paymentWalletIds) { + return paymentWalletDomainService.delete(paymentWalletIds); + } + + /** + * 获取支付钱包管理详细信息 + */ + public PaymentWalletPO getInfo(Long paymentWalletId) + { + return paymentWalletDomainService.getInfo(paymentWalletId); + } + + + /** + * 批量删除支付钱包管理 + */ + public Boolean deleteByIds(PaymentWalletDTO paymentWalletDTO) { + if(!StringUtils.isNotEmpty(paymentWalletDTO.getPaymentWalletIds())){ + throw new ServiceException("支付钱包管理id不能为空"); + } + Set paymentWalletIdSet = Stream.of(paymentWalletDTO.getPaymentWalletIds().split(",")).collect(Collectors.toSet()); + Long[] paymentWalletIds = paymentWalletIdSet.stream().map(Long::valueOf).toArray(Long[]::new); + return paymentWalletDomainService.delete(paymentWalletIds); + } + + /** + * 查看详情 + * @param paymentWalletDTO + * @return + */ + public PaymentWalletPO getInfoById(PaymentWalletDTO paymentWalletDTO) { + if(null == paymentWalletDTO.getPaymentWalletId()){ + throw new ServiceException("支付钱包id不能为空"); + } + return paymentWalletDomainService.getInfo(paymentWalletDTO.getPaymentWalletId()); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/receiptManage/ReceiptManageApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/receiptManage/ReceiptManageApplicationService.java new file mode 100644 index 000000000..3e1c3aa4b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/receiptManage/ReceiptManageApplicationService.java @@ -0,0 +1,131 @@ +package com.mhd.bms.application.server.receiptManage; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.domain.receiptManage.service.ReceiptManageDomainService; +import com.mhd.bms.infrastructure.utils.CheckPasswordUtil; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptManageDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 收款单管理ApplicationService + * + * @author gen + * @date 2024-07-08 + */ +@Service +@Slf4j +public class ReceiptManageApplicationService { + @Autowired + private ReceiptManageDomainService receiptManageDomainService; + @Autowired + private BillManageDomainService billManageDomainService; + + + /** + * 分页查询收款单管理列表 + */ + + public List queryList(ReceiptManageDO receiptManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + receiptManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return receiptManageDomainService.queryList(receiptManageDO); + } + + + /** + * 新增收款单管理 + */ + public Boolean insert(ReceiptManageDO receiptManageDO) { + + return receiptManageDomainService.insert(receiptManageDO); + } + + /** + * 修改收款单管理 + */ + public Boolean update(ReceiptManageDO receiptManageDO) { + return receiptManageDomainService.update(receiptManageDO); + } + + /** + * 批量删除收款单管理 + */ + public boolean delete(Long[] receiptManageIds) { + return receiptManageDomainService.delete(receiptManageIds); + } + + /** + * 获取收款单管理详细信息 + */ + public ReceiptManagePO getInfo(Long receiptManageId) + { + return receiptManageDomainService.getInfo(receiptManageId); + } + + + /** + * 批量收款 + */ + @Transactional + public Boolean batchCollection(ReceiptManageDO receiptManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验支付密码 + CheckPasswordUtil.checkPayPassword(receiptManageDO.getPayPassword(),null); + //校验结算状态是否正确 +// receiptManageDomainService.checkSettlementStatus(receiptManageDO); + //保存结算单 + Boolean flag = receiptManageDomainService.batchCollection(receiptManageDO); + //更新账单信息 + Boolean flagTwo = billManageDomainService.updateBillSettlementInfo(receiptManageDO); + return flag && flagTwo; + } + + + /** + * 退款 + */ + @Transactional + public Boolean refund(ReceiptManageDO receiptManageDO) { + //校验支付密码 + CheckPasswordUtil.checkPayPassword(receiptManageDO.getPayPassword(),null); + return receiptManageDomainService.refund(receiptManageDO); + } + + /** + * 查询收款单详情 + */ + public ReceiptManagePO getDetailsInfo(ReceiptManageDTO receiptManageDTO) { + if(null == receiptManageDTO.getReceiptManageId()){ + throw new ServiceException("收款单id不能为空"); + } + return receiptManageDomainService.getDetailsInfo(receiptManageDTO.getReceiptManageId()); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryManageApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryManageApplicationService.java new file mode 100644 index 000000000..6f6e25596 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryManageApplicationService.java @@ -0,0 +1,134 @@ +package com.mhd.bms.application.server.reportForm; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import com.mhd.bms.domain.reportForm.service.FormQueryManageDomainService; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryManageDTO; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + * 查询条件管理ApplicationService + * + * @author gen + * @date 2024-07-26 + */ +@Service +@Slf4j +public class FormQueryManageApplicationService { + @Autowired + private FormQueryManageDomainService formQueryManageDomainService; + @Autowired + private FormQueryParamsApplicationService formQueryParamsApplicationService; + + + /** + * 分页查询查询条件管理列表 + */ + + public List queryList(FormQueryManageDO formQueryManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(formQueryManageDO.getFormType() == null){ + throw new ServiceException("所属报表类型不能为空"); + } + if(formQueryManageDO.getReportFormId() == null){ + throw new ServiceException("报表ID不能为空"); + } + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + formQueryManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + formQueryManageDO.setCreateBy(loginUser.getUserPo().getUserId()); + List formQueryManagePOList = formQueryManageDomainService.queryList(formQueryManageDO); + if(null != formQueryManagePOList && formQueryManagePOList.size() > 0){ + for (FormQueryManagePO formQueryManagePO : formQueryManagePOList) { + List formQueryParamsPOList = formQueryParamsApplicationService.getInfoByFormQueryManageId(formQueryManagePO.getFormQueryManageId()); + formQueryManagePO.setFormQueryParamsPOList(formQueryParamsPOList); + } + } + return formQueryManagePOList; + } + + + /** + * 新增查询条件管理 + */ + @Transactional + public Boolean insert(FormQueryManageDO formQueryManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + formQueryManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + formQueryManageDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + formQueryManageDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + //判断如果该查询条件设为了默认,则将其他的设为非默认 + if (formQueryManageDO.getDefaultFlag() == 1){ + formQueryManageDomainService.updateDefaultFlag(formQueryManageDO.getFormType()); + } + boolean flagTwo = formQueryManageDomainService.insert(formQueryManageDO); + for (FormQueryParamsDTO formQueryParamsDTO : formQueryManageDO.getFormQueryParamsDTOList()) { + formQueryParamsDTO.setFormQueryManageId(formQueryManageDO.getFormQueryManageId()); + } + boolean flag = formQueryParamsApplicationService.insert(formQueryManageDO.getFormQueryParamsDTOList()); + return flag && flagTwo; + } + + /** + * 修改查询条件管理 + */ + @Transactional(rollbackFor = Exception.class) + public Boolean update(FormQueryManageDO formQueryManageDO) { + //先将之前的旧数据删除 + Boolean flagThree = formQueryParamsApplicationService.deleteByFormQueryManageId(formQueryManageDO.getFormQueryManageId()); + Boolean flag = formQueryParamsApplicationService.update(formQueryManageDO.getFormQueryParamsDTOList()); + Boolean flagTwo = formQueryManageDomainService.update(formQueryManageDO); + return flag && flagTwo && flagThree; + } + + /** + * 批量删除查询条件管理 + */ + public boolean delete(Long[] formQueryManageIds) { + return formQueryManageDomainService.delete(formQueryManageIds); + } + + /** + * 获取查询条件管理详细信息 + */ + public FormQueryManagePO getInfo(Long formQueryManageId) + { + FormQueryManagePO formQueryManagePO = formQueryManageDomainService.getInfo(formQueryManageId); + List formQueryParamsPOList = formQueryParamsApplicationService.getInfoByFormQueryManageId(formQueryManageId); + if(null != formQueryManagePO){ + formQueryManagePO.setFormQueryParamsPOList(formQueryParamsPOList); + } + return formQueryManagePO; + } + + + public Boolean deleteByIds(FormQueryManageDTO formQueryManageDTO) { + if(formQueryManageDTO.getFormQueryManageId() == null){ + throw new ServiceException("查询条件管理id不能为空"); + } + Boolean flag = formQueryManageDomainService.deleteById(formQueryManageDTO.getFormQueryManageId()); + Boolean flagTwo = formQueryParamsApplicationService.deleteByFormQueryManageId(formQueryManageDTO.getFormQueryManageId()); + return flag && flagTwo; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryParamsApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryParamsApplicationService.java new file mode 100644 index 000000000..32ebeacf1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/FormQueryParamsApplicationService.java @@ -0,0 +1,90 @@ +package com.mhd.bms.application.server.reportForm; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import com.mhd.bms.domain.reportForm.service.FormQueryParamsDomainService; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +/** + * 报查询条件管理ApplicationService + * + * @author gen + * @date 2024-07-25 + */ +@Service +@Slf4j +public class FormQueryParamsApplicationService { + @Autowired + private FormQueryParamsDomainService formQueryParamsDomainService; + + + /** + * 分页查询报查询条件管理列表 + */ + + public List queryList(FormQueryParamsDO formQueryParamsDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + formQueryParamsDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + formQueryParamsDO.setCreateBy(loginUser.getUserPo().getUserId()); + return formQueryParamsDomainService.queryList(formQueryParamsDO); + } + + + /** + * 新增报查询条件管理 + */ + public Boolean insert(List formQueryParamsDTOList) { + return formQueryParamsDomainService.saveBatch(formQueryParamsDTOList); + } + + /** + * 修改报查询条件管理 + */ + public Boolean update(List formQueryParamsDTOList) { + return formQueryParamsDomainService.update(formQueryParamsDTOList); + } + + /** + * 批量删除报查询条件管理 + */ + public boolean delete(Long[] formQueryParamsIds) { + return formQueryParamsDomainService.delete(formQueryParamsIds); + } + + /** + * 获取报查询条件管理详细信息 + */ + public FormQueryParamsPO getInfo(Long formQueryParamsId) + { + return formQueryParamsDomainService.getInfo(formQueryParamsId); + } + + + /** + * 根据表单查询管理ID,删除表单参数列表 + */ + public Boolean deleteByFormQueryManageId(Long formQueryManageId) { + return formQueryParamsDomainService.deleteByFormQueryManageId(formQueryManageId); + } + + public List getInfoByFormQueryManageId(Long formQueryManageId) { + return formQueryParamsDomainService.getInfoByFormQueryManageId(formQueryManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/ReportFormApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/ReportFormApplicationService.java new file mode 100644 index 000000000..5779f7b90 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/reportForm/ReportFormApplicationService.java @@ -0,0 +1,768 @@ +package com.mhd.bms.application.server.reportForm; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.ReflectUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.service.PaymentOrderDetailsDomainService; +import com.mhd.bms.domain.paymentOrder.service.PaymentOrderDomainService; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.service.ReceiptDetailDomainService; +import com.mhd.bms.domain.receiptManage.service.ReceiptManageDomainService; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import com.mhd.bms.domain.reportForm.service.ReportFormDomainService; +import com.mhd.bms.interfaces.dto.reportForm.ReportFormDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.PageUtils; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.temporal.WeekFields; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 分析报管理ApplicationService + * + * @author gen + * @date 2024-07-25 + */ +@Service +@Slf4j +public class ReportFormApplicationService { + @Autowired + private ReportFormDomainService reportFormDomainService; + @Autowired + private BillingStatementDomainService billingStatementDomainService; + @Autowired + private BillManageDomainService billManageDomainService; + @Autowired + private PaymentOrderDomainService paymentOrderDomainService; + @Autowired + private PaymentOrderDetailsDomainService paymentOrderDetailsDomainService; + @Autowired + private ReceiptManageDomainService receiptManageDomainService; + @Autowired + private ReceiptDetailDomainService receiptDetailDomainService; + + //特殊字段集合 + private static ArrayList specialFieldsList = new ArrayList<>(); + static { + specialFieldsList.add("form_years"); + specialFieldsList.add("form_month"); + specialFieldsList.add("form_day"); + specialFieldsList.add("form_week"); + } + + + /** + * 分页查询分析报管理列表 + */ + + public List queryList(ReportFormDO reportFormDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(reportFormDO.getFormType()==null){ + throw new ServiceException("报表类型不能为空"); + } + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + reportFormDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + reportFormDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + return reportFormDomainService.queryList(reportFormDO); + } + + + /** + * 新增分析报管理 + */ + public Boolean insert(ReportFormDO reportFormDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + reportFormDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + reportFormDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + reportFormDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return reportFormDomainService.insert(reportFormDO); + } + + /** + * 修改分析报管理 + */ + public Boolean update(ReportFormDO reportFormDO) { + return reportFormDomainService.update(reportFormDO); + } + + /** + * 批量删除分析报管理 + */ + public boolean delete(Long[] reportFormIds) { + return reportFormDomainService.delete(reportFormIds); + } + + /** + * 获取分析报管理详细信息 + */ + public ReportFormPO getInfo(Long reportFormId) + { + return reportFormDomainService.getInfo(reportFormId); + } + + + public Boolean deleteByIds(ReportFormDTO reportFormDTO) { + if(reportFormDTO.getReportFormId()==null){ + throw new ServiceException("报表信息ID不能为空"); + } + return reportFormDomainService.deleteByIds(reportFormDTO.getReportFormId()); + } + + /** + * 综合分析报表查询 + */ + public List> comprehensiveList(ReportFormDO reportFormDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(StringUtils.isEmpty(reportFormDO.getQueryParamJson())){ + throw new ServiceException("查询参数不能为空"); + } + //解析传来的参数 + String queryParamJson = reportFormDO.getQueryParamJson(); + //转成FormQueryParams集合 + List formQueryParamsListAll = JSON.parseArray(queryParamJson, FormQueryParams.class); + //根据传来的查询参数,拼接查询SQL + if(formQueryParamsListAll==null || formQueryParamsListAll.size()==0){ + throw new ServiceException("查询参数不能为空"); + } + //将formQueryParamsList过滤,将inputBoxText不为空的筛选出 + List formQueryParamsList = formQueryParamsListAll.stream().filter(formQueryParams -> StringUtils.isNotEmpty(formQueryParams.getInputBoxText())).collect(Collectors.toList()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("top_organization_id", loginUser.getUserPo().getTopOrganizationId()); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + FormQueryParams beforeFormQueryParams = null; + if(i > 0){ + //小于最后一个,则修改可判断状态 + beforeFormQueryParams = formQueryParamsList.get(i-1); + } + //根据字段名称,判断是否需要特殊处理 + if(specialFieldsList.contains(formQueryParams.getField())){ + getSpecialFunction(formQueryParams); + } + //根据选择的过滤方法选择合适的lambda函数 + getFunction(formQueryParams, queryWrapper, beforeFormQueryParams); + } + List billingStatementList = billingStatementDomainService.comprehensiveList(queryWrapper); + List> resultList = new ArrayList<>(); + if(formQueryParamsListAll.size()>0){ + //按照formQueryParamsList查询条件分组,获取每个分组的统计数据 + List groupList = new ArrayList<>(); + for (int i = 0; i < formQueryParamsListAll.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsListAll.get(i); + //拼接字段编码和输入框值 + groupList.add(convertToCamelCase(formQueryParams.getField())); + } + Map, List> billingStatementPOSMap = billingStatementList.stream() + .collect(Collectors.groupingBy(p-> { + Map groupMap = new HashMap<>(); + for (int i = 0; i < groupList.size(); i++) { + String field = groupList.get(i); + Object value = ReflectUtil.getFieldValue(p, field); + groupMap.put(field,value); + } + return groupMap; + })); + billingStatementPOSMap.forEach((k,v)->{ + if(v !=null && v.size()>0){ + //将map中的key和value单独做处理 + handleMapKey(k,v); + Map comprehensiveFormPO = new HashMap<>(k); + //统计所需参数 + long receivableFlow = v.stream().filter(item -> item.getAccountExpenseType()==1).count(); + BigDecimal receivableAmount = v.stream().filter(item -> item.getAccountExpenseType()==1).map(BillingStatement::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal payableAmount = v.stream().filter(item -> item.getAccountExpenseType()==2).map(BillingStatement::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + comprehensiveFormPO.put("receivableAmount",String.valueOf(receivableAmount)); + comprehensiveFormPO.put("receivableFlow",String.valueOf(receivableFlow)); + comprehensiveFormPO.put("payableAmount",String.valueOf(payableAmount)); + comprehensiveFormPO.put("payableFlow",String.valueOf(payableAmount)); + comprehensiveFormPO.put("profit",String.valueOf(receivableAmount.subtract(payableAmount))); + resultList.add(comprehensiveFormPO); + } + }); + } + return resultList; + } + + + /** + * 处理map中的数据 (综合分析报表) + * @param k key + * @param v 参数集合 + */ + private void handleMapKey(Map k, List v) { + Map newMap = new HashMap<>(k); + //遍历集合,将每个字段单独处理 + for (Map.Entry entry : newMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + switch (key){ + case "settlementCustomersCode": + String settlementCustomersName = v.stream().filter(item -> item.getSettlementCustomersCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getSettlementEntity).orElse(null); + k.put("settlement_customers_code",settlementCustomersName == null ? value : settlementCustomersName); + break; + case "accountExpenseType": + k.put("account_expense_type",ObjectUtil.equals(value,1) ? "应收" : "应付"); + break; + case "serviceItemsCode": + String serviceItemsName = v.stream().filter(item -> item.getServiceItemsCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getServiceItemsName).orElse(null); + k.put("service_items_code",serviceItemsName == null ? value : serviceItemsName); + break; + case "secondSubjectCode": + String secondSubjectName = v.stream().filter(item -> item.getSecondSubjectCode().equals(String.valueOf(value)) || item.getFirstSubjectCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getSecondSubjectName).orElse(null); + k.put("second_subject_code",secondSubjectName == null ? value : secondSubjectName); + break; + case "billingState": + if(ObjectUtil.equals(value,1)){ + k.put("billing_state","待审核"); + }else if(ObjectUtil.equals(value,2)){ + k.put("billing_state","已审核"); + }else if(ObjectUtil.equals(value,3)){ + k.put("billing_state","已出账"); + }else if(ObjectUtil.equals(value,4)){ + k.put("billing_state","已驳回"); + }else if(ObjectUtil.equals(value,5)){ + k.put("billing_state","已作废"); + } + break; + case "redFlushState": + k.put("red_flush_state",ObjectUtil.equals(value,1) ? "未红冲" : "已红冲"); + break; + case "settlementWay": + k.put("settlement_way",ObjectUtil.equals(value,1) ? "现金" : "油卡"); + break; + case "belongModuleCode": + String belongModuleCode = v.stream().filter(item -> item.getBelongModuleCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getBelongModule).orElse(null); + k.put("belong_module_code",belongModuleCode == null ? value : belongModuleCode); + break; + case "documentTypeCode": + String documentTypeCode = v.stream().filter(item -> item.getDocumentTypeCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getDocumentType).orElse(null); + k.put("document_type_code",documentTypeCode == null ? value : documentTypeCode); + break; + case "projectCode": + String projectCode = v.stream().filter(item -> item.getProjectCode().equals(String.valueOf(value))).findAny().map(BillingStatement::getProjectName).orElse(null); + k.put("project_code",projectCode == null ? value : projectCode); + break; + case "contractType": + k.put("contract_type",ObjectUtil.equals(value,1) ? "仓储" : "运输"); + break; + case "organizationId": + String organizationId = v.stream().filter(item -> item.getOrganizationId()==Long.parseLong(value.toString())).findAny().map(BillingStatement::getOrganizationName).orElse(null); + k.put("organization_id",organizationId == null ? value : organizationId); + break; + default: + break; + } + } + } + + /** + * 处理map中的数据 (账单分析报表) + * @param k key + * @param v 参数集合 + */ + private void handleMapKeyTwo(Map k, List v) { + Map newMap = new HashMap<>(k); + for (Map.Entry entry : newMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + switch (key){ + case "settlementCustomersCode": + String settlementCustomersName = v.stream().filter(item -> item.getSettlementCustomersCode().equals(String.valueOf(value))).findAny().map(BillManage::getSettlementEntity).orElse(null); + k.put("settlement_customers_code",settlementCustomersName == null ? value : settlementCustomersName); + break; + case "belongModuleCode": + String belongModuleCode = v.stream().filter(item -> item.getBelongModuleCode().equals(String.valueOf(value))).findAny().map(BillManage::getBelongModule).orElse(null); + k.put("belong_module_code",belongModuleCode == null ? value : belongModuleCode); + break; + case "organizationId": + String organizationId = v.stream().filter(item -> item.getOrganizationId()==Long.parseLong(value.toString())).findAny().map(BillManage::getOrganizationName).orElse(null); + k.put("organization_id",organizationId == null ? value : organizationId); + break; + case "billType": + k.put("bill_type",ObjectUtil.equals(value,1) ? "应收" : "应付"); + break; + case "billState": + if(ObjectUtil.equals(value,1)){ + k.put("bill_state","未确认"); + }else if(ObjectUtil.equals(value,2)){ + k.put("bill_state","对账中"); + }else if(ObjectUtil.equals(value,3)){ + k.put("bill_state","未收/付款"); + }else if(ObjectUtil.equals(value,4)){ + k.put("bill_state","部分收/付款"); + }else if(ObjectUtil.equals(value,5)){ + k.put("bill_state","已收/付款"); + }else if(ObjectUtil.equals(value,6)){ + k.put("bill_state","已作废"); + }else if(ObjectUtil.equals(value,7)){ + k.put("bill_state","已退款"); + } + break; + case "reconciliationStatus": + if(ObjectUtil.equals(value,1)){ + k.put("reconciliation_status","暂未确认"); + }else if(ObjectUtil.equals(value,2)){ + k.put("reconciliation_status","申请调账"); + }else if(ObjectUtil.equals(value,3)){ + k.put("reconciliation_status","财务调账"); + }else if(ObjectUtil.equals(value,4)){ + k.put("reconciliation_status","核对无误"); + } + break; + default: + break; + } + } + + } + + + /** + * 处理map中的数据 (结算分析报表) + * @param k key + * @param v 参数集合 + */ + private void handleMapKeyThree(Map k, List v) { + Map newMap = new HashMap<>(k); + for (Map.Entry entry : newMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + switch (key){ + case "settlementCustomersCode": + String settlementCustomersName = v.stream().filter(item -> item.getSettlementCustomersCode().equals(String.valueOf(value))).findAny().map(ReceiptManage::getSettlementEntity).orElse(null); + k.put("settlement_customers_code",settlementCustomersName == null ? value : settlementCustomersName); + break; + case "organizationId": + String organizationId = v.stream().filter(item -> item.getOrganizationId()==Long.parseLong(value.toString())).findAny().map(ReceiptManage::getOrganizationName).orElse(null); + k.put("organization_id",organizationId == null ? value : organizationId); + break; + case "settlementWay": + k.put("settlement_way",ObjectUtil.equals(value,1) ? "现金" : "油卡"); + break; + default: + break; + } + } + + } + + /** + * 处理map中的数据 (结算分析报表) + * @param k key + * @param v 参数集合 + */ + private void handleMapKeyFour(Map k, List v) { + Map newMap = new HashMap<>(k); + for (Map.Entry entry : newMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + switch (key){ + case "settlementCustomersCode": + String settlementCustomersName = v.stream().filter(item -> item.getSettlementCustomersCode().equals(String.valueOf(value))).findAny().map(PaymentOrder::getSettlementEntity).orElse(null); + k.put("settlement_customers_code",settlementCustomersName == null ? value : settlementCustomersName); + break; + case "organizationId": + String organizationId = v.stream().filter(item -> item.getOrganizationId()==Long.parseLong(value.toString())).findAny().map(PaymentOrder::getOrganizationName).orElse(null); + k.put("organization_id",organizationId == null ? value : organizationId); + break; + case "settlementWay": + k.put("settlement_way",ObjectUtil.equals(value,1) ? "现金" : "油卡"); + break; + default: + break; + } + } + + } + + /** + * 字段名转驼峰 + */ + public static String convertToCamelCase(String underscoreName) { + StringBuilder result = new StringBuilder(); + String[] words = underscoreName.split("_"); + for (int i = 0; i < words.length; i++) { + String word = words[i]; + if (i == 0) { + result.append(word); + } else { + result.append(Character.toUpperCase(word.charAt(0))); + if (word.length() > 1) { + result.append(word.substring(1)); + } + } + } + return result.toString(); + } + + + /** + * 特殊字段处理 + * @param formQueryParams 查询条件 + */ + private void getSpecialFunction(FormQueryParams formQueryParams) { + Date date = DateUtil.parse(formQueryParams.getInputBoxText(), "yyyy-MM-dd"); + switch (formQueryParams.getField()){ + case "form_years": + formQueryParams.setField("YEAR(create_time)"); + //处理inputBoxText中的值,只取年份 + formQueryParams.setInputBoxText(DateUtil.format(date, "yyyy")); + break; + case "form_months": + formQueryParams.setField("MONTH(create_time)"); + formQueryParams.setInputBoxText(DateUtil.format(date, "MM")); + break; + case "form_days": + formQueryParams.setField("DAY(create_time)"); + formQueryParams.setInputBoxText(DateUtil.format(date, "dd")); + break; + case "form_week": + formQueryParams.setField("WEEK(create_time)"); + //获取日期date是第几周 + WeekFields weekFields = WeekFields.of(Locale.getDefault()); + LocalDate localDate = date.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate(); + int weekNumber = localDate.get(weekFields.weekOfWeekBasedYear()); + formQueryParams.setInputBoxText(String.valueOf(weekNumber)); + break; + default: + break; + } + } + + + + public List> billAnalysisList(ReportFormDO reportFormDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(StringUtils.isEmpty(reportFormDO.getQueryParamJson())){ + throw new ServiceException("查询参数不能为空"); + } + //解析传来的参数 + String queryParamJson = reportFormDO.getQueryParamJson(); + //转成FormQueryParams集合 + List formQueryParamsListAll = JSON.parseArray(queryParamJson, FormQueryParams.class); + //根据传来的查询参数,拼接查询SQL + if(formQueryParamsListAll==null || formQueryParamsListAll.size()==0){ + throw new ServiceException("查询参数不能为空"); + } + List formQueryParamsList = formQueryParamsListAll.stream().filter(formQueryParams -> StringUtils.isNotEmpty(formQueryParams.getInputBoxText())).collect(Collectors.toList()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("top_organization_id", loginUser.getUserPo().getTopOrganizationId()); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + FormQueryParams beforeFormQueryParams = null; + if(i > 0){ + //小于最后一个,则修改可判断状态 + beforeFormQueryParams = formQueryParamsList.get(i-1); + } + //根据选择的过滤方法选择合适的lambda函数 + getFunction(formQueryParams, queryWrapper, beforeFormQueryParams); + } + List billingStatementList = billManageDomainService.billAnalysisList(queryWrapper); + List> resultList = new ArrayList<>(); + if(formQueryParamsListAll.size()>0){ + List groupList = new ArrayList<>(); + for (int i = 0; i < formQueryParamsListAll.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsListAll.get(i); + groupList.add(convertToCamelCase(formQueryParams.getField())); + } + Map, List> billManageMap = billingStatementList.stream() + .collect(Collectors.groupingBy(p-> { + Map groupMap = new HashMap<>(); + for (int i = 0; i < groupList.size(); i++) { + String field = groupList.get(i); + Object value = ReflectUtil.getFieldValue(p, field); + groupMap.put(field,value); + } + return groupMap; + })); + billManageMap.forEach((k,v)->{ + if(v !=null && v.size()>0){ + handleMapKeyTwo(k,v); + Map billAnalysisFormPO = new HashMap<>(k); + //统计所需参数 + BigDecimal billTotalAmount = v.stream().map(BillManage::getBillTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billDiscountAmount = v.stream().map(BillManage::getBillDiscountAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal settlementDiscountsAmount = v.stream().map(BillManage::getSettlementDiscountsAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billAmountSettlement = v.stream().map(BillManage::getBillAmountSettlement).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal billAmountUnsettled = v.stream().map(BillManage::getBillAmountUnsettled).reduce(BigDecimal.ZERO, BigDecimal::add); + //账单总额 + billAnalysisFormPO.put("billTotalAmount",String.valueOf(billTotalAmount)); + //账单优惠 + billAnalysisFormPO.put("billDiscountAmount",String.valueOf(billDiscountAmount)); + //结算优惠 + billAnalysisFormPO.put("settlementDiscountsAmount",String.valueOf(settlementDiscountsAmount)); + //已结算 + billAnalysisFormPO.put("billAmountSettlement",String.valueOf(billAmountSettlement)); + //未结算 + billAnalysisFormPO.put("billAmountUnsettled",String.valueOf(billAmountUnsettled)); + resultList.add(billAnalysisFormPO); + } + }); + } + return resultList; + } + + + public List> settlementAnalysisList(ReportFormDO reportFormDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(StringUtils.isEmpty(reportFormDO.getQueryParamJson())){ + throw new ServiceException("查询参数不能为空"); + } + //解析传来的参数 + String queryParamJson = reportFormDO.getQueryParamJson(); + //转成FormQueryParams集合 + List formQueryParamsList = JSON.parseArray(queryParamJson, FormQueryParams.class); + //根据传来的查询参数,拼接查询SQL + if(formQueryParamsList==null || formQueryParamsList.size()==0){ + throw new ServiceException("查询参数不能为空"); + } + List> resultList = new ArrayList<>(); + if(reportFormDO.getAccountExpenseType()==1){ + //收款单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("top_organization_id", loginUser.getUserPo().getTopOrganizationId()); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + FormQueryParams beforeFormQueryParams = null; + if(i > 0){ + //小于最后一个,则修改可判断状态 + beforeFormQueryParams = formQueryParamsList.get(i-1); + } + //根据选择的过滤方法选择合适的lambda函数 + getFunction(formQueryParams, queryWrapper, beforeFormQueryParams); + } + List receiptManageList = receiptManageDomainService.settlementAnalysisList(queryWrapper); + if(receiptManageList != null && receiptManageList.size()>0){ + //按照formQueryParamsList查询条件分组,获取每个分组的统计数据 + List groupList = new ArrayList<>(); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + groupList.add(convertToCamelCase(formQueryParams.getField())); + } + Map, List> receiptManageMap = receiptManageList.stream() + .collect(Collectors.groupingBy(p-> { + Map groupMap = new HashMap<>(); + for (int i = 0; i < groupList.size(); i++) { + String field = groupList.get(i); + Object value = ReflectUtil.getFieldValue(p, field); + groupMap.put(field,value); + } + return groupMap; + })); + receiptManageMap.forEach((k,v)->{ + if(v !=null && v.size()>0){ + handleMapKeyThree(k,v); + //解析key,转成Map,并将map赋值到comprehensiveFormPO + Map receiptOrderPO = new HashMap<>(k); + Set orderIdSet = v.stream().map(ReceiptManage::getReceiptManageId).collect(Collectors.toSet()); + //查询收款单详情 + List receiptDetailList = receiptDetailDomainService.queryListByIdSet(orderIdSet); + //统计所需参数,收款次数,收款金额,退款次数,退款金额 + BigDecimal receiptAmount = receiptDetailList.stream().map(ReceiptDetail::getCollectedAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + long receiptCount = receiptDetailList.stream().map(ReceiptDetail::getCollectedAmount).count(); + long refundCount = v.stream().filter(item -> item.getPaymentStatus()==2).count(); + BigDecimal refundAmount = v.stream().map(ReceiptManage::getRefundAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + receiptOrderPO.put("receiptAmount",String.valueOf(receiptAmount)); + receiptOrderPO.put("receiptCount",String.valueOf(receiptCount)); + receiptOrderPO.put("refundCount",String.valueOf(refundCount)); + receiptOrderPO.put("refundAmount",String.valueOf(refundAmount)); + resultList.add(receiptOrderPO); + } + }); + } + } + else { + //付款单 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("top_organization_id", loginUser.getUserPo().getTopOrganizationId()); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + FormQueryParams beforeFormQueryParams = null; + if(i > 0){ + //小于最后一个,则修改可判断状态 + beforeFormQueryParams = formQueryParamsList.get(i-1); + } + //根据选择的过滤方法选择合适的lambda函数 + getFunction(formQueryParams, queryWrapper, beforeFormQueryParams); + } + List paymentOrderList = paymentOrderDomainService.settlementAnalysisList(queryWrapper); + if(paymentOrderList !=null && paymentOrderList.size()>0){ + //按照formQueryParamsList查询条件分组,获取每个分组的统计数据 + List groupList = new ArrayList<>(); + for (int i = 0; i < formQueryParamsList.size(); i++) { + FormQueryParams formQueryParams = formQueryParamsList.get(i); + groupList.add(convertToCamelCase(formQueryParams.getField())); + } + Map, List> billManageMap = paymentOrderList.stream() + .collect(Collectors.groupingBy(p-> { + Map groupMap = new HashMap<>(); + for (int i = 0; i < groupList.size(); i++) { + String field = groupList.get(i); + Object value = ReflectUtil.getFieldValue(p, field); + groupMap.put(field,value); + } + return groupMap; + })); + billManageMap.forEach((k,v)->{ + if(v !=null && v.size()>0){ + handleMapKeyFour(k,v); + //解析key,转成Map,并将map赋值到comprehensiveFormPO + Map paymentOrderPO = new HashMap<>(k); + Set orderIdSet = v.stream().map(PaymentOrder::getPaymentOrderId).collect(Collectors.toSet()); + //查询付款单详情 + List paymentOrderDetailsList = paymentOrderDetailsDomainService.queryListByIdSet(orderIdSet); + //统计所需参数,付款次数,付款金额 + long paymentTimes = paymentOrderDetailsList.stream().map(PaymentOrderDetails::getPaymentOrderId).distinct().count(); + BigDecimal paymentAmount = paymentOrderDetailsList.stream().map(PaymentOrderDetails::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + paymentOrderPO.put("paymentTimes",String.valueOf(paymentTimes)); + paymentOrderPO.put("paymentAmount",String.valueOf(paymentAmount)); + resultList.add(paymentOrderPO); + } + }); + } + } + return resultList; + } + + /** + * 根据选择的过滤方法选择合适的lambda函数 + * @param formQueryParams 查询条件 + * @param queryWrapper 拼接查询条件 + * @param beforeFormQueryParams 上一组参数 + */ + private void getFunction(FormQueryParams formQueryParams, QueryWrapper queryWrapper,FormQueryParams beforeFormQueryParams) { + if(StringUtils.isNotEmpty(formQueryParams.getInputBoxText())){ + switch (formQueryParams.getFilterMethod()) { + case 1: + //等于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2){ + queryWrapper.or().eq(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.eq(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 2: + //不等于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2){ + queryWrapper.or().ne(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.ne(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 3: + //大于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2){ + queryWrapper.or().gt(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.gt(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 4: + //大于等于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().ge(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.ge(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 5: + //小于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().lt(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.lt(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 6: + //小于等于 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().le(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.le(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 7: + //包含 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().like(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.like(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 8: + //不包含 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().notLike(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.notLike(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 9: + //在列表 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().in(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.in(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + case 10: + //不在列表 + if(beforeFormQueryParams != null && beforeFormQueryParams.getQueryRelation()==2) { + queryWrapper.or().notIn(formQueryParams.getField(), formQueryParams.getInputBoxText()); + }else { + queryWrapper.notIn(formQueryParams.getField(), formQueryParams.getInputBoxText()); + } + break; + default: + throw new ServiceException("过滤方法错误"); + } + } + } + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/settlementCustomers/SettlementCustomersApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/settlementCustomers/SettlementCustomersApplicationService.java new file mode 100644 index 000000000..47739f62b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/settlementCustomers/SettlementCustomersApplicationService.java @@ -0,0 +1,313 @@ +package com.mhd.bms.application.server.settlementCustomers; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.interfaces.dto.settlementCustomers.SettlementCustomersDTO; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.domain.po.UserDriverPo; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.domain.po.UserShipperPo; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.UserServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 结算对象ApplicationService + * + * @author gen + * @date 2024-06-17 + */ +@Service +@Slf4j +public class SettlementCustomersApplicationService { + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private UserServiceFeign userServiceFeign; + + + /** + * 分页查询结算对象列表 + */ + + public List queryList(SettlementCustomersDO settlementCustomersDO) { + setTopOrganizationIdLogin(settlementCustomersDO); + return settlementCustomersDomainService.queryList(settlementCustomersDO); + } + + /** + * 查询结算对象键值对 + */ + public List getSettlementObjectList(SettlementCustomersDO settlementCustomersDO){ + setTopOrganizationIdLogin(settlementCustomersDO); + return settlementCustomersDomainService.getSettlementObjects(); + } + + private void setTopOrganizationIdLogin(SettlementCustomersDO settlementCustomersDO){ + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + settlementCustomersDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + } + + /** + * 新增结算对象 + */ + public Boolean insert(SettlementCustomersDO settlementCustomersDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //校验编码唯一性 + checkCode(settlementCustomersDO); + + //处理数据字典 + handleDict(settlementCustomersDO); + //2024年6月24日改动,手动新增结算对象不与基础数据做关联 + + settlementCustomersDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + settlementCustomersDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + settlementCustomersDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return settlementCustomersDomainService.insert(settlementCustomersDO); + } + + /** + * 校验编码唯一性 + * @param settlementCustomersDO + */ + private void checkCode(SettlementCustomersDO settlementCustomersDO) { + if(!StringUtils.isNotEmpty(settlementCustomersDO.getSettlementCustomersCode())) { + throw new ServiceException("结算编码不能为空"); + } + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(settlementCustomersDO.getSettlementCustomersCode()); + if(settlementCustomers != null){ + throw new ServiceException("结算编码已存在"); + } + } + + /** + * 处理数据字典 + */ + private void handleDict(SettlementCustomersDO settlementCustomersDO) { + if(StringUtils.isNotEmpty(settlementCustomersDO.getSettlementMethodCode())){ + //查询数据字典 + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.SETTLEWAY.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if(sysDictDataVoList.size()>0){ + SysDictDataVo sysDictDataVo = sysDictDataVoList.stream().filter(info-> ObjectUtil.equal(info.getDictValue(),settlementCustomersDO.getSettlementMethodCode())).findAny().orElse(null); + if(null != sysDictDataVo){ + settlementCustomersDO.setSettlementMethod(sysDictDataVo.getDictLabel()); + } + } + } + if(StringUtils.isNotEmpty(settlementCustomersDO.getCustomerTypeCode())){ + //查询数据字典 + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.CUSTOMER_TYPE.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if(sysDictDataVoList.size()>0){ + SysDictDataVo sysDictDataVo = sysDictDataVoList.stream().filter(info-> ObjectUtil.equal(info.getDictValue(),settlementCustomersDO.getCustomerTypeCode())).findAny().orElse(null); + if(null != sysDictDataVo){ + settlementCustomersDO.setCustomerType(sysDictDataVo.getDictLabel()); + } + } + } + if(StringUtils.isNotEmpty(settlementCustomersDO.getProjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getProjectByCode(settlementCustomersDO.getProjectCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("项目信息未找到"); + } + settlementCustomersDO.setProjectName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("projectName")); + } + + + + + } + + /** + * 修改结算对象 + */ + public Boolean update(SettlementCustomersDO settlementCustomersDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if (StringUtils.isNotEmpty(settlementCustomersDO.getSettlementCustomersCode())) { + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(settlementCustomersDO.getSettlementCustomersCode()); + if(settlementCustomers != null && !ObjectUtil.equal(settlementCustomers.getSettlementCustomersId(),settlementCustomersDO.getSettlementCustomersId())){ + throw new ServiceException("结算编码已存在"); + } + } + //处理数据字典 + handleDict(settlementCustomersDO); + return settlementCustomersDomainService.update(settlementCustomersDO); + } + + /** + * 批量删除结算对象 + */ + public boolean delete(Long[] settlementCustomersIds) { + return settlementCustomersDomainService.delete(settlementCustomersIds); + } + + /** + * 获取结算对象详细信息 + */ + public SettlementCustomersPO getInfo(Long settlementCustomersId) + { + return settlementCustomersDomainService.getInfo(settlementCustomersId); + } + + + /** + * 批量删除 + * @param settlementCustomersDTO + * @return + */ + public Boolean deleteByIds(SettlementCustomersDTO settlementCustomersDTO) { + if(!StringUtils.isNotEmpty(settlementCustomersDTO.getSettlementCustomersIds())){ + throw new ServiceException("结算对象id不能为空"); + } + Set idSet = Stream.of(settlementCustomersDTO.getSettlementCustomersIds().split(",")).collect(Collectors.toSet()); + Long[] settlementCustomersIds = idSet.stream().map(Long::valueOf).toArray(Long[]::new); + return settlementCustomersDomainService.delete(settlementCustomersIds); + } + + /** + * 同步结算对象 + */ + public void syncSettlementCustomers() { + /* + 查询当前租户下所有的托运人、承运人、货主 + 对比用户id及主体角色,过滤出未同步的结算对象数据, + 新增结算对象,结算方式默认月结,结算方向根据角色区分,承运商是收款方,客户是付款方 + + 首先采用同步请求方式,如果后续数据量过大,更换消息队列或者异步新增 + */ + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + SettlementCustomersDO settlementCustomersDO = new SettlementCustomersDO(); + settlementCustomersDO.setMainRole(2); + settlementCustomersDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + List settlementCustomersList = settlementCustomersDomainService.queryList(settlementCustomersDO); + //TODO 查询货主信息 +// List saveSettingCustomersList = settlementCustomersList + + //查询托运人信息,并过滤,同步 + settlementCustomersDO.setMainRole(2); + List shipperList = settlementCustomersDomainService.queryList(settlementCustomersDO); + AjaxResult ajaxResult = userServiceFeign.userShipperListAll(); + List userShipperPoList = new ArrayList<>(); + if ("200".equals(String.valueOf(ajaxResult.get("code"))) && ObjectUtil.isNotNull(ajaxResult.get("data"))) { + userShipperPoList = JSONUtil.toList(JSONObject.toJSONString(ajaxResult.get("data")), UserShipperPo.class); + } + if(userShipperPoList != null && userShipperPoList.size()>0){ + //使用stream流过滤出 userShipperPoList中有但是shipperList中没有的集合 + List shipperListNew = userShipperPoList.stream().filter(userShipperPo -> { + return shipperList.stream().noneMatch(shipper -> ObjectUtil.equal(shipper.getSettlementEntityId(),userShipperPo.getUserId())); + }).collect(Collectors.toList()); + if(shipperListNew.size()>0){ + shipperListNew.forEach(userShipperPo -> { + SettlementCustomersDO saveEntity = new SettlementCustomersDO(); + saveEntity.setSettlementCustomersCode(OrderSequence.getOrderCode()); + saveEntity.setSettlementEntityId(userShipperPo.getUserId()); + saveEntity.setSettlementEntity(userShipperPo.getUserName()); + saveEntity.setSettlementMethodCode("monthly_settle"); + saveEntity(saveEntity); + }); + } + } + //查询承运人信息,并过滤,同步 + settlementCustomersDO.setMainRole(1); + List driverList = settlementCustomersDomainService.queryList(settlementCustomersDO); + AjaxResult ajaxResultDriver = userServiceFeign.userDriverListAll(); + List userDriverPoList = new ArrayList<>(); + if ("200".equals(String.valueOf(ajaxResultDriver.get("code"))) && ObjectUtil.isNotNull(ajaxResultDriver.get("data"))) { + userDriverPoList = JSONUtil.toList(JSONObject.toJSONString(ajaxResultDriver.get("data")), UserDriverPo.class); + } + if(userDriverPoList != null && userDriverPoList.size()>0){ + //使用stream流过滤出 userDriverPoList中有但是driverList中没有的集合 + List driverListNew = userDriverPoList.stream().filter(item -> { + return driverList.stream().noneMatch(driver -> ObjectUtil.equal(driver.getSettlementEntityId(),item.getUserId())); + }).collect(Collectors.toList()); + if(driverListNew.size()>0){ + driverListNew.forEach(userDriverPo -> { + SettlementCustomersDO saveEntity = new SettlementCustomersDO(); + saveEntity.setSettlementCustomersCode(OrderSequence.getOrderCode()); + saveEntity.setSettlementEntityId(userDriverPo.getUserId()); + saveEntity.setSettlementEntity(userDriverPo.getUserName()); + saveEntity.setSettlementMethodCode("monthly_settle"); + saveEntity(saveEntity); + }); + } + } + } + + + /** + * 保存结算客户信息 + */ + public Boolean saveEntity(SettlementCustomersDO settlementCustomersDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + //处理数据字典 + handleDict(settlementCustomersDO); + settlementCustomersDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + settlementCustomersDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + settlementCustomersDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return settlementCustomersDomainService.insert(settlementCustomersDO); + } + + + /** + * 根据code查询结算对象 + * @param settlementCustomersCode + * @return + */ + public SettlementCustomersPO getInfoByCode(String settlementCustomersCode) { + SettlementCustomersPO settlementCustomersPO = new SettlementCustomersPO(); + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(settlementCustomersCode); + if(null != settlementCustomers){ + BeanUtils.copyProperties(settlementCustomers,settlementCustomersPO); + return settlementCustomersPO; + } + return null; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/taskFlowRecords/TaskFlowRecordsApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/taskFlowRecords/TaskFlowRecordsApplicationService.java new file mode 100644 index 000000000..76783e885 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/taskFlowRecords/TaskFlowRecordsApplicationService.java @@ -0,0 +1,180 @@ +package com.mhd.bms.application.server.taskFlowRecords; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import com.mhd.bms.domain.taskFlowRecords.service.TaskFlowRecordsDomainService; +import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO; +import com.mhd.bms.interfaces.dto.taskFlowRecords.TaskFlowRecordsDTO; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 任务流水记录ApplicationService + * + * @author gen + * @date 2024-06-20 + */ +@Service +@Slf4j +public class TaskFlowRecordsApplicationService { + @Autowired + private TaskFlowRecordsDomainService taskFlowRecordsDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private DocumentTypeDomainService documentTypeDomainService; + + + /** + * 分页查询任务流水记录列表 + */ + public List queryList(TaskFlowRecordsDO taskFlowRecordsDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + taskFlowRecordsDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + } + return taskFlowRecordsDomainService.queryList(taskFlowRecordsDO); + } + + + /** + * 新增任务流水记录 + */ + public Boolean insert(TaskFlowRecordsDO taskFlowRecordsDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //填充数据字典即跨服务调用获取参数 + handleDict(taskFlowRecordsDO); + taskFlowRecordsDO.setTaskFlow(OrderSequence.getOrderCode("JFRW")); + taskFlowRecordsDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + taskFlowRecordsDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + taskFlowRecordsDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return taskFlowRecordsDomainService.insert(taskFlowRecordsDO); + } + + /** + * 填充数据字典 + */ + private void handleDict(TaskFlowRecordsDO taskFlowRecordsDO) { + //查询来源模块数据字典 + if(StringUtils.isNotEmpty(taskFlowRecordsDO.getBelongModuleCode())){ + List modulesTypeList = null; + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.MODULES.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + modulesTypeList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + } + if (modulesTypeList != null && modulesTypeList.size() > 0){ + for (SysDictDataVo sysDictDataVo : modulesTypeList) { + if (taskFlowRecordsDO.getBelongModuleCode().equals(sysDictDataVo.getDictValue())){ + taskFlowRecordsDO.setBelongModule(sysDictDataVo.getDictLabel()); + break; + } + } + } + } + //查询费用科目 + if(StringUtils.isNotEmpty(taskFlowRecordsDO.getSecondSubjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(taskFlowRecordsDO.getSecondSubjectCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + ExpenseAccountPO expenseAccountPO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class); + if(null == expenseAccountPO){ + throw new ServiceException("费用科目信息未找到"); + } + taskFlowRecordsDO.setServiceItemsCode(expenseAccountPO.getServiceItemsCode()); + taskFlowRecordsDO.setServiceItemsName(expenseAccountPO.getServiceItemsName()); + if(expenseAccountPO.getFirstSubjectFlag()==1){ + //如果是一级科目 + taskFlowRecordsDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); + taskFlowRecordsDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); + taskFlowRecordsDO.setSecondSubjectCode(""); + taskFlowRecordsDO.setSecondSubjectName(""); + }else { + //不是一级科目 + taskFlowRecordsDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); + taskFlowRecordsDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); + taskFlowRecordsDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); + taskFlowRecordsDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + } + } + } + //根据单据类型id查询单据类型数据,并赋值 + if(taskFlowRecordsDO.getDocumentTypeId() != null){ + DocumentTypePO documentTypePO = documentTypeDomainService.getInfo(taskFlowRecordsDO.getDocumentTypeId()); + if(null != documentTypePO){ + taskFlowRecordsDO.setDocumentType(documentTypePO.getDocumentType()); + taskFlowRecordsDO.setDocumentTypeCode(documentTypePO.getDocumentTypeCode()); + } + } + //TODO 查询计费规则 + + + + + + } + + /** + * 修改任务流水记录 + */ + public Boolean update(TaskFlowRecordsDO taskFlowRecordsDO) { + return taskFlowRecordsDomainService.update(taskFlowRecordsDO); + } + + /** + * 批量删除任务流水记录 + */ + public boolean delete(Long[] taskFlowRecordsIds) { + return taskFlowRecordsDomainService.delete(taskFlowRecordsIds); + } + + /** + * 获取任务流水记录详细信息 + */ + public TaskFlowRecordsPO getInfo(Long taskFlowRecordsId) + { + return taskFlowRecordsDomainService.getInfo(taskFlowRecordsId); + } + + + /** + * 批量删除任务流水记录 + * @param taskFlowRecordsDTO + * @return + */ + public boolean deleteByIds(TaskFlowRecordsDTO taskFlowRecordsDTO) { + if(!StringUtils.isNotEmpty(taskFlowRecordsDTO.getTaskFlowRecordsIds())){ + throw new ServiceException("任务流水id不能为空"); + } + Set idSet = Stream.of(taskFlowRecordsDTO.getTaskFlowRecordsIds().split(",")).collect(Collectors.toSet()); + Long[] taskFlowRecordsIds = idSet.stream().map(Long::valueOf).toArray(Long[]::new); + return taskFlowRecordsDomainService.delete(taskFlowRecordsIds); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillDetail.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillDetail.java new file mode 100644 index 000000000..f26c5fb13 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillDetail.java @@ -0,0 +1,78 @@ +package com.mhd.bms.domain.billManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 账单流水明细对象 bill_detail + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillDetail extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单流水明细id") + @TableId(type = IdType.AUTO) + private Long billDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("计费流水id") + @Excel(name = "计费流水id") + private Long billingStatementId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("费用总额") + @Excel(name = "费用总额") + private BigDecimal billingTotalAmount; + + @ApiModelProperty("账单优惠金额") + @Excel(name = "账单优惠金额") + private BigDecimal billingDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billingAmount; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billingExpectedAmount; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillManage.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillManage.java new file mode 100644 index 000000000..08d4e0691 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/entity/BillManage.java @@ -0,0 +1,186 @@ +package com.mhd.bms.domain.billManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 账单管理对象 bill_manage + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillManage extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单管理id") + @TableId(type = IdType.AUTO) + private Long billManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)") + @Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款") + private Integer billState; + + @ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)") + @Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款") + private Integer billStep; + + @ApiModelProperty("系统来源") + @Excel(name = "系统来源") + private String belongModule; + + @ApiModelProperty("系统来源code") + @Excel(name = "系统来源code") + private String belongModuleCode; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("账单总金额") + @Excel(name = "账单总金额") + private BigDecimal billTotalAmount; + + @ApiModelProperty("优惠金额") + @Excel(name = "优惠金额") + private BigDecimal billDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收/付金额") + @Excel(name = "已收/付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收/付金额") + @Excel(name = "未收/付金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billExpectedAmount; + + @ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)") + @Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误") + private Integer reconciliationStatus; + + @ApiModelProperty("对账意见描述") + @Excel(name = "对账意见描述") + private String reconciliationOpinion; + + @ApiModelProperty("客户凭证地址") + @Excel(name = "客户凭证地址") + private String voucherAddress; + + @ApiModelProperty("财务审核结果(1-同意,2-拒绝)") + @Excel(name = "财务审核结果(1-同意,2-拒绝)") + private Integer financialReviewFlag; + + @ApiModelProperty("审核意见描述") + @Excel(name = "审核意见描述") + private String financialReviewOpinion; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("收款/付款时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date settlementTime; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String billRemark; + + @ApiModelProperty("折扣百分比") + @Excel(name = "折扣百分比") + private BigDecimal billDiscount; + + @ApiModelProperty("折扣上限金额") + @Excel(name = "折扣上限金额") + private BigDecimal billDiscountLimit; + + @ApiModelProperty("费用计算精度code") + @Excel(name = "费用计算精度code") + private String costAccuracyCode; + + @ApiModelProperty("费用计算精度name") + @Excel(name = "费用计算精度name") + private String costAccuracyName; + + @ApiModelProperty("尾数计算code") + @Excel(name = "尾数计算code") + private String tailCalculationCode; + + @ApiModelProperty("尾数计算name") + @Excel(name = "尾数计算name") + private String tailCalculationName; + + @ApiModelProperty("账单金额精度code") + @Excel(name = "账单金额精度code") + private String amountAccuracyCode; + + @ApiModelProperty("账单金额精度name") + @Excel(name = "账单金额精度name") + private String amountAccuracyName; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("实收金额") + private BigDecimal actualReceivedAmount; + + @ApiModelProperty("结算单优惠金额") + private BigDecimal settlementDiscountsAmount; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillDetailService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillDetailService.java new file mode 100644 index 000000000..f2cbe3d43 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillDetailService.java @@ -0,0 +1,41 @@ +package com.mhd.bms.domain.billManage.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; + +import java.util.List; + +/** + * 账单流水明细Service接口 + * + * @author gen + * @date 2024-07-02 + */ +public interface IBillDetailService extends IService +{ + + /** + * 新增账单流水明细 + */ + public Boolean insert(BillDetailDO billDetailDO); + + /** + * 修改账单流水明细 + */ + public Boolean update(BillDetailDO billDetailDO); + + /** + * 批量删除账单流水明细 + */ + public Boolean delete(Long[] billDetailIds); + + + /** + * 查询账单流水明细 + */ + public BillDetailPO getInfo(Long billDetailId); + + List getDetailsByBillManageId(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillManageService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillManageService.java new file mode 100644 index 000000000..7320eaa64 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/facade/IBillManageService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.billManage.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; + +import java.util.List; + +/** + * 账单管理Service接口 + * + * @author gen + * @date 2024-07-02 + */ +public interface IBillManageService extends IService +{ + /** + * 分页查询账单管理列表 + */ + public List queryList(BillManageDO billManageDO); + + /** + * 新增账单管理 + */ + public Boolean insert(BillManageDO billManageDO); + + /** + * 修改账单管理 + */ + public Boolean update(BillManageDO billManageDO); + + /** + * 批量删除账单管理 + */ + public Boolean delete(Long[] billManageIds); + + + /** + * 查询账单管理 + */ + public BillManagePO getInfo(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillDetailMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillDetailMapper.java new file mode 100644 index 000000000..1ea7709f4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillDetailMapper.java @@ -0,0 +1,20 @@ +package com.mhd.bms.domain.billManage.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 账单流水明细Mapper接口 + * + * @author gen + * @date 2024-07-02 + */ +public interface BillDetailMapper extends BaseMapper +{ + + List getDetailsByBillManageId(@Param("billManageId") Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java new file mode 100644 index 000000000..8647aa8d4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/mapper/BillManageMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.billManage.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import org.apache.ibatis.annotations.Param; +/** + * 账单管理Mapper接口 + * + * @author gen + * @date 2024-07-02 + */ +public interface BillManageMapper extends BaseMapper +{ + /** + * 查询账单管理列表 + */ + public List queryList(@Param("billManageDO") BillManageDO billManageDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillDetailImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillDetailImpl.java new file mode 100644 index 000000000..cf62504d6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillDetailImpl.java @@ -0,0 +1,78 @@ +package com.mhd.bms.domain.billManage.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService; +import com.mhd.bms.domain.billManage.repository.mapper.BillDetailMapper; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 账单流水明细Service业务层处理 + * + * @author gen + * @date 2024-07-02 + */ +@Service +public class BillDetailImpl extends ServiceImpl implements IBillDetailService { + @Autowired + private BillDetailMapper billDetailMapper; + + + /** + * 新增账单流水明细 + */ + @Override + public Boolean insert(BillDetailDO billDetailDO) { + BillDetail billDetail = new BillDetail(); + BeanUtils.copyProperties(billDetailDO,billDetail); + return this.save(billDetail); + } + + /** + * 修改账单流水明细 + */ + @Override + public Boolean update(BillDetailDO billDetailDO) { + BillDetail billDetail = new BillDetail(); + BeanUtils.copyProperties(billDetailDO,billDetail); + return this.updateById(billDetail); + } + + /** + * 批量删除账单流水明细 + */ + @Override + public Boolean delete(Long[] billDetailIds ) { + List list = new ArrayList<>(); + for (Long id : billDetailIds) { + BillDetail billDetail = new BillDetail(); + billDetail.setBillDetailId(id); + billDetail.setDelFlag(2); + list.add(billDetail); + } + return this.updateBatchById(list); + } + + /** + * 修改账单流水明细 + */ + @Override + public BillDetailPO getInfo(Long billDetailId) { + BillDetail billDetail = this.getById(billDetailId); + BillDetailPO billDetailPO = new BillDetailPO(); + BeanUtils.copyProperties(billDetail,billDetailPO); + return billDetailPO; + } + + @Override + public List getDetailsByBillManageId(Long billManageId) { + return billDetailMapper.getDetailsByBillManageId(billManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java new file mode 100644 index 000000000..3f54433ef --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/persistence/BillManageImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.billManage.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.facade.IBillManageService; +import com.mhd.bms.domain.billManage.repository.mapper.BillManageMapper; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 账单管理Service业务层处理 + * + * @author gen + * @date 2024-07-02 + */ +@Service +public class BillManageImpl extends ServiceImpl implements IBillManageService{ + @Autowired + private BillManageMapper billManageMapper; + + /** + * 查询账单管理列表 + */ + @Override + public List queryList(BillManageDO billManageDO) + { + return billManageMapper.queryList(billManageDO); + } + + /** + * 新增账单管理 + */ + @Override + public Boolean insert(BillManageDO billManageDO) { + BillManage billManage = new BillManage(); + BeanUtils.copyProperties(billManageDO,billManage); + return this.save(billManage); + } + + /** + * 修改账单管理 + */ + @Override + public Boolean update(BillManageDO billManageDO) { + BillManage billManage = new BillManage(); + BeanUtils.copyProperties(billManageDO,billManage); + return this.updateById(billManage); + } + + /** + * 批量删除账单管理 + */ + @Override + public Boolean delete(Long[] billManageIds ) { + List list = new ArrayList<>(); + for (Long id : billManageIds) { + BillManage billManage = new BillManage(); + billManage.setBillManageId(id); + billManage.setDelFlag(2); + list.add(billManage); + } + return this.updateBatchById(list); + } + + /** + * 修改账单管理 + */ + @Override + public BillManagePO getInfo(Long billManageId) { + BillManage billManage = this.getById(billManageId); + BillManagePO billManagePO = new BillManagePO(); + BeanUtils.copyProperties(billManage,billManagePO); + return billManagePO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillDetailPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillDetailPO.java new file mode 100644 index 000000000..d66f4b579 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillDetailPO.java @@ -0,0 +1,124 @@ +package com.mhd.bms.domain.billManage.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 账单流水明细对象 bill_detail + * + * @author gen + * @date 2024-07-02 + */ + +@Data +@ApiModel(value = "账单流水明细对象", description = "账单流水明细响应对象") +public class BillDetailPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单流水明细id") + private Long billDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("计费流水id") + @Excel(name = "计费流水id") + private Long billingStatementId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("费用总额") + @Excel(name = "费用总额") + private BigDecimal billingTotalAmount; + + @ApiModelProperty("账单优惠金额") + @Excel(name = "账单优惠金额") + private BigDecimal billingDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billingAmount; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billingExpectedAmount; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillManagePO.java new file mode 100644 index 000000000..938556f17 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/po/BillManagePO.java @@ -0,0 +1,197 @@ +package com.mhd.bms.domain.billManage.repository.po; + +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.List; + +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 账单管理对象 bill_manage + * + * @author gen + * @date 2024-07-02 + */ + +@Data +@ApiModel(value = "账单管理对象", description = "账单管理响应对象") +public class BillManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)") + @Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款") + private Integer billState; + + @ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)") + @Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款") + private Integer billStep; + + @ApiModelProperty("系统来源") + @Excel(name = "系统来源") + private String belongModule; + + @ApiModelProperty("系统来源code") + @Excel(name = "系统来源code") + private String belongModuleCode; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("账单总金额") + @Excel(name = "账单总金额") + private BigDecimal billTotalAmount; + + @ApiModelProperty("优惠金额") + @Excel(name = "优惠金额") + private BigDecimal billDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收/付金额") + @Excel(name = "已收/付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收/付金额") + @Excel(name = "未收/付金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billExpectedAmount; + + @ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)") + @Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误") + private Integer reconciliationStatus; + + @ApiModelProperty("对账意见描述") + @Excel(name = "对账意见描述") + private String reconciliationOpinion; + + @ApiModelProperty("客户凭证地址") + @Excel(name = "客户凭证地址") + private String voucherAddress; + + @ApiModelProperty("财务审核结果(1-同意,2-拒绝)") + @Excel(name = "财务审核结果(1-同意,2-拒绝)") + private Integer financialReviewFlag; + + @ApiModelProperty("审核意见描述") + @Excel(name = "审核意见描述") + private String financialReviewOpinion; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("收款/付款时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date settlementTime; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String billRemark; + + @ApiModelProperty("折扣百分比") + @Excel(name = "折扣百分比") + private BigDecimal billDiscount; + + @ApiModelProperty("折扣上限金额") + @Excel(name = "折扣上限金额") + private BigDecimal billDiscountLimit; + + @ApiModelProperty("费用计算精度code") + @Excel(name = "费用计算精度code") + private String costAccuracyCode; + + @ApiModelProperty("费用计算精度name") + @Excel(name = "费用计算精度name") + private String costAccuracyName; + + @ApiModelProperty("尾数计算code") + @Excel(name = "尾数计算code") + private String tailCalculationCode; + + @ApiModelProperty("尾数计算name") + @Excel(name = "尾数计算name") + private String tailCalculationName; + + @ApiModelProperty("账单金额精度code") + @Excel(name = "账单金额精度code") + private String amountAccuracyCode; + + @ApiModelProperty("账单金额精度name") + @Excel(name = "账单金额精度name") + private String amountAccuracyName; + + @ApiModelProperty("账单详情明细列表") + private List billDetailPOList; + + @ApiModelProperty("账单流水明细表") + private List billingStatementPOList; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("实收金额") + private BigDecimal actualReceivedAmount; + + @ApiModelProperty("结算单优惠金额") + private BigDecimal settlementDiscountsAmount; + + @ApiModelProperty("流水ids") + private String billingStatementIds; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillDetailDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillDetailDO.java new file mode 100644 index 000000000..b09beda98 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillDetailDO.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.billManage.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 账单流水明细对象 bill_detail + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillDetailDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单流水明细id") + private Long billDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("计费流水id") + @Excel(name = "计费流水id") + private Long billingStatementId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("费用总额") + @Excel(name = "费用总额") + private BigDecimal billingTotalAmount; + + @ApiModelProperty("账单优惠金额") + @Excel(name = "账单优惠金额") + private BigDecimal billingDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billingAmount; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billingExpectedAmount; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillManageDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillManageDO.java new file mode 100644 index 000000000..3bd8d7858 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/repository/todo/BillManageDO.java @@ -0,0 +1,208 @@ +package com.mhd.bms.domain.billManage.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; +import java.util.Set; + + +/** + * 账单管理对象 bill_manage + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillManageDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)") + @Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款") + private Integer billState; + + @ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)") + @Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款") + private Integer billStep; + + @ApiModelProperty("系统来源") + @Excel(name = "系统来源") + private String belongModule; + + @ApiModelProperty("系统来源code") + @Excel(name = "系统来源code") + private String belongModuleCode; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("账单总金额") + @Excel(name = "账单总金额") + private BigDecimal billTotalAmount; + + @ApiModelProperty("优惠金额") + @Excel(name = "优惠金额") + private BigDecimal billDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收/付金额") + @Excel(name = "已收/付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收/付金额") + @Excel(name = "未收/付金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billExpectedAmount; + + @ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)") + @Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误") + private Integer reconciliationStatus; + + @ApiModelProperty("对账意见描述") + @Excel(name = "对账意见描述") + private String reconciliationOpinion; + + @ApiModelProperty("客户凭证地址") + @Excel(name = "客户凭证地址") + private String voucherAddress; + + @ApiModelProperty("财务审核结果(1-同意,2-拒绝)") + @Excel(name = "财务审核结果(1-同意,2-拒绝)") + private Integer financialReviewFlag; + + @ApiModelProperty("审核意见描述") + @Excel(name = "审核意见描述") + private String financialReviewOpinion; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("收款/付款时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date settlementTime; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String billRemark; + + @ApiModelProperty("折扣百分比") + @Excel(name = "折扣百分比") + private BigDecimal billDiscount; + + @ApiModelProperty("折扣上限金额") + @Excel(name = "折扣上限金额") + private BigDecimal billDiscountLimit; + + @ApiModelProperty("费用计算精度code") + @Excel(name = "费用计算精度code") + private String costAccuracyCode; + + @ApiModelProperty("费用计算精度name") + @Excel(name = "费用计算精度name") + private String costAccuracyName; + + @ApiModelProperty("尾数计算code") + @Excel(name = "尾数计算code") + private String tailCalculationCode; + + @ApiModelProperty("尾数计算name") + @Excel(name = "尾数计算name") + private String tailCalculationName; + + @ApiModelProperty("账单金额精度code") + @Excel(name = "账单金额精度code") + private String amountAccuracyCode; + + @ApiModelProperty("账单金额精度name") + @Excel(name = "账单金额精度name") + private String amountAccuracyName; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("查询条件类型(1-未结清,2-已结清,3-已作废)") + private Integer queryParam; + + @ApiModelProperty(name = "账单管理id集合") + private Set billManageIdSet; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("实收金额") + private BigDecimal actualReceivedAmount; + + @ApiModelProperty("结算单优惠金额") + private BigDecimal settlementDiscountsAmount; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillDetailDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillDetailDomainService.java new file mode 100644 index 000000000..c438d20ec --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillDetailDomainService.java @@ -0,0 +1,155 @@ +package com.mhd.bms.domain.billManage.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; +import com.mhd.bms.interfaces.dto.billManage.BillDetailDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; + +/** + * 账单流水明细 + * + * @author gen + * @date 2024-07-02 + */ +@Service +@Slf4j +public class BillDetailDomainService { + + @Autowired + private IBillDetailService billDetailService; + + + /** + * 新增账单流水明细 + */ + public Boolean insert(BillDetailDO billDetailDO) { + + return billDetailService.insert(billDetailDO); + } + + /** + * 修改账单流水明细 + */ + public Boolean update(BillDetailDO billDetailDO) { + return billDetailService.update(billDetailDO); + } + + /** + * 批量删除账单流水明细 + */ + public Boolean delete(Long[] billDetailIds) { + return billDetailService.delete(billDetailIds); + } + + /** + * 获取账单流水明细详细信息 + */ + public BillDetailPO getInfo(Long billDetailId) + { + return billDetailService.getInfo(billDetailId); + } + + + public Boolean insertBatch(List billDetailList) { + return billDetailService.saveBatch(billDetailList); + } + + public List queryByLambda(LambdaQueryWrapper queryWrapper) { + return billDetailService.list(queryWrapper); + } + + /** + * 根据账单管理id删除账单明细 + */ + public Boolean deletByManageIds(Set billManageIds) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillDetail::getBillManageId, billManageIds); + updateWrapper.set(BillDetail::getDelFlag, 2); + updateWrapper.set(BillDetail::getUpdateBy, loginUser.getUserPo().getUserId()); + updateWrapper.set(BillDetail::getUpdateTime, new Date()); + updateWrapper.set(BillDetail::getUpdateByName, loginUser.getUserPo().getUserName()); + return billDetailService.update(updateWrapper); + } + + /** + * 根据账单管理,查询账单详情 + */ + public List getDetailsByBillManageId(Long billManageId) { + return billDetailService.getDetailsByBillManageId(billManageId); + } + + + /** + * 根据账单管理id删除账单明细 + * @param billManageId + * @return + */ + public Boolean removeByBillManageId(Long billManageId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BillDetail::getBillManageId, billManageId); + queryWrapper.eq(BillDetail::getDelFlag, 1); + return billDetailService.remove(queryWrapper); + } + + /** + * 批量保存明细 + * @param billDetailDTOList + * @return + */ + public Boolean saveBatch(List billDetailDTOList) { + List billDetailList = new ArrayList<>(); + billDetailDTOList.forEach(billDetailDTO -> { + BillDetail billDetail = new BillDetail(); + BeanUtils.copyProperties(billDetailDTO, billDetail); + //校验相加是否合理 + if((billDetail.getBillingDiscountAmount().add(billDetail.getBillingAmount())).compareTo(billDetail.getBillingTotalAmount()) != 0){ + throw new ServiceException("账单明细"+ billDetailDTO.getBillingFlow() +"费用异常,请重试"); + } + billDetailList.add(billDetail); + }); + return billDetailService.saveBatch(billDetailList); + } + + /** + * 修改详情金额 + */ + public Boolean changeAmount(List billDetailDTOList) { + List billDetailList = new ArrayList<>(); + billDetailDTOList.forEach(billDetailDTO -> { + BillDetail billDetail = new BillDetail(); + billDetail.setBillingExpectedAmount(billDetailDTO.getBillingExpectedAmount()); + billDetail.setBillingTotalAmount(billDetailDTO.getBillingTotalAmount()); + billDetail.setBillingAmount(billDetailDTO.getBillingAmount()); + billDetail.setBillingDiscountAmount(billDetailDTO.getBillingDiscountAmount()); + //校验相加是否合理 + if((billDetail.getBillingDiscountAmount().add(billDetail.getBillingAmount())).compareTo(billDetail.getBillingTotalAmount()) != 0){ + throw new ServiceException("账单明细"+ billDetailDTO.getBillingFlow() +"费用异常,请重试"); + } + billDetail.setBillDetailId(billDetailDTO.getBillDetailId()); + billDetailList.add(billDetail); + }); + return billDetailService.updateBatchById(billDetailList); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillManageDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillManageDomainService.java new file mode 100644 index 000000000..65150c8ba --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billManage/service/BillManageDomainService.java @@ -0,0 +1,506 @@ +package com.mhd.bms.domain.billManage.service; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.billManage.entity.BillDetail; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.facade.IBillManageService; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.infrastructure.constant.BillLogsConstants; +import com.mhd.bms.interfaces.assembler.billManage.BillManageAssembler; +import com.mhd.bms.interfaces.dto.billManage.BillManageDTO; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 账单管理 + * + * @author gen + * @date 2024-07-02 + */ +@Service +@Slf4j +public class BillManageDomainService { + + @Autowired + private IBillManageService billManageService; + @Autowired + private BillingStatementDomainService billingStatementDomainService; + @Autowired + private BillDetailDomainService billDetailDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private BillOperationLogDomainService billOperationLogDomainService; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + + + /** + * 分页查询账单管理列表 + */ + public List queryList(BillManageDO billManageDO) { + return billManageService.queryList(billManageDO); + } + + + /** + * 新增账单管理 + */ + public Boolean insert(BillManageDO billManageDO) { + + return billManageService.insert(billManageDO); + } + + /** + * 修改账单管理 + */ + public Boolean update(BillManageDO billManageDO) { + return billManageService.update(billManageDO); + } + + /** + * 批量删除账单管理 + */ + public Boolean delete(Long[] billManageIds) { + return billManageService.delete(billManageIds); + } + + /** + * 获取账单管理详细信息 + */ + public BillManagePO getInfo(Long billManageId) + { + return billManageService.getInfo(billManageId); + } + + /** + * 保存账单 + */ + public Boolean saveBill(List billingStatementPOS,String billingRemark,Date billCreateTime) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillManage billManage = new BillManage(); + billManage.setCreateBy(loginUser.getUserPo().getUserId()); + billManage.setCreateByName(loginUser.getUserPo().getUserName()); + billManage.setCreateTime(billCreateTime==null ? new Date():billCreateTime); + billManage.setDelFlag(1); + billManage.setBillNumber(OrderSequence.getOrderCode("ZD")); + billManage.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billManage.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billManage.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + billManage.setBillType(billingStatementPOS.get(0).getAccountExpenseType()); + billManage.setBelongModule(billingStatementPOS.get(0).getBelongModule()); + billManage.setBelongModuleCode(billingStatementPOS.get(0).getBelongModuleCode()); + billManage.setSettlementCustomersId(billingStatementPOS.get(0).getSettlementCustomersId()); + billManage.setSettlementEntity(billingStatementPOS.get(0).getSettlementEntity()); + billManage.setSettlementCustomersCode(billingStatementPOS.get(0).getSettlementCustomersCode()); + billManage.setBillRemark(billingRemark); + //查询结算对象信息 + SettlementCustomersPO settlementCustomersPO = settlementCustomersDomainService.getInfo(billingStatementPOS.get(0).getSettlementCustomersId()); + if(null == settlementCustomersPO){ + throw new ServiceException("结算对象信息未找到"); + } + billManage.setSettlementMethod(settlementCustomersPO.getSettlementMethod()); + billManage.setSettlementMethodCode(settlementCustomersPO.getSettlementMethodCode()); +// if(settlementCustomersPO.getMainRole()==1){ +// billManage.setBillType(1); +// }else { +// billManage.setBillType(2); +// } + //计算所有流水列表中的最早周期开始时间和晚周期结束时间 + List cycleBeginTimeSet = billingStatementPOS.stream().map(BillingStatementPO::getCycleBeginTime).collect(Collectors.toList()); + List cycleEndTimeSet = billingStatementPOS.stream().map(BillingStatementPO::getCycleEndTime).collect(Collectors.toList()); + cycleBeginTimeSet.removeIf(Objects::isNull); + cycleEndTimeSet.removeIf(Objects::isNull); + if(cycleBeginTimeSet.size()>0){ + billManage.setCycleBeginTime(Collections.min(cycleBeginTimeSet)); + } + if(cycleEndTimeSet.size()>0){ + billManage.setCycleEndTime(Collections.max(cycleEndTimeSet)); + } + //将所有的流水金额相加 + billManage.setBillTotalAmount(billingStatementPOS.stream().map(BillingStatementPO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); + billManage.setBillAmount(billManage.getBillTotalAmount()); + billManage.setBillAmountUnsettled(billManage.getBillTotalAmount()); + boolean flag = billManageService.save(billManage); + List billDetailList = new ArrayList<>(); + for (BillingStatementPO billingStatementPO : billingStatementPOS) { + //生成对账单详情 + BillDetail billDetail = new BillDetail(); + billDetail.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + billDetail.setCreateBy(billManage.getCreateBy()); + billDetail.setCreateByName(billManage.getCreateByName()); + billDetail.setCreateTime(billManage.getCreateTime()); + billDetail.setBillManageId(billManage.getBillManageId()); + billDetail.setBillNumber(billManage.getBillNumber()); + billDetail.setBillingStatementId(billingStatementPO.getBillingStatementId()); + billDetail.setBillingFlow(billingStatementPO.getBillingFlow()); + billDetail.setBillingTotalAmount(billingStatementPO.getBillingAmount()); + billDetail.setBillingAmount(billingStatementPO.getBillingAmount()); + billDetail.setBillType(billingStatementPO.getAccountExpenseType()); + billDetailList.add(billDetail); + } + boolean flagTwo = billDetailDomainService.insertBatch(billDetailList); + //保存账单操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageId(billManage.getBillManageId()); + billOperationLogDO.setOperationInfo(StringUtils.format(BillLogsConstants.create_bill_text, billManage.getBillNumber(), billManage.getBillTotalAmount())); + billOperationLogDO.setOperationType(1); + boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO); + return flag && flagTwo && three; + } + + /** + * 保存账单 + * @param billingStatementDTO + * @return + */ + public Boolean save(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //根据前端传的流水id,查询计费流水信息列表 + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + BillingStatementDO billingStatementDO = new BillingStatementDO(); + billingStatementDO.setBillingStatementIdSet(billingSet); + List billingStatementPOS = billingStatementDomainService.queryList(billingStatementDO); + + if(billingStatementPOS==null || billingStatementPOS.size()==0){ + throw new ServiceException("所选流水信息未找到"); + } + return saveBill(billingStatementPOS,billingStatementDTO.getBillingRemark(),billingStatementDTO.getBillCreateTime()); + } + + + public List queryListLambda(LambdaQueryWrapper queryWrapper) { + return billManageService.list(queryWrapper); + } + + /** + * 作废账单 + */ + public Boolean nullifyByIds(Set billManageIds) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillManage::getBillManageId,billManageIds) + .set(BillManage::getBillState,6) + .set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId()) + .set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName()) + .set(BillManage::getUpdateTime,new Date()); + + //调整账单操作日志 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageIdSet(billManageIds); + billOperationLogDO.setOperationInfo(BillLogsConstants.nullify_bill_text); + billOperationLogDO.setOperationType(8); + boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO); + boolean flag = billManageService.update(updateWrapper); + return flag && three; + } + + /** + * 发起对账 + */ + public Boolean reconciliation(BillManageDO billManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillManage::getBillManageId,billManageDO.getBillManageIdSet()) + .set(BillManage::getBillStep,2) + .set(BillManage::getBillState,2) + .set(BillManage::getReconciliationStatus,1) + .set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId()) + .set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName()) + .set(BillManage::getUpdateTime,new Date()); + boolean flag = billManageService.update(updateWrapper); + //保存账单操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageIdSet(billManageDO.getBillManageIdSet()); + billOperationLogDO.setOperationInfo(BillLogsConstants.initiate_bill_text); + billOperationLogDO.setOperationType(4); + boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO); + return flag && three; + } + + /** + * 确认账单 + */ + public Boolean confirmBilling(BillManageDO billManageDO) { + //直接修改状态到未收款3状态 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillManage::getBillManageId,billManageDO.getBillManageIdSet()) + .set(BillManage::getBillStep,4) + .set(BillManage::getBillState,3) + .set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId()) + .set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName()) + .set(BillManage::getUpdateTime,new Date()); + boolean flag = billManageService.update(updateWrapper); + //保存账单操作记录 + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + billOperationLogDO.setBillManageIdSet(billManageDO.getBillManageIdSet()); + billOperationLogDO.setOperationInfo(BillLogsConstants.confirm_bill_text); + billOperationLogDO.setOperationType(3); + boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO); + return flag && three; + } + + /** + * 处理数据 + */ + public void handlData(BillManageDO billManageDO) { + if(StringUtils.isNotEmpty(billManageDO.getAmountAccuracyCode())){ + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.AMOUNT_ACCURACY.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + if(sysDictDataVoList != null && sysDictDataVoList.size()>0){ + sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getAmountAccuracyCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setAmountAccuracyName(sysDictDataVo.getDictLabel())); + } + } + } + if(StringUtils.isNotEmpty(billManageDO.getCostAccuracyCode())){ + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.COST_ACCURACY.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + if(sysDictDataVoList != null && sysDictDataVoList.size()>0){ + sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getCostAccuracyCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setCostAccuracyName(sysDictDataVo.getDictLabel())); + } + } + } + if(StringUtils.isNotEmpty(billManageDO.getTailCalculationCode())){ + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.TAIL_CALCULATION.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + if(sysDictDataVoList != null && sysDictDataVoList.size()>0){ + sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getTailCalculationCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setTailCalculationName(sysDictDataVo.getDictLabel())); + } + } + } + } + + /** + * 更新账单信息(收款) + */ + public Boolean updateBillSettlementInfo(ReceiptManageDO receiptManageDO) { + Set bills = Stream.of(receiptManageDO.getBillManageIds().split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,bills); + List billManageList = queryListLambda(queryWrapper); + if(billManageList ==null || billManageList.size()==0){ + throw new ServiceException("账单信息未找到"); + } + List receiptDetailPOList = receiptManageDO.getReceiptDetailDTOList(); + List billManageListSave = new ArrayList<>(); + List billOperationLogSave = new ArrayList<>(); + billManageList.forEach(billManage -> { + BillManage billManageSave = new BillManage(); + billManageSave.setBillManageId(billManage.getBillManageId()); + //计算已收,未收金额,账单已收金额 = 结算单明细收款金额 + 收款优惠金额 + BigDecimal collectedDiscount = receiptDetailPOList.stream().filter(receiptDetailPO -> ObjectUtil.equal(receiptDetailPO.getBillManageId(),billManage.getBillManageId())).map(ReceiptDetailDTO::getCollectedDiscount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal collectedAmount = receiptDetailPOList.stream().filter(receiptDetailPO -> ObjectUtil.equal(receiptDetailPO.getBillManageId(),billManage.getBillManageId())).map(ReceiptDetailDTO::getCollectedAmount).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal all = collectedAmount.add(collectedDiscount); + billManageSave.setBillAmountSettlement(billManage.getBillAmountSettlement().add(all)); + //计算账单未收,账单金额 - 已收金额 + billManageSave.setBillAmountUnsettled(billManage.getBillAmount().subtract(billManageSave.getBillAmountSettlement())); + //计算实收金额 + billManageSave.setActualReceivedAmount(billManage.getActualReceivedAmount().add(collectedAmount)); + //计算结算单优惠金额 + billManageSave.setSettlementDiscountsAmount(billManage.getSettlementDiscountsAmount().add(collectedDiscount)); + //如果未收金额为0 ,则更新状态到已收款,如果未收金额不为0 ,则更新状态到部分收款 + if(billManageSave.getBillAmountUnsettled().compareTo(BigDecimal.ZERO)==0){ + billManageSave.setBillState(5); + }else { + billManageSave.setBillState(4); + } + billManageListSave.add(billManageSave); + //保存账单操作记录 + BillOperationLog billOperationLog = new BillOperationLog(); + billOperationLog.setBillManageId(billManage.getBillManageId()); + billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.collection_bill_text,receiptManageDO.getCollectionNum(),all,collectedAmount,collectedDiscount)); + billOperationLog.setOperationType(7); + billOperationLogSave.add(billOperationLog); + }); + Boolean three = billOperationLogDomainService.insertBatch(billOperationLogSave); + Boolean flag = billManageService.updateBatchById(billManageListSave); + return flag && three; + } + + /** + * 根据账单id查询账单信息 + */ + public BillManagePO getDetailsById(Long billManageId) { + BillManagePO result = billManageService.getInfo(billManageId); + //查询账单关联流水列表 + List billingStatementPOList = billingStatementDomainService.getDetailsByManageId(billManageId); + result.setBillingStatementPOList(billingStatementPOList); + return result; + } + + + /** + * 保存结算单退款后账单的操作状态 + */ + public Boolean saveRefundLogs(List receiptDetails) { + List billManageIds = receiptDetails.stream().map(ReceiptDetail::getBillManageId).collect(Collectors.toList()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,billManageIds); + List billManageList = billManageService.list(queryWrapper); + List billOperationLogSave = new ArrayList<>(); + for (ReceiptDetail receiptDetail : receiptDetails) { + BillManage billManage = billManageList.stream().filter(billManage1 -> ObjectUtil.equal(billManage1.getBillManageId(),receiptDetail.getBillManageId())).findAny().orElse(null); + if(null == billManage){ + throw new ServiceException("结算单" + receiptDetail.getBillNumber() + "账单信息未找到,请重试"); + } + //保存账单操作记录 + BillOperationLog billOperationLog = new BillOperationLog(); + billOperationLog.setBillManageId(billManage.getBillManageId()); + billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.refund_bill_text,receiptDetail.getCollectionNum(),receiptDetail.getCollectedAmount())); + billOperationLog.setOperationType(10); + billOperationLogSave.add(billOperationLog); + } + return billOperationLogDomainService.insertBatch(billOperationLogSave); + } + + + /** + * 更改账单状态(付款) + */ + public Boolean updateBillPaymentInfo(PaymentOrderDO paymentOrderDO) { + Set bills = Stream.of(paymentOrderDO.getBillManageIds()).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,bills); + List billManageList = queryListLambda(queryWrapper); + if(billManageList ==null || billManageList.size()==0){ + throw new ServiceException("账单信息未找到"); + } + List paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList(); + List billManageListSave = new ArrayList<>(); + List billOperationLogSave = new ArrayList<>(); + billManageList.forEach(billManage -> { + PaymentOrderDetailsDTO paymentOrderDetailsDTO = paymentOrderDetailsDTOList.stream().filter(paymentOrderDetailsDTO1 -> ObjectUtil.equal(paymentOrderDetailsDTO1.getBillManageId(),billManage.getBillManageId())).findAny().orElse(null); + if(null == paymentOrderDetailsDTO){ + throw new ServiceException("账单信息未找到"); + } + BillManage billManageSave = new BillManage(); + billManageSave.setBillManageId(billManage.getBillManageId()); + //计算付款金额 + BigDecimal paymentAmount = paymentOrderDetailsDTO.getPaymentAmount(); + BigDecimal all = billManage.getBillAmountSettlement().add(paymentAmount); + billManageSave.setBillAmountSettlement(all); + //计算账单未付,账单金额 - 已付金额 + billManageSave.setBillAmountUnsettled(billManage.getBillAmount().subtract(billManageSave.getBillAmountSettlement())); + //如果未收金额为0 ,则更新状态到已收款,如果未收金额不为0 ,则更新状态到部分收款 + if(billManageSave.getBillAmountUnsettled().compareTo(BigDecimal.ZERO)==0){ + billManageSave.setBillState(5); + }else { + billManageSave.setBillState(4); + } + billManageListSave.add(billManageSave); + //保存账单操作记录 + BillOperationLog billOperationLog = new BillOperationLog(); + billOperationLog.setBillManageId(billManage.getBillManageId()); + billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.payment_bill_text,paymentOrderDetailsDTO.getPaymentOrderNum(),paymentAmount)); + billOperationLog.setOperationType(11); + billOperationLogSave.add(billOperationLog); + }); + Boolean three = billOperationLogDomainService.insertBatch(billOperationLogSave); + Boolean flag = billManageService.updateBatchById(billManageListSave); + return flag && three; + } + + /** + * 批量更新账单 + */ + public Boolean updateBatchById(List billManageList) { + return billManageService.updateBatchById(billManageList); + } + + + /** + * 批量生成账单,账单浏览 + */ + public BillManagePO getBillBrowse(List value) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillManagePO billManagePO = new BillManagePO(); + //将value中的id用逗号拼接成字符串 + Set billingStatementIds = value.stream().map(BillingStatementPO::getBillingStatementId).collect(Collectors.toSet()); + //转成字符串 + String billingStatementIdsStr = billingStatementIds.stream().map(String::valueOf).collect(Collectors.joining(",")); + billManagePO.setBillingStatementIds(billingStatementIdsStr); + billManagePO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billManagePO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billManagePO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + billManagePO.setBillType(value.get(0).getAccountExpenseType()); + billManagePO.setBelongModule(value.get(0).getBelongModule()); + billManagePO.setBelongModuleCode(value.get(0).getBelongModuleCode()); + billManagePO.setSettlementCustomersId(value.get(0).getSettlementCustomersId()); + billManagePO.setSettlementEntity(value.get(0).getSettlementEntity()); + billManagePO.setSettlementCustomersCode(value.get(0).getSettlementCustomersCode()); + //将所有的流水金额相加 + billManagePO.setBillTotalAmount(value.stream().map(BillingStatementPO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); + billManagePO.setBillAmount(billManagePO.getBillTotalAmount()); + return billManagePO; + } + + public List billAnalysisList(QueryWrapper queryWrapper) { + return billManageService.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/entity/BillOperationLog.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/entity/BillOperationLog.java new file mode 100644 index 000000000..3a653b8f6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/entity/BillOperationLog.java @@ -0,0 +1,54 @@ +package com.mhd.bms.domain.billOperationLog.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 账单操作日志对象 bill_operation_log + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class BillOperationLog extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单操作日志id") + @TableId(type = IdType.AUTO) + private Long billOperationLogId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)") + @Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款") + private Integer operationType; + + @ApiModelProperty("操作信息") + @Excel(name = "操作信息") + private String operationInfo; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/facade/IBillOperationLogService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/facade/IBillOperationLogService.java new file mode 100644 index 000000000..1024b8d7d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/facade/IBillOperationLogService.java @@ -0,0 +1,48 @@ +package com.mhd.bms.domain.billOperationLog.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; + +import java.util.List; + +/** + * 账单操作日志Service接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface IBillOperationLogService extends IService +{ + /** + * 分页查询账单操作日志列表 + */ + public List queryList(BillOperationLogDO billOperationLogDO); + + /** + * 新增账单操作日志 + */ + public Boolean insert(BillOperationLogDO billOperationLogDO); + + /** + * 修改账单操作日志 + */ + public Boolean update(BillOperationLogDO billOperationLogDO); + + /** + * 批量删除账单操作日志 + */ + public Boolean delete(Long[] billOperationLogIds); + + + /** + * 查询账单操作日志 + */ + public BillOperationLogPO getInfo(Long billOperationLogId); + + /** + * 查询账单操作日志记录表 + */ + List getDetailsById(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/mapper/BillOperationLogMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/mapper/BillOperationLogMapper.java new file mode 100644 index 000000000..bd2b4e639 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/mapper/BillOperationLogMapper.java @@ -0,0 +1,23 @@ +package com.mhd.bms.domain.billOperationLog.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import org.apache.ibatis.annotations.Param; +/** + * 账单操作日志Mapper接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface BillOperationLogMapper extends BaseMapper +{ + /** + * 查询账单操作日志列表 + */ + public List queryList(@Param("billOperationLogDO") BillOperationLogDO billOperationLogDO); + + List getDetailsById(@Param("billManageIds") Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/persistence/BillOperationLogImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/persistence/BillOperationLogImpl.java new file mode 100644 index 000000000..5c7e70861 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/persistence/BillOperationLogImpl.java @@ -0,0 +1,89 @@ +package com.mhd.bms.domain.billOperationLog.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.facade.IBillOperationLogService; +import com.mhd.bms.domain.billOperationLog.repository.mapper.BillOperationLogMapper; +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 账单操作日志Service业务层处理 + * + * @author gen + * @date 2024-07-09 + */ +@Service +public class BillOperationLogImpl extends ServiceImpl implements IBillOperationLogService{ + @Autowired + private BillOperationLogMapper billOperationLogMapper; + + /** + * 查询账单操作日志列表 + */ + @Override + public List queryList(BillOperationLogDO billOperationLogDO) + { + return billOperationLogMapper.queryList(billOperationLogDO); + } + + /** + * 新增账单操作日志 + */ + @Override + public Boolean insert(BillOperationLogDO billOperationLogDO) { + BillOperationLog billOperationLog = new BillOperationLog(); + BeanUtils.copyProperties(billOperationLogDO,billOperationLog); + return this.save(billOperationLog); + } + + /** + * 修改账单操作日志 + */ + @Override + public Boolean update(BillOperationLogDO billOperationLogDO) { + BillOperationLog billOperationLog = new BillOperationLog(); + BeanUtils.copyProperties(billOperationLogDO,billOperationLog); + return this.updateById(billOperationLog); + } + + /** + * 批量删除账单操作日志 + */ + @Override + public Boolean delete(Long[] billOperationLogIds ) { + List list = new ArrayList<>(); + for (Long id : billOperationLogIds) { + BillOperationLog billOperationLog = new BillOperationLog(); + billOperationLog.setBillOperationLogId(id); + billOperationLog.setDelFlag(2); + list.add(billOperationLog); + } + return this.updateBatchById(list); + } + + /** + * 修改账单操作日志 + */ + @Override + public BillOperationLogPO getInfo(Long billOperationLogId) { + BillOperationLog billOperationLog = this.getById(billOperationLogId); + BillOperationLogPO billOperationLogPO = new BillOperationLogPO(); + BeanUtils.copyProperties(billOperationLog,billOperationLogPO); + return billOperationLogPO; + } + + /** + * 查询账单操作日志记录表 + */ + @Override + public List getDetailsById(Long billManageId) { + return billOperationLogMapper.getDetailsById(billManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/po/BillOperationLogPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/po/BillOperationLogPO.java new file mode 100644 index 000000000..602f7370b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/po/BillOperationLogPO.java @@ -0,0 +1,54 @@ +package com.mhd.bms.domain.billOperationLog.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 账单操作日志对象 bill_operation_log + * + * @author gen + * @date 2024-07-09 + */ + +@Data +@ApiModel(value = "账单操作日志对象", description = "账单操作日志响应对象") +public class BillOperationLogPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单操作日志id") + private Long billOperationLogId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)") + @Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款") + private Integer operationType; + + @ApiModelProperty("操作信息") + @Excel(name = "操作信息") + private String operationInfo; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/todo/BillOperationLogDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/todo/BillOperationLogDO.java new file mode 100644 index 000000000..3780e833e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/repository/todo/BillOperationLogDO.java @@ -0,0 +1,61 @@ +package com.mhd.bms.domain.billOperationLog.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; +import java.util.Set; + + +/** + * 账单操作日志对象 bill_operation_log + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class BillOperationLogDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单操作日志id") + private Long billOperationLogId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)") + @Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款") + private Integer operationType; + + @ApiModelProperty("操作信息") + @Excel(name = "操作信息") + private String operationInfo; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "账单管理id集合") + private Set billManageIdSet; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/service/BillOperationLogDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/service/BillOperationLogDomainService.java new file mode 100644 index 000000000..f998836f1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billOperationLog/service/BillOperationLogDomainService.java @@ -0,0 +1,164 @@ +package com.mhd.bms.domain.billOperationLog.service; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.facade.IBillOperationLogService; +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +/** + * 账单操作日志 + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class BillOperationLogDomainService { + + @Autowired + private IBillOperationLogService billOperationLogService; + + + /** + * 分页查询账单操作日志列表 + */ + public List queryList(BillOperationLogDO billOperationLogDO) { + return billOperationLogService.queryList(billOperationLogDO); + } + + + /** + * 新增账单操作日志 + */ + public Boolean insert(BillOperationLogDO billOperationLogDO) { + + return billOperationLogService.insert(billOperationLogDO); + } + + /** + * 修改账单操作日志 + */ + public Boolean update(BillOperationLogDO billOperationLogDO) { + return billOperationLogService.update(billOperationLogDO); + } + + /** + * 批量删除账单操作日志 + */ + public Boolean delete(Long[] billOperationLogIds) { + return billOperationLogService.delete(billOperationLogIds); + } + + /** + * 获取账单操作日志详细信息 + */ + public BillOperationLogPO getInfo(Long billOperationLogId) + { + return billOperationLogService.getInfo(billOperationLogId); + } + + + /** + * 保存操作日志 + */ + public Boolean saveBillOperationLog(BillOperationLogDO billOperationLogDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUserPo().getUserName(); + // 获取登录人id + Long userId = loginUser.getUserid(); + billOperationLogDO.setCreateByName(userName); + billOperationLogDO.setUpdateByName(userName); + billOperationLogDO.setCreateTime(new Date()); + billOperationLogDO.setUpdateTime(new Date()); + billOperationLogDO.setDelFlag(1); + billOperationLogDO.setCreateBy(userId); + billOperationLogDO.setUpdateBy(userId); + billOperationLogDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billOperationLogDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billOperationLogDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return billOperationLogService.insert(billOperationLogDO); + } + + + /** + * 批量保存操作日志 + */ + public Boolean saveBillOperationLogBatch(BillOperationLogDO billOperationLogDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(billOperationLogDO.getBillManageIdSet()==null || billOperationLogDO.getBillManageIdSet().size()==0){ + throw new ServiceException("账单集合不能为空"); + } + String userName = loginUser.getUserPo().getUserName(); + // 获取登录人id + Long userId = loginUser.getUserid(); + BillOperationLogDO common = new BillOperationLogDO(); + common.setCreateByName(userName); + common.setUpdateByName(userName); + common.setCreateTime(new Date()); + common.setUpdateTime(new Date()); + common.setDelFlag(1); + common.setCreateBy(userId); + common.setUpdateBy(userId); + common.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + common.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + common.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + common.setOperationType(billOperationLogDO.getOperationType()); + common.setOperationInfo(billOperationLogDO.getOperationInfo()); + List saveList = new ArrayList<>(); + for (String billManageId : billOperationLogDO.getBillManageIdSet()) { + BillOperationLog save = new BillOperationLog(); + BeanUtils.copyProperties(common, save); + save.setBillManageId(Long.valueOf(billManageId)); + saveList.add(save); + } + return billOperationLogService.saveBatch(saveList); + } + + + /** + * 批量保存数据 + * @param billOperationLogSave + * @return + */ + public Boolean insertBatch(List billOperationLogSave) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + for (BillOperationLog billOperationLog : billOperationLogSave) { + billOperationLog.setCreateByName(loginUser.getUserPo().getUserName()); + billOperationLog.setCreateTime(new Date()); + billOperationLog.setCreateBy(loginUser.getUserid()); + billOperationLog.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billOperationLog.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billOperationLog.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + } + return billOperationLogService.saveBatch(billOperationLogSave); + } + + /** + * 查询账单操作日志记录表 + */ + public List getDetailsById(Long billManageId) { + return billOperationLogService.getDetailsById(billManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingParams.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingParams.java new file mode 100644 index 000000000..b6573dfee --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingParams.java @@ -0,0 +1,64 @@ +package com.mhd.bms.domain.billingRules.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 计费参数对象 billing_params + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingParams extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费参数id") + @TableId(type = IdType.AUTO) + private Long billingParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("计费参数表名称") + @Excel(name = "计费参数表名称") + private String billingParamsName; + + @ApiModelProperty("说明") + @Excel(name = "说明") + private String billingIllustrate; + + @ApiModelProperty("计费参数json串") + @Excel(name = "计费参数json串") + private String billingParamsJson; + + @ApiModelProperty("计费参数输出json串") + @Excel(name = "计费参数输出json串") + private String billingOutputJson; + + @ApiModelProperty("预置规则json串") + @Excel(name = "预置规则json串") + private String preSetRules; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingRules.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingRules.java new file mode 100644 index 000000000..0072abffe --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/entity/BillingRules.java @@ -0,0 +1,94 @@ +package com.mhd.bms.domain.billingRules.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 计费规则对象 billing_rules + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingRules extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费规则id") + @TableId(type = IdType.AUTO) + private Long billingRulesId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("规则说明") + @Excel(name = "规则说明", readConverterExp = "规则说明") + private String billingRulesIllustrate; + + @ApiModelProperty("状态(1-开启,2-关闭)") + @Excel(name = "状态", readConverterExp = "1=-开启,2-关闭") + private Integer billingRulesState; + + @ApiModelProperty("计费公式") + @Excel(name = "计费公式") + private String billingFormula; + + @ApiModelProperty("计费规则编码") + @Excel(name = "计费规则编码") + private String billingRulesCode; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称", readConverterExp = "计费规则名称") + private String billingRulesName; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingParamsService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingParamsService.java new file mode 100644 index 000000000..99d42c954 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingParamsService.java @@ -0,0 +1,48 @@ +package com.mhd.bms.domain.billingRules.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billingRules.entity.BillingParams; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; + +import java.util.List; + +/** + * 计费参数Service接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface IBillingParamsService extends IService +{ + /** + * 分页查询计费参数列表 + */ + public List queryList(BillingParamsDO billingParamsDO); + + /** + * 新增计费参数 + */ + public Boolean insert(BillingParamsDO billingParamsDO); + + /** + * 修改计费参数 + */ + public Boolean update(BillingParamsDO billingParamsDO); + + /** + * 批量删除计费参数 + */ + public Boolean delete(Long[] billingParamsIds); + + + /** + * 查询计费参数 + */ + public BillingParamsPO getInfo(Long billingParamsId); + + /** + * 根据计费规则id查询计费参数 + */ + List queryListByRulesId(Long billingRulesId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingRulesService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingRulesService.java new file mode 100644 index 000000000..347f542dd --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/facade/IBillingRulesService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.billingRules.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billingRules.entity.BillingRules; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; + +import java.util.List; + +/** + * 计费规则Service接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface IBillingRulesService extends IService +{ + /** + * 分页查询计费规则列表 + */ + public List queryList(BillingRulesDO billingRulesDO); + + /** + * 新增计费规则 + */ + public Boolean insert(BillingRulesDO billingRulesDO); + + /** + * 修改计费规则 + */ + public Boolean update(BillingRulesDO billingRulesDO); + + /** + * 批量删除计费规则 + */ + public Boolean delete(Long[] billingRulesIds); + + + /** + * 查询计费规则 + */ + public BillingRulesPO getInfo(Long billingRulesId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingParamsMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingParamsMapper.java new file mode 100644 index 000000000..4a5716450 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingParamsMapper.java @@ -0,0 +1,23 @@ +package com.mhd.bms.domain.billingRules.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billingRules.entity.BillingParams; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import org.apache.ibatis.annotations.Param; +/** + * 计费参数Mapper接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface BillingParamsMapper extends BaseMapper +{ + /** + * 查询计费参数列表 + */ + public List queryList(BillingParamsDO billingParamsDO); + + List queryListByRulesId(@Param("billingRulesId") Long billingRulesId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingRulesMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingRulesMapper.java new file mode 100644 index 000000000..70741e8b2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/mapper/BillingRulesMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.billingRules.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billingRules.entity.BillingRules; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import org.apache.ibatis.annotations.Param; +/** + * 计费规则Mapper接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface BillingRulesMapper extends BaseMapper +{ + /** + * 查询计费规则列表 + */ + public List queryList(@Param("billingRulesDO") BillingRulesDO billingRulesDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingParamsImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingParamsImpl.java new file mode 100644 index 000000000..fc4d2c297 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingParamsImpl.java @@ -0,0 +1,86 @@ +package com.mhd.bms.domain.billingRules.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billingRules.entity.BillingParams; +import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService; +import com.mhd.bms.domain.billingRules.repository.mapper.BillingParamsMapper; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 计费参数Service业务层处理 + * + * @author gen + * @date 2024-07-12 + */ +@Service +public class BillingParamsImpl extends ServiceImpl implements IBillingParamsService { + @Autowired + private BillingParamsMapper billingParamsMapper; + + /** + * 查询计费参数列表 + */ + @Override + public List queryList(BillingParamsDO billingParamsDO) + { + return billingParamsMapper.queryList(billingParamsDO); + } + + /** + * 新增计费参数 + */ + @Override + public Boolean insert(BillingParamsDO billingParamsDO) { + BillingParams billingParams = new BillingParams(); + BeanUtils.copyProperties(billingParamsDO,billingParams); + return this.save(billingParams); + } + + /** + * 修改计费参数 + */ + @Override + public Boolean update(BillingParamsDO billingParamsDO) { + BillingParams billingParams = new BillingParams(); + BeanUtils.copyProperties(billingParamsDO,billingParams); + return this.updateById(billingParams); + } + + /** + * 批量删除计费参数 + */ + @Override + public Boolean delete(Long[] billingParamsIds ) { + List list = new ArrayList<>(); + for (Long id : billingParamsIds) { + BillingParams billingParams = new BillingParams(); + billingParams.setBillingParamsId(id); + billingParams.setDelFlag(2); + list.add(billingParams); + } + return this.updateBatchById(list); + } + + /** + * 修改计费参数 + */ + @Override + public BillingParamsPO getInfo(Long billingParamsId) { + BillingParams billingParams = this.getById(billingParamsId); + BillingParamsPO billingParamsPO = new BillingParamsPO(); + BeanUtils.copyProperties(billingParams,billingParamsPO); + return billingParamsPO; + } + + @Override + public List queryListByRulesId(Long billingRulesId) { + return billingParamsMapper.queryListByRulesId(billingRulesId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingRulesImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingRulesImpl.java new file mode 100644 index 000000000..adf6312ac --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/persistence/BillingRulesImpl.java @@ -0,0 +1,83 @@ +package com.mhd.bms.domain.billingRules.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billingRules.entity.BillingRules; +import com.mhd.bms.domain.billingRules.repository.facade.IBillingRulesService; +import com.mhd.bms.domain.billingRules.repository.mapper.BillingRulesMapper; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 计费规则Service业务层处理 + * + * @author gen + * @date 2024-07-12 + */ +@Service +public class BillingRulesImpl extends ServiceImpl implements IBillingRulesService{ + @Autowired + private BillingRulesMapper billingRulesMapper; + + /** + * 查询计费规则列表 + */ + @Override + public List queryList(BillingRulesDO billingRulesDO) + { + return billingRulesMapper.queryList(billingRulesDO); + } + + /** + * 新增计费规则 + */ + @Override + public Boolean insert(BillingRulesDO billingRulesDO) { + BillingRules billingRules = new BillingRules(); + BeanUtils.copyProperties(billingRulesDO,billingRules); + boolean flag = this.save(billingRules); + billingRulesDO.setBillingRulesId(billingRules.getBillingRulesId()); + return flag; + } + + /** + * 修改计费规则 + */ + @Override + public Boolean update(BillingRulesDO billingRulesDO) { + BillingRules billingRules = new BillingRules(); + BeanUtils.copyProperties(billingRulesDO,billingRules); + return this.updateById(billingRules); + } + + /** + * 批量删除计费规则 + */ + @Override + public Boolean delete(Long[] billingRulesIds ) { + List list = new ArrayList<>(); + for (Long id : billingRulesIds) { + BillingRules billingRules = new BillingRules(); + billingRules.setBillingRulesId(id); + billingRules.setDelFlag(2); + list.add(billingRules); + } + return this.updateBatchById(list); + } + + /** + * 修改计费规则 + */ + @Override + public BillingRulesPO getInfo(Long billingRulesId) { + BillingRules billingRules = this.getById(billingRulesId); + BillingRulesPO billingRulesPO = new BillingRulesPO(); + BeanUtils.copyProperties(billingRules,billingRulesPO); + return billingRulesPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingParamsPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingParamsPO.java new file mode 100644 index 000000000..eb0d03929 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingParamsPO.java @@ -0,0 +1,91 @@ +package com.mhd.bms.domain.billingRules.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 计费参数对象 billing_params + * + * @author gen + * @date 2024-07-12 + */ + +@Data +@ApiModel(value = "计费参数对象", description = "计费参数响应对象") +public class BillingParamsPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费参数id") + private Long billingParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("计费参数表名称") + @Excel(name = "计费参数表名称") + private String billingParamsName; + + @ApiModelProperty("说明") + @Excel(name = "说明") + private String billingIllustrate; + + /** + * { + * "fields":"参与字段", + * "chargingId":"计费标识P1、P2", + * "ladderType":"阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)", + * "ladderRule":"阶梯规则(1-左开右闭,2-左闭右开)", + * "ladderNum":"阶梯值", + * "sort":"排序" + * } + */ + @ApiModelProperty("计费参数json串") + @Excel(name = "计费参数json串") + private String billingParamsJson; + + /** + *{ + * "outFields":"输出字段", + * "outChargingId":"输出计费标识", + * "fieIdsType":"字段类型(1-整数,2-浮点数,3-时间)", + * "sort":"排序" + * } + */ + @ApiModelProperty("计费参数输出json串") + @Excel(name = "计费参数输出json串") + private String billingOutputJson; + + /** + * { + * "fieIds1":"字段1", + * "fieIds2":"字段2", + * "fieIdsn":"字段N", + * "outFieIds1":"输出字段1", + * "outFieIds2":"输出字段2", + * "outFieIdsn":"输出字段n" + * } + */ + @ApiModelProperty("预置规则json串") + @Excel(name = "预置规则json串") + private String preSetRules; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingRulesPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingRulesPO.java new file mode 100644 index 000000000..a193c3979 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/po/BillingRulesPO.java @@ -0,0 +1,97 @@ +package com.mhd.bms.domain.billingRules.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.List; + +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 计费规则对象 billing_rules + * + * @author gen + * @date 2024-07-12 + */ + +@Data +@ApiModel(value = "计费规则对象", description = "计费规则响应对象") +public class BillingRulesPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("规则说明") + @Excel(name = "规则说明", readConverterExp = "规则说明") + private String billingRulesIllustrate; + + @ApiModelProperty("状态(1-开启,2-关闭)") + @Excel(name = "状态", readConverterExp = "1=-开启,2-关闭") + private Integer billingRulesState; + + @ApiModelProperty("计费公式") + @Excel(name = "计费公式") + private String billingFormula; + + @ApiModelProperty("计费规则编码") + @Excel(name = "计费规则编码") + private String billingRulesCode; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称", readConverterExp = "计费规则名称") + private String billingRulesName; + + @ApiModelProperty("计费参数明细列表") + private List billingParamsPOList; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingParamsDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingParamsDO.java new file mode 100644 index 000000000..bb4a0243a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingParamsDO.java @@ -0,0 +1,68 @@ +package com.mhd.bms.domain.billingRules.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 计费参数对象 billing_params + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingParamsDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费参数id") + private Long billingParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("计费参数表名称") + @Excel(name = "计费参数表名称") + private String billingParamsName; + + @ApiModelProperty("说明") + @Excel(name = "说明") + private String billingIllustrate; + + @ApiModelProperty("计费参数json串") + @Excel(name = "计费参数json串") + private String billingParamsJson; + + @ApiModelProperty("计费参数输出json串") + @Excel(name = "计费参数输出json串") + private String billingOutputJson; + + @ApiModelProperty("预置规则json串") + @Excel(name = "预置规则json串") + private String preSetRules; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingRulesDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingRulesDO.java new file mode 100644 index 000000000..e64f5a8ee --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/repository/todo/BillingRulesDO.java @@ -0,0 +1,107 @@ +package com.mhd.bms.domain.billingRules.repository.todo; + +import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 计费规则对象 billing_rules + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingRulesDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("规则说明") + @Excel(name = "规则说明", readConverterExp = "规则说明") + private String billingRulesIllustrate; + + @ApiModelProperty("状态(1-开启,2-关闭)") + @Excel(name = "状态", readConverterExp = "1=-开启,2-关闭") + private Integer billingRulesState; + + @ApiModelProperty("计费公式") + @Excel(name = "计费公式") + private String billingFormula; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "计费参数集合") + private List billingParamsDTOList; + + @ApiModelProperty("计费规则编码") + @Excel(name = "计费规则编码") + private String billingRulesCode; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称", readConverterExp = "计费规则名称") + private String billingRulesName; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingParamsDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingParamsDomainService.java new file mode 100644 index 000000000..f053d8723 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingParamsDomainService.java @@ -0,0 +1,139 @@ +package com.mhd.bms.domain.billingRules.service; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billingRules.entity.BillingParams; +import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +/** + * 计费参数 + * + * @author gen + * @date 2024-07-12 + */ +@Service +@Slf4j +public class BillingParamsDomainService { + + @Autowired + private IBillingParamsService billingParamsService; + + + /** + * 分页查询计费参数列表 + */ + public List queryList(BillingParamsDO billingParamsDO) { + return billingParamsService.queryList(billingParamsDO); + } + + + /** + * 新增计费参数 + */ + public Boolean insert(BillingParamsDO billingParamsDO) { + + return billingParamsService.insert(billingParamsDO); + } + + /** + * 修改计费参数 + */ + public Boolean update(BillingParamsDO billingParamsDO) { + return billingParamsService.update(billingParamsDO); + } + + /** + * 批量删除计费参数 + */ + public Boolean delete(Long[] billingParamsIds) { + return billingParamsService.delete(billingParamsIds); + } + + /** + * 获取计费参数详细信息 + */ + public BillingParamsPO getInfo(Long billingParamsId) + { + return billingParamsService.getInfo(billingParamsId); + } + + + /** + * 保存计费参数 + */ + public boolean saveBillParam(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List billingParamsDTOList = billingRulesDO.getBillingParamsDTOList(); + List billingParamsList = new ArrayList<>(); + for (BillingParamsDTO billingParamsDTO : billingParamsDTOList) { + BillingParams billingParams = new BillingParams(); + BeanUtils.copyProperties(billingParamsDTO,billingParams); + billingParams.setBillingRulesId(billingRulesDO.getBillingRulesId()); + billingParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingParams.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingParams.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + billingParams.setCreateBy(loginUser.getUserPo().getUserId()); + billingParams.setCreateByName(loginUser.getUserPo().getUserName()); + billingParams.setCreateTime(new Date()); + billingParamsList.add(billingParams); + } + return billingParamsService.saveBatch(billingParamsList); + } + + /** + * 修改计费参数 + */ + public boolean updateBillParam(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List billingParamsDTOList = billingRulesDO.getBillingParamsDTOList(); + List billingParamsList = new ArrayList<>(); + for (BillingParamsDTO billingParamsDTO : billingParamsDTOList) { + BillingParams billingParams = new BillingParams(); + BeanUtils.copyProperties(billingParamsDTO,billingParams); + billingParams.setBillingRulesId(billingRulesDO.getBillingRulesId()); + if(billingParams.getBillingParamsId()==null){ + billingParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingParams.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingParams.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + billingParams.setCreateBy(loginUser.getUserPo().getUserId()); + billingParams.setCreateByName(loginUser.getUserPo().getUserName()); + billingParams.setCreateTime(new Date()); + } + billingParamsList.add(billingParams); + } + return billingParamsService.saveOrUpdateBatch(billingParamsList); + } + + + /** + * 根据计费规则id查询计费参数表信息 + * @param billingRulesId + * @return + */ + public List getInfoByRuleId(Long billingRulesId) { + return billingParamsService.queryListByRulesId(billingRulesId); + } + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingRulesDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingRulesDomainService.java new file mode 100644 index 000000000..0b40804f8 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingRules/service/BillingRulesDomainService.java @@ -0,0 +1,184 @@ +package com.mhd.bms.domain.billingRules.service; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.billingRules.entity.BillingRules; +import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService; +import com.mhd.bms.domain.billingRules.repository.facade.IBillingRulesService; +import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService; +import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO; +import com.mhd.bms.interfaces.dto.billingRules.BillingRulesDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 计费规则 + * + * @author gen + * @date 2024-07-12 + */ +@Service +@Slf4j +public class BillingRulesDomainService { + + @Autowired + private IBillingRulesService billingRulesService; + @Autowired + private DocumentTypeDomainService documentTypeDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private IBillingParamsService billingParamsService; + + + /** + * 分页查询计费规则列表 + */ + public List queryList(BillingRulesDO billingRulesDO) { + return billingRulesService.queryList(billingRulesDO); + } + + + /** + * 新增计费规则 + */ + public Boolean insert(BillingRulesDO billingRulesDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + handleData(billingRulesDO); + billingRulesDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingRulesDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingRulesDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return billingRulesService.insert(billingRulesDO); + } + + /** + * 处理数据 + */ + private void handleData(BillingRulesDO billingRulesDO) { + //根据单据类型id查询单据类型数据,并赋值 + if(StringUtils.isNotEmpty(billingRulesDO.getDocumentTypeCode())){ + DocumentType documentType = documentTypeDomainService.queryByCode(billingRulesDO.getDocumentTypeCode()); + if(null != documentType){ + billingRulesDO.setDocumentType(documentType.getDocumentType()); + billingRulesDO.setDocumentTypeCode(documentType.getDocumentTypeCode()); + } + } + //根据费用类型id查询费用类型对象数据,并赋值 + if(StringUtils.isNotEmpty(billingRulesDO.getServiceItemsCode())){ + AjaxResult ajaxResult = systemServiceFeign.getServiceItemsByCode(billingRulesDO.getServiceItemsCode()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))) { + throw new ServiceException("费用类型未找到"); + } + billingRulesDO.setServiceItemsName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("serviceItemsName")); + } + //根据费用科目code查询费用信息,并赋值 + if(StringUtils.isNotEmpty(billingRulesDO.getSecondSubjectCode())){ + AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(billingRulesDO.getSecondSubjectCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + ExpenseAccountPO expenseAccountPO = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class); + if(null == expenseAccountPO){ + throw new ServiceException("费用科目信息未找到"); + } + if(expenseAccountPO.getFirstSubjectFlag()==1){ + //如果是一级科目 + billingRulesDO.setFirstSubjectName(expenseAccountPO.getSubjectName()); + billingRulesDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode()); + billingRulesDO.setSecondSubjectCode(""); + }else { + //不是一级科目 + billingRulesDO.setFirstSubjectName(expenseAccountPO.getUpperSubject()); + billingRulesDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode()); + billingRulesDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode()); + billingRulesDO.setSecondSubjectName(expenseAccountPO.getSubjectName()); + } + } + } + } + + /** + * 修改计费规则 + */ + public Boolean update(BillingRulesDO billingRulesDO) { + return billingRulesService.update(billingRulesDO); + } + + /** + * 批量删除计费规则 + */ + public Boolean delete(Long[] billingRulesIds) { + return billingRulesService.delete(billingRulesIds); + } + + /** + * 获取计费规则详细信息 + */ + public BillingRulesPO getInfo(Long billingRulesId) + { + return billingRulesService.getInfo(billingRulesId); + } + + + public BillingRulesPO getInfoByCode(String billingRulesCode) { + BillingRulesPO billingRulesPO = new BillingRulesPO(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BillingRules::getBillingRulesCode, billingRulesCode); + queryWrapper.eq(BillingRules::getDelFlag, 1); + BillingRules billingRules = billingRulesService.getOne(queryWrapper); + if(billingRules != null){ + BeanUtils.copyProperties(billingRules, billingRulesPO); + return billingRulesPO; + } + return null; + } + + /** + * 修改计费规则状态 + */ + public Boolean changeStates(BillingRulesDTO billingRulesDTO) { + if(billingRulesDTO.getBillingRulesState() ==null || (billingRulesDTO.getBillingRulesState() != 1 && billingRulesDTO.getBillingRulesState() != 2)){ + throw new ServiceException("操作类型错误"); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(BillingRules::getBillingRulesId,billingRulesDTO.getBillingRulesId()); + updateWrapper.eq(BillingRules::getDelFlag,1); + updateWrapper.set(BillingRules::getBillingRulesState,billingRulesDTO.getBillingRulesState()); + return billingRulesService.update(updateWrapper); + } + + + /** + * 根据id查询计费规则信息 + */ + public BillingRulesPO getInfoById(Long billingRulesId) { + BillingRulesPO billingRulesPO = billingRulesService.getInfo(billingRulesId); + if(null == billingRulesPO){ + throw new ServiceException("计费规则信息未找到"); + } + //查询计费参数明细列表 + List billingParamsPOList = billingParamsService.queryListByRulesId(billingRulesId); + billingRulesPO.setBillingParamsPOList(billingParamsPOList); + return billingRulesPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java new file mode 100644 index 000000000..0fca54ae5 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/entity/BillingStatement.java @@ -0,0 +1,192 @@ +package com.mhd.bms.domain.billingStatement.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 计费流水对象 billing_statement + * + * @author gen + * @date 2024-06-26 + */ + +@Data +public class BillingStatement extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + @TableId(type = IdType.AUTO) + private Long billingStatementId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id", readConverterExp = "服=务项") + private Long serviceItemsManageId; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("流水金额") + @Excel(name = "流水金额") + private BigDecimal billingAmount; + + @ApiModelProperty("收支类型(1-应收,2-应付)") + @Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付") + private Integer accountExpenseType; + + @ApiModelProperty("流水备注") + @Excel(name = "流水备注") + private String billingRemark; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String originalBusinessNum; + + @ApiModelProperty("业务流水号") + @Excel(name = "业务流水号") + private String businessFlow; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)") + @Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废") + private Integer billingState; + + @ApiModelProperty("红冲状态(1-未红冲,2-已红冲)") + @Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲") + private Integer redFlushState; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("红冲原因") + @Excel(name = "红冲原因") + private String redFlushRemark; + + @ApiModelProperty("合同类型(1-仓储,2-运输)") + private Integer contractType; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/facade/IBillingStatementService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/facade/IBillingStatementService.java new file mode 100644 index 000000000..029535d4a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/facade/IBillingStatementService.java @@ -0,0 +1,59 @@ +package com.mhd.bms.domain.billingStatement.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; + +import java.util.List; + +/** + * 计费流水Service接口 + * + * @author gen + * @date 2024-06-26 + */ +public interface IBillingStatementService extends IService +{ + /** + * 分页查询计费流水列表 + */ + public List queryList(BillingStatementDO billingStatementDO); + + /** + * 查询出账汇总 + */ + public List queryCollectList(BillingStatementCollectDO billingStatementCollectDO); + + /** + * 查询出账详情 + */ + public List queryDetails(BillingStatementCollectDO bdo); + + /** + * 新增计费流水 + */ + public Boolean insert(BillingStatementDO billingStatementDO); + + /** + * 修改计费流水 + */ + public Boolean update(BillingStatementDO billingStatementDO); + + /** + * 批量删除计费流水 + */ + public Boolean delete(Long[] billingStatementIds); + + + /** + * 查询计费流水 + */ + public BillingStatementPO getInfo(Long billingStatementId); + + List queryPaymentOutList(BillingStatementDO billingStatementDO); + + List getDetailsByManageId(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/mapper/BillingStatementMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/mapper/BillingStatementMapper.java new file mode 100644 index 000000000..f9541d496 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/mapper/BillingStatementMapper.java @@ -0,0 +1,45 @@ +package com.mhd.bms.domain.billingStatement.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import org.apache.ibatis.annotations.Param; +/** + * 计费流水Mapper接口 + * + * @author gen + * @date 2024-06-26 + */ +public interface BillingStatementMapper extends BaseMapper +{ + /** + * 查询计费流水列表 + */ + public List queryList(@Param("billingStatementDO") BillingStatementDO billingStatementDO); + + + /** + * 查询出账汇总 + */ + public List queryCollectList(@Param("billingStatementCollectDO") BillingStatementCollectDO billingStatementCollectDO); + + /** + * 查询出账详情 + */ + public List queryDetails(@Param("bdo") BillingStatementCollectDO bdo); + + + /** + * 查询批量出账列表 + */ + List queryPaymentOutList(@Param("billingStatementDO") BillingStatementDO billingStatementDO); + + /** + * 根据账单id,查询流水明细列表 + */ + List getDetailsByManageId(@Param("billManageId") Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/persistence/BillingStatementImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/persistence/BillingStatementImpl.java new file mode 100644 index 000000000..9fe4a5dbd --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/persistence/BillingStatementImpl.java @@ -0,0 +1,109 @@ +package com.mhd.bms.domain.billingStatement.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.repository.facade.IBillingStatementService; +import com.mhd.bms.domain.billingStatement.repository.mapper.BillingStatementMapper; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 计费流水Service业务层处理 + * + * @author gen + * @date 2024-06-26 + */ +@Service +public class BillingStatementImpl extends ServiceImpl implements IBillingStatementService{ + @Autowired + private BillingStatementMapper billingStatementMapper; + + /** + * 查询计费流水列表 + */ + @Override + public List queryList(BillingStatementDO billingStatementDO) + { + return billingStatementMapper.queryList(billingStatementDO); + } + + @Override + public List queryCollectList(BillingStatementCollectDO billingStatementCollectDO) { + return billingStatementMapper.queryCollectList(billingStatementCollectDO); + } + + @Override + public List queryDetails(BillingStatementCollectDO bdo) { + return billingStatementMapper.queryDetails(bdo); + } + + /** + * 新增计费流水 + */ + @Override + public Boolean insert(BillingStatementDO billingStatementDO) { + BillingStatement billingStatement = new BillingStatement(); + BeanUtils.copyProperties(billingStatementDO,billingStatement); + return this.save(billingStatement); + } + + /** + * 修改计费流水 + */ + @Override + public Boolean update(BillingStatementDO billingStatementDO) { + BillingStatement billingStatement = new BillingStatement(); + BeanUtils.copyProperties(billingStatementDO,billingStatement); + return this.updateById(billingStatement); + } + + /** + * 批量删除计费流水 + */ + @Override + public Boolean delete(Long[] billingStatementIds ) { + List list = new ArrayList<>(); + for (Long id : billingStatementIds) { + BillingStatement billingStatement = new BillingStatement(); + billingStatement.setBillingStatementId(id); + billingStatement.setDelFlag(2); + list.add(billingStatement); + } + return this.updateBatchById(list); + } + + /** + * 修改计费流水 + */ + @Override + public BillingStatementPO getInfo(Long billingStatementId) { + BillingStatement billingStatement = this.getById(billingStatementId); + BillingStatementPO billingStatementPO = new BillingStatementPO(); + BeanUtils.copyProperties(billingStatement,billingStatementPO); + return billingStatementPO; + } + + /** + * 查询批量出账列表 + */ + @Override + public List queryPaymentOutList(BillingStatementDO billingStatementDO) { + return billingStatementMapper.queryPaymentOutList(billingStatementDO); + } + + /** + * 根据账单id,查询流水明细列表 + */ + @Override + public List getDetailsByManageId(Long billManageId) { + return billingStatementMapper.getDetailsByManageId(billManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementCollectPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementCollectPO.java new file mode 100644 index 000000000..fafe240b9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementCollectPO.java @@ -0,0 +1,68 @@ +package com.mhd.bms.domain.billingStatement.repository.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class BillingStatementCollectPO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("结算对象") + private String settlementEntity; + + @ApiModelProperty("结算代码") + private String settlementCustomersCode; + + @ApiModelProperty("费用总额") + private BigDecimal billAmountSum; + + @ApiModelProperty("应收汇总") + private BigDecimal receivable; + + @ApiModelProperty("应付汇总") + private BigDecimal feesPayable; + + @ApiModelProperty("费用类型") + private Integer accountExpenseType; + + @ApiModelProperty("流水数量") + private Integer countFee; + + @ApiModelProperty("创建时间从") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessStartDate; + + @ApiModelProperty("创建时间至") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessEndDate; + + @ApiModelProperty("所属组织") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("出账状态") + private Integer billingState; + + @ApiModelProperty("合同类型") + @Excel(name = "合同类型") + private String contractType; + + @ApiModelProperty("流水状态拼接(统计使用)") + private String billingStateCount; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java new file mode 100644 index 000000000..dc94bc194 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/po/BillingStatementPO.java @@ -0,0 +1,199 @@ +package com.mhd.bms.domain.billingStatement.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 计费流水对象 billing_statement + * + * @author gen + * @date 2024-06-26 + */ + +@Data +@ApiModel(value = "计费流水对象", description = "计费流水响应对象") +public class BillingStatementPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id", readConverterExp = "服=务项") + private Long serviceItemsManageId; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("流水金额") + @Excel(name = "流水金额") + private BigDecimal billingAmount; + + @ApiModelProperty("收支类型(1-应收,2-应付)") + @Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付") + private Integer accountExpenseType; + + @ApiModelProperty("流水备注") + @Excel(name = "流水备注") + private String billingRemark; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String originalBusinessNum; + + @ApiModelProperty("业务流水号") + @Excel(name = "业务流水号") + private String businessFlow; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)") + @Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废") + private Integer billingState; + + @ApiModelProperty("红冲状态(1-未红冲,2-已红冲)") + @Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲") + private Integer redFlushState; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("红冲原因") + @Excel(name = "红冲原因") + private String redFlushRemark; + + @ApiModelProperty("合同类型(1-仓储,2-运输)") + private Integer contractType; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; + + @ApiModelProperty("费用总额") + private BigDecimal billingTotalAmount; + + @ApiModelProperty("账单优惠金额") + private BigDecimal billingDiscountAmount; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementCollectDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementCollectDO.java new file mode 100644 index 000000000..1537b16b1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementCollectDO.java @@ -0,0 +1,58 @@ +package com.mhd.bms.domain.billingStatement.repository.todo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class BillingStatementCollectDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("结算对象") + private String settlementEntity; + + @ApiModelProperty("结算代码") + private String settlementCustomersCode; + + @ApiModelProperty("费用总额") + private BigDecimal billAmountSum; + + @ApiModelProperty("费用类型") + private Integer accountExpenseType; + + @ApiModelProperty("流水数量") + private Integer countFee; + + @ApiModelProperty("创建时间从") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessStartDate; + + @ApiModelProperty("创建时间至") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessEndDate; + + @ApiModelProperty("所属组织") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("出账状态") + private Integer billingState; + + @ApiModelProperty("合同类型") + @Excel(name = "合同类型") + private String contractType; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java new file mode 100644 index 000000000..8bae187a7 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/repository/todo/BillingStatementDO.java @@ -0,0 +1,224 @@ +package com.mhd.bms.domain.billingStatement.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; +import java.util.Set; + + +/** + * 计费流水对象 billing_statement + * + * @author gen + * @date 2024-06-26 + */ + +@Data +public class BillingStatementDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id", readConverterExp = "服=务项") + private Long serviceItemsManageId; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("流水金额") + @Excel(name = "流水金额") + private BigDecimal billingAmount; + + @ApiModelProperty("收支类型(1-应收,2-应付)") + @Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付") + private Integer accountExpenseType; + + @ApiModelProperty("流水备注") + @Excel(name = "流水备注") + private String billingRemark; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String originalBusinessNum; + + @ApiModelProperty("业务流水号") + @Excel(name = "业务流水号") + private String businessFlow; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)") + @Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废") + private Integer billingState; + + @ApiModelProperty("红冲状态(1-未红冲,2-已红冲)") + @Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲") + private Integer redFlushState; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("红冲原因") + @Excel(name = "红冲原因") + private String redFlushRemark; + + @ApiModelProperty("查询状态(1-未出账,2-已出账,3-其他)") + private Integer queryState; + + @ApiModelProperty("合同类型(1-仓储,2-运输)") + private Integer contractType; + + @ApiModelProperty(name = "计费周期查询条件开始日期") + private String businessDateStart; + @ApiModelProperty(name = "计费周期查询条件结束日期") + private String businessDateEnd; + + @ApiModelProperty("计费流水ids") + private String billingStatementIds; + + @ApiModelProperty("计费流水ids") + private Set billingStatementIdSet; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/service/BillingStatementDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/service/BillingStatementDomainService.java new file mode 100644 index 000000000..c475a664d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/billingStatement/service/BillingStatementDomainService.java @@ -0,0 +1,511 @@ +package com.mhd.bms.domain.billingStatement.service; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.billManage.repository.facade.IBillManageService; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.billingStatement.entity.BillingStatement; +import com.mhd.bms.domain.billingStatement.repository.facade.IBillingStatementService; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.infrastructure.feign.vo.ContractManageDetailPO; +import com.mhd.bms.infrastructure.feign.vo.ContractManagePO; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static com.mhd.common.core.utils.PageUtils.startPage; + +/** + * 计费流水 + * + * @author gen + * @date 2024-06-26 + */ +@Service +@Slf4j +public class BillingStatementDomainService { + + @Autowired + private IBillingStatementService billingStatementService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private BillManageDomainService billManageDomainService; + @Autowired + private IBillManageService billManageService; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + @Autowired + private IBusinessDocumentService businessDocumentService; + + + /** + * 分页查询计费流水列表 + */ + public List queryList(BillingStatementDO billingStatementDO) { + return billingStatementService.queryList(billingStatementDO); + } + + /** + * 查询出账汇总 + */ + public List queryCollectList(BillingStatementCollectDO billingStatementCollectDO){ + return billingStatementService.queryCollectList(billingStatementCollectDO); + } + + /** + * 查询出账详情 + */ + public List queryDetails(BillingStatementCollectDO bdo) { + return billingStatementService.queryDetails(bdo); + } + /** + * 新增计费流水 + */ + public Boolean insert(BillingStatementDO billingStatementDO) { + + return billingStatementService.insert(billingStatementDO); + } + + /** + * 修改计费流水 + */ + public Boolean update(BillingStatementDO billingStatementDO) { + return billingStatementService.update(billingStatementDO); + } + + /** + * 批量删除计费流水 + */ + public Boolean delete(Long[] billingStatementIds) { + return billingStatementService.delete(billingStatementIds); + } + + /** + * 获取计费流水详细信息 + */ + public BillingStatementPO getInfo(Long billingStatementId) + { + return billingStatementService.getInfo(billingStatementId); + } + + /** + * 批量审核 + */ + public Boolean reviewBilling(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List billingStatements = new ArrayList<>(); + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + for (String billingId : billingSet) { + Long billingStatementId = Long.valueOf(billingId); + BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId); + if(null == billingStatementPO){ + throw new ServiceException("流水不存在"); + } + if(billingStatementPO.getBillingState()!=1){ + throw new ServiceException("该计费流水状态不为待审核,不能进行审核"); + } + if(billingStatementPO.getRedFlushState()==2){ + throw new ServiceException("计费流水"+ billingStatementPO.getBillingFlow() +"已红冲,不能进行审核"); + } + BillingStatement billingStatement = new BillingStatement(); + billingStatement.setBillingStatementId(billingStatementId); + billingStatement.setReviewRemarks(billingStatementDTO.getReviewRemarks()); + if(billingStatementDTO.getAuditOperation()==1){ + //审核通过 + billingStatement.setBillingState(2); + }else { + //审核不通过 + billingStatement.setBillingState(4); + //计费流水审核不通过时,修改业务单据中的状态到已生效 + BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO(); + businessDocumentDO.setBusinessDocumentId(billingStatementPO.getBusinessDocumentId()); + businessDocumentDO.setBusinessState(2); + businessDocumentService.update(businessDocumentDO); + } + billingStatement.setUpdateTime(new Date()); + billingStatement.setUpdateBy(loginUser.getUserPo().getUserId()); + billingStatement.setUpdateByName(loginUser.getUserPo().getUserName()); + billingStatements.add(billingStatement); + } + return billingStatementService.updateBatchById(billingStatements); + } + + + /** + * 批量红冲 + */ + public Boolean redFlushBilling(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //只有手工录入流水才可以进行红冲操作 + + List billingStatements = new ArrayList<>(); + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + for (String billingId : billingSet) { + Long billingStatementId = Long.valueOf(billingId); + BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId); + if(null == billingStatementPO){ + throw new ServiceException("流水不存在"); + } + if(billingStatementPO.getDataSources()!=2){ + throw new ServiceException("非手工录入流水,不可进行红冲操作"); + } + //如果流水已出账,则不允许红冲 + if(billingStatementPO.getBillingState()==3){ + throw new ServiceException("计费流水"+ billingStatementPO.getBillingFlow() +"已出账,无法进行红冲操作"); + } + BillingStatement billingStatement = new BillingStatement(); + billingStatement.setBillingStatementId(billingStatementId); + billingStatement.setRedFlushRemark(billingStatementDTO.getRedFlushRemark()); + billingStatement.setRedFlushState(2); + billingStatements.add(billingStatement); + } + return billingStatementService.updateBatchById(billingStatements); + + } + + /** + * 校验所选流水是否是唯一主体 + * @param billingStatementIds + */ + public void checkUniqueEntity(String billingStatementIds) { + Set billingSet = Stream.of(billingStatementIds.split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillingStatement::getBillingStatementId,billingSet); + queryWrapper.eq(BillingStatement::getDelFlag,1); + List billingStatementList = billingStatementService.list(queryWrapper); + if(null == billingStatementList){ + throw new ServiceException("所选流水信息未找到,请刷新后重试"); + } + if(billingStatementList.size()!=billingSet.size()){ + throw new ServiceException("所选流水信息未找到,请刷新后重试"); + } + //判断流水状态如果不是已审核的状态则不能生成账单 + long billingStateSet = billingStatementList.stream().filter(item -> item.getBillingState()!=2).count(); + if(billingStateSet>0){ + throw new ServiceException("所选流水状态不是已审核状态,请刷新后重试"); + } + //判断流水状态是否已经红冲 + long redFlushStateSet = billingStatementList.stream().filter(item -> item.getRedFlushState()==2).count(); + if(redFlushStateSet > 0){ + throw new ServiceException("所选流水状态不是未红冲状态,不能进行审核"); + } + + //校验结算对象是否一致 + Set settlementCustomersIdSet = billingStatementList.stream().map(BillingStatement::getSettlementCustomersId).collect(Collectors.toSet()); + if(settlementCustomersIdSet.size()!=1){ + throw new ServiceException("所选流水结算对象不一致,请刷新后重试"); + } + //校验来源系统是否一致 + Set belongModuleCodeSet = billingStatementList.stream().map(BillingStatement::getBelongModuleCode).collect(Collectors.toSet()); + if(belongModuleCodeSet.size()!=1){ + throw new ServiceException("所选流水来源系统不一致,请刷新后重试"); + } + //校验收支类型是否一致 + Set accountExpenseTypeSet = billingStatementList.stream().map(BillingStatement::getAccountExpenseType).collect(Collectors.toSet()); + if(accountExpenseTypeSet.size()!=1){ + throw new ServiceException("所选流水收支类型不一致,请刷新后重试"); + } + //校验组织是否一致 + Set organizationIdSet = billingStatementList.stream().map(BillingStatement::getOrganizationId).collect(Collectors.toSet()); + if(organizationIdSet.size()!=1){ + throw new ServiceException("所选流水组织不一致,请刷新后重试"); + } + } + + /** + * 修改流水状态 + * @param billingStatementDTO + */ + public Boolean updateBillingState(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillingStatement::getBillingStatementId,billingSet); + + updateWrapper.set(BillingStatement::getBillingState,billingStatementDTO.getBillingState()); + updateWrapper.set(BillingStatement::getUpdateBy,loginUser.getUserPo().getUserId()); + updateWrapper.set(BillingStatement::getUpdateTime,new Date()); + updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName()); + + return billingStatementService.update(updateWrapper); + } + + + public Boolean nullifyByIds(BillingStatementDTO billingStatementDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //只有待审核状态的记录可以作废 + List billingStatements = new ArrayList<>(); + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + for (String billingId : billingSet) { + Long billingStatementId = Long.valueOf(billingId); + BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId); + if(null == billingStatementPO){ + throw new ServiceException("流水不存在"); + } + if(billingStatementPO.getBillingState()!=1){ + throw new ServiceException("非待审核状态,不可进行作废操作"); + } + BillingStatement billingStatement = new BillingStatement(); + billingStatement.setBillingStatementId(billingStatementId); + billingStatement.setBillingState(5); + billingStatements.add(billingStatement); + } + return billingStatementService.updateBatchById(billingStatements); + } + + /** + * 查询批量出账列表 + */ + public List queryPaymentOutList(BillingStatementDO billingStatementDO) { + //只查询流水状态为已审核的 + billingStatementDO.setBillingState(2); + billingStatementDO.setRedFlushState(1); + return billingStatementService.queryPaymentOutList(billingStatementDO); + } + + /** + * 校验是否可以生成账单 + */ + public boolean checkGenerateBills(BillingStatementDTO billingStatementDTO) { + Set billingStatementIds = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillingStatement::getBillingStatementId,billingStatementIds); + queryWrapper.eq(BillingStatement::getDelFlag,1); + List billingStatementList = billingStatementService.list(queryWrapper); + if(billingStatementList ==null || billingStatementList.size()==0){ + return false; + } + //校验流水状态是否都是已审核状态,如果不是则返回false + Set billingStateSet = billingStatementList.stream().map(BillingStatement::getBillingState).collect(Collectors.toSet()); + if(billingStateSet.size()==1 && billingStateSet.contains(2)){ + return true; + } + //校验红冲状态是否都是未红冲,如果不是返回false + Set redFlushStateSet = billingStatementList.stream().map(BillingStatement::getRedFlushState).collect(Collectors.toSet()); + if(redFlushStateSet.size()==1 && redFlushStateSet.contains(1)){ + return true; + } + return false; + } + + + /** + * 批量生成账单 + */ + public void batchGenerateBills(BillingStatementDTO billingStatementDTO) { + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + BillingStatementDO billingStatementDO = new BillingStatementDO(); + billingStatementDO.setBillingStatementIdSet(billingSet); + List billingStatementPOS = billingStatementService.queryList(billingStatementDO); + //判断流水状态如果不是已审核的状态则不能生成账单 + long billingStateSet = billingStatementPOS.stream().filter(item -> item.getBillingState()!=2).count(); + if(billingStateSet>0){ + throw new ServiceException("所选流水状态含有非已审核状态,请刷新后重试"); + } + //将billingStatementPOS集合按照组织表ID、结算对象code、收支类型、对接系统编码进行分组,将结算对象code作为key,四个条件有一个不同则视为不同的分组 + Map> billingStatementPOSMap = billingStatementPOS.stream().collect(Collectors.groupingBy(billingStatementPO -> billingStatementPO.getOrganizationId()+"_"+billingStatementPO.getSettlementCustomersCode()+"_"+billingStatementPO.getAccountExpenseType()+"_"+billingStatementPO.getBelongModuleCode())); + //遍历集合分别生成账单 + billingStatementPOSMap.forEach((key,value)->{ + final String billingRemark = billingStatementDTO.getBillingRemark(); + final Date billCreateTime = billingStatementDTO.getBillCreateTime(); + if(value.size()>0){ + //生成账单 + billManageDomainService.saveBill(value,billingRemark,billCreateTime); + } + }); + //修改流水状态 + billingStatementDTO.setBillingState(3); + updateBillingState(billingStatementDTO); + } + + /** + * 生成流水 + */ + public Boolean generateFlow(BusinessDocumentPO businessDocumentPO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + BillingStatementDO billingStatementDO = new BillingStatementDO(); + String[] ignroreFields = new String[]{"billingStatementId","dataSources","createBy","createByName","createTime","updateBy","updateByName","updateTime"}; + BeanUtils.copyProperties(businessDocumentPO,billingStatementDO,ignroreFields); + billingStatementDO.setBusinessDocumentId(businessDocumentPO.getBusinessDocumentId()); + billingStatementDO.setBusinessDate(businessDocumentPO.getCreateTime()); + billingStatementDO.setBillingAmount(businessDocumentPO.getBillAmount()); + billingStatementDO.setBillingState(1); + billingStatementDO.setDataSources(1); + billingStatementDO.setCreateBy(loginUser.getUserPo().getUserId()); + billingStatementDO.setCreateByName(loginUser.getUserPo().getUserName()); + billingStatementDO.setCreateTime(new Date()); + billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow()); + billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + //处理数据 + handleData(billingStatementDO); + return this.insert(billingStatementDO); + } + + /** + * 处理生成收支流水数据 + * @param billingStatementDO + */ + private void handleData(BillingStatementDO billingStatementDO) { + //查询合同信息,赋值合同周期信息 + if(StringUtils.isNotEmpty(billingStatementDO.getContractNumber())){ + AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(billingStatementDO.getContractNumber()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + ContractManagePO contractManagePO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class); + if(null != contractManagePO){ + //取值合同详情,对比费用科目,取值计费周期 + if(contractManagePO.getContractManageDetailPOList()!=null && contractManagePO.getContractManageDetailPOList().size()>0){ + List contractManageDetailPOList = contractManagePO.getContractManageDetailPOList(); + String subjectCode = !StringUtils.isNotEmpty(billingStatementDO.getSecondSubjectCode()) ? billingStatementDO.getFirstSubjectCode() : billingStatementDO.getSecondSubjectCode(); + Date cycleBeginTime = null; + Date cycleEndTime = null; + for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOList) { + String subjectCodeContract = !StringUtils.isNotEmpty(contractManageDetailPO.getSecondSubjectCode()) ? contractManageDetailPO.getFirstSubjectCode() : contractManageDetailPO.getSecondSubjectCode(); + if(subjectCodeContract.equals(subjectCode)){ + Date businessDate = billingStatementDO.getBusinessDate(); + //根据不同类型获取计费周期 + if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"1") || ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"4")){ + //实时计费、按天计费,赋值为当天 + cycleBeginTime = businessDate; + cycleEndTime = businessDate; + }else if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"2")){ + //按账期计费 + cycleBeginTime = businessDate; + cycleEndTime = contractManagePO.getPaymentDate(); + }else if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"3")){ + //按周计费,用businessDate往后推一周的日期 + cycleBeginTime = businessDate; + cycleEndTime = DateUtil.offsetWeek(businessDate,1); + } + break; + } + } + billingStatementDO.setCycleBeginTime(cycleBeginTime); + billingStatementDO.setCycleEndTime(cycleEndTime); + } + billingStatementDO.setContractType(contractManagePO.getContractType()); + } + } + } + //根据结算对象获取收支类型 + if(StringUtils.isNotEmpty(billingStatementDO.getSettlementCustomersCode())){ + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(billingStatementDO.getSettlementCustomersCode()); + if(null != settlementCustomers){ + if(settlementCustomers.getMainRole()==1){ + billingStatementDO.setAccountExpenseType(1); + }else { + billingStatementDO.setAccountExpenseType(2); + } + } + } + } + + + /** + * 账单作废,流水状态回滚 + * @param billingStatementIds + * @return + */ + public Boolean billNullify(Set billingStatementIds) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(BillingStatement::getBillingStatementId, billingStatementIds) + .set(BillingStatement::getBillingState, 2) + .set(BillingStatement::getUpdateBy, loginUser.getUserPo().getUserId()) + .set(BillingStatement::getUpdateByName, loginUser.getUserPo().getUserName()) + .set(BillingStatement::getUpdateTime, new Date()); + + return billingStatementService.update(updateWrapper); + } + + + public Long insertAndReturnId(BillingStatementDO billingStatementDO) { + BillingStatement billingStatement = new BillingStatement(); + BeanUtils.copyProperties(billingStatementDO,billingStatement); + billingStatementService.save(billingStatement); + return billingStatement.getBillingStatementId(); + } + + /** + * 应收账单-添加明细 + */ + public List getBillDetailsList(BillingStatementDO billingStatementDO) { + //查询当前账单的五大信息:组织信息、结算对象、来源系统、收支类型、账单周期 + BillManagePO billManagePO = billManageDomainService.getInfo(billingStatementDO.getBillManageId()); + if(null == billManagePO){ + throw new ServiceException("账单信息未找到"); + } + billingStatementDO.setSettlementCustomersCode(billManagePO.getSettlementCustomersCode()); + billingStatementDO.setBelongModuleCode(billManagePO.getBelongModuleCode()); + billingStatementDO.setAccountExpenseType(billManagePO.getBillType()); + billingStatementDO.setCycleBeginTime(billManagePO.getCycleBeginTime()); + billingStatementDO.setCycleEndTime(billManagePO.getCycleEndTime()); + billingStatementDO.setBillingState(2); + startPage(); + return billingStatementService.queryList(billingStatementDO); + } + + /** + * 根据账单id,查询流水明细列表 + * @param billManageId + * @return + */ + public List getDetailsByManageId(Long billManageId) { + return billingStatementService.getDetailsByManageId(billManageId); + } + + /** + * 流水综合报表 + */ + public List comprehensiveList(QueryWrapper queryWrapper) { + return billingStatementService.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java new file mode 100644 index 000000000..0d0d0ad90 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/entity/BusinessDocument.java @@ -0,0 +1,173 @@ +package com.mhd.bms.domain.businessDocument.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 业务单据对象 business_document + * + * @author gen + * @date 2024-06-21 + */ + +@Data +public class BusinessDocument extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("业务单据记录id") + @TableId(type = IdType.AUTO) + private Long businessDocumentId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("业务流水") + @Excel(name = "业务流水") + private String businessFlow; + + @ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + @Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + private Integer businessState; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("预计费金额") + @Excel(name = "预计费金额") + private BigDecimal estimatedCost; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("计费时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date billingTime; + + @ApiModelProperty("单据表单json数据") + @Excel(name = "单据表单json数据") + private String documentFormJson; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id", readConverterExp = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id", readConverterExp = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("原始流水号") + @Excel(name = "原始流水号") + private String originalSerialNumber; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id(服务项)") + private Long serviceItemsManageId; + + @ApiModelProperty("单据备注") + @Excel(name = "单据备注") + private String remark; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/facade/IBusinessDocumentService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/facade/IBusinessDocumentService.java new file mode 100644 index 000000000..d45a8c0d9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/facade/IBusinessDocumentService.java @@ -0,0 +1,45 @@ +package com.mhd.bms.domain.businessDocument.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; + +import java.util.List; + +/** + * 业务单据Service接口 + * + * @author gen + * @date 2024-06-21 + */ +public interface IBusinessDocumentService extends IService +{ + /** + * 分页查询业务单据列表 + */ + public List queryList(BusinessDocumentDO businessDocumentDO); + + /** + * 新增业务单据 + */ + public Boolean insert(BusinessDocumentDO businessDocumentDO); + + /** + * 修改业务单据 + */ + public Boolean update(BusinessDocumentDO businessDocumentDO); + + /** + * 批量删除业务单据 + */ + public Boolean delete(Long[] businessDocumentIds); + + + /** + * 查询业务单据 + */ + public BusinessDocumentPO getInfo(Long businessDocumentId); + + BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(String originalBusinessNum, String secondSubjectCode); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/mapper/BusinessDocumentMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/mapper/BusinessDocumentMapper.java new file mode 100644 index 000000000..1688bc0ac --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/mapper/BusinessDocumentMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.businessDocument.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import org.apache.ibatis.annotations.Param; +/** + * 业务单据Mapper接口 + * + * @author gen + * @date 2024-06-21 + */ +public interface BusinessDocumentMapper extends BaseMapper +{ + /** + * 查询业务单据列表 + */ + public List queryList(@Param("businessDocumentDO") BusinessDocumentDO businessDocumentDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/persistence/BusinessDocumentImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/persistence/BusinessDocumentImpl.java new file mode 100644 index 000000000..e5acd00d1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/persistence/BusinessDocumentImpl.java @@ -0,0 +1,96 @@ +package com.mhd.bms.domain.businessDocument.repository.persistence; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; +import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService; +import com.mhd.bms.domain.businessDocument.repository.mapper.BusinessDocumentMapper; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 业务单据Service业务层处理 + * + * @author gen + * @date 2024-06-21 + */ +@Service +public class BusinessDocumentImpl extends ServiceImpl implements IBusinessDocumentService{ + @Autowired + private BusinessDocumentMapper businessDocumentMapper; + + /** + * 查询业务单据列表 + */ + @Override + public List queryList(BusinessDocumentDO businessDocumentDO) + { + return businessDocumentMapper.queryList(businessDocumentDO); + } + + /** + * 新增业务单据 + */ + @Override + public Boolean insert(BusinessDocumentDO businessDocumentDO) { + BusinessDocument businessDocument = new BusinessDocument(); + BeanUtils.copyProperties(businessDocumentDO,businessDocument); + return this.save(businessDocument); + } + + /** + * 修改业务单据 + */ + @Override + public Boolean update(BusinessDocumentDO businessDocumentDO) { + BusinessDocument businessDocument = new BusinessDocument(); + BeanUtils.copyProperties(businessDocumentDO,businessDocument); + return this.updateById(businessDocument); + } + + /** + * 批量删除业务单据 + */ + @Override + public Boolean delete(Long[] businessDocumentIds ) { + List list = new ArrayList<>(); + for (Long id : businessDocumentIds) { + BusinessDocument businessDocument = new BusinessDocument(); + businessDocument.setBusinessDocumentId(id); + businessDocument.setDelFlag(2); + list.add(businessDocument); + } + return this.updateBatchById(list); + } + + /** + * 修改业务单据 + */ + @Override + public BusinessDocumentPO getInfo(Long businessDocumentId) { + BusinessDocument businessDocument = this.getById(businessDocumentId); + BusinessDocumentPO businessDocumentPO = new BusinessDocumentPO(); + BeanUtils.copyProperties(businessDocument,businessDocumentPO); + return businessDocumentPO; + } + + /** + * 根据原始业务单号和费用科目code查询 + */ + @Override + public BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(String originalBusinessNum, String secondSubjectCode) { + BusinessDocumentPO businessDocumentPO = new BusinessDocumentPO(); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(BusinessDocument::getOriginalBusinessNum,originalBusinessNum); + lambdaQueryWrapper.eq(BusinessDocument::getSecondSubjectCode,secondSubjectCode).or().eq(BusinessDocument::getFirstSubjectCode,secondSubjectCode); + BusinessDocument businessDocument = this.getOne(lambdaQueryWrapper); + BeanUtils.copyProperties(businessDocument,businessDocumentPO); + return businessDocumentPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java new file mode 100644 index 000000000..078c3dfb3 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/po/BusinessDocumentPO.java @@ -0,0 +1,177 @@ +package com.mhd.bms.domain.businessDocument.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 业务单据对象 business_document + * + * @author gen + * @date 2024-06-21 + */ + +@Data +@ApiModel(value = "业务单据对象", description = "业务单据响应对象") +public class BusinessDocumentPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("业务流水") + @Excel(name = "业务流水") + private String businessFlow; + + @ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + @Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + private Integer businessState; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("预计费金额") + @Excel(name = "预计费金额") + private BigDecimal estimatedCost; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("计费时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date billingTime; + + @ApiModelProperty("单据表单json数据") + @Excel(name = "单据表单json数据") + private String documentFormJson; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id", readConverterExp = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id", readConverterExp = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("原始流水号") + @Excel(name = "原始流水号") + private String originalSerialNumber; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id(服务项)") + private String serviceItemsManageId; + + @ApiModelProperty("单据备注") + @Excel(name = "单据备注") + private String remark; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("重算金额") + private BigDecimal recalculateCost; + + @ApiModelProperty("重算失败原因") + private String recalculateCostFailRemark; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java new file mode 100644 index 000000000..3e8132859 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/repository/todo/BusinessDocumentDO.java @@ -0,0 +1,197 @@ +package com.mhd.bms.domain.businessDocument.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Set; + + +/** + * 业务单据对象 business_document + * + * @author gen + * @date 2024-06-21 + */ + +@Data +public class BusinessDocumentDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("业务流水") + @Excel(name = "业务流水") + private String businessFlow; + + @ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + @Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + private Integer businessState; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("预计费金额") + @Excel(name = "预计费金额") + private BigDecimal estimatedCost; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("计费时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date billingTime; + + @ApiModelProperty("单据表单json数据") + @Excel(name = "单据表单json数据") + private String documentFormJson; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("业务单据记录ids") + private String businessDocumentIds; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id", readConverterExp = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id", readConverterExp = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("原始流水号") + @Excel(name = "原始流水号") + private String originalSerialNumber; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id(服务项)") + private Long serviceItemsManageId; + + @ApiModelProperty("单据备注") + @Excel(name = "单据备注") + private String remark; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty(name = "业务单据记录id集合") + private Set businessDocumentIdSet; + + @ApiModelProperty("结算主体id") + private Long settlementEntityId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/service/BusinessDocumentDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/service/BusinessDocumentDomainService.java new file mode 100644 index 000000000..40e1db575 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/businessDocument/service/BusinessDocumentDomainService.java @@ -0,0 +1,196 @@ +package com.mhd.bms.domain.businessDocument.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.businessDocument.entity.BusinessDocument; +import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +/** + * 业务单据 + * + * @author gen + * @date 2024-06-21 + */ +@Service +@Slf4j +public class BusinessDocumentDomainService { + + @Autowired + private IBusinessDocumentService businessDocumentService; + + + /** + * 分页查询业务单据列表 + */ + public List queryList(BusinessDocumentDO businessDocumentDO) { + return businessDocumentService.queryList(businessDocumentDO); + } + + + /** + * 新增业务单据 + */ + public Boolean insert(BusinessDocumentDO businessDocumentDO) { + + return businessDocumentService.insert(businessDocumentDO); + } + + /** + * 修改业务单据 + */ + public Boolean update(BusinessDocumentDO businessDocumentDO) { + return businessDocumentService.update(businessDocumentDO); + } + + /** + * 批量删除业务单据 + */ + public Boolean delete(Long[] businessDocumentIds) { + return businessDocumentService.delete(businessDocumentIds); + } + + /** + * 获取业务单据详细信息 + */ + public BusinessDocumentPO getInfo(Long businessDocumentId) + { + return businessDocumentService.getInfo(businessDocumentId); + } + + + /** + * 根据id删除业务单据信息 + */ + public Boolean deleteByIds(List businessDocumentIdLongList) { + if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(BusinessDocument::getDelFlag,2); + updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList); + return businessDocumentService.update(updateWrapper); + } + return false; + } + + /** + * 根据id作废业务单据信息 + */ + public Boolean nullifyByIds(List businessDocumentIdLongList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(BusinessDocument::getBusinessState,5); + updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId()); + updateWrapper.set(BusinessDocument::getUpdateTime,new Date()); + updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName()); + updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList); + return businessDocumentService.update(updateWrapper); + } + return false; + } + + + /** + * 根据id生效业务单据信息 + */ + public Boolean takeEffectByIds(List businessDocumentIdLongList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(BusinessDocument::getBusinessState,2); + updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId()); + updateWrapper.set(BusinessDocument::getUpdateTime,new Date()); + updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName()); + updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList); + return businessDocumentService.update(updateWrapper); + } + return false; + + } + + /** + * 审核业务单据 + */ + public Boolean auditByIds(List businessDocumentIdLongList, BusinessDocumentDTO businessDocumentDTO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + if(businessDocumentDTO.getAuditOperation() == 1){ + //同意 + updateWrapper.set(BusinessDocument::getBusinessState,3); + }else { + //驳回 + updateWrapper.set(BusinessDocument::getBusinessState,4); + } + updateWrapper.set(BusinessDocument::getReviewRemarks,businessDocumentDTO.getReviewRemarks()); + updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId()); + updateWrapper.set(BusinessDocument::getUpdateTime,new Date()); + updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName()); + updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList); + return businessDocumentService.update(updateWrapper); + } + return false; + } + + public Boolean saveBatch(List businessDocumentList) { + if(null != businessDocumentList && businessDocumentList.size() > 0){ + return businessDocumentService.saveBatch(businessDocumentList); + } + return false; + } + + /** + * 根据原始业务单号和科目编码查询 + */ + public BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(BusinessDocumentDO businessDocumentDO) { + if(StringUtils.isNotEmpty(businessDocumentDO.getOriginalBusinessNum())){ + throw new ServiceException("原始单号不能为空"); + } + if(StringUtils.isNotEmpty(businessDocumentDO.getSecondSubjectCode())){ + throw new ServiceException("费用科目不能为空"); + } + return businessDocumentService.queryByOriginalBusinessNumAndSubjectCode(businessDocumentDO.getOriginalBusinessNum(),businessDocumentDO.getSecondSubjectCode()); + } + + /** + * 保存或修改业务单据 + * @param businessDocumentDO + */ + public Boolean saveOrUpdate(BusinessDocumentDO businessDocumentDO) { + BusinessDocument businessDocument = new BusinessDocument(); + BeanUtils.copyProperties(businessDocumentDO,businessDocument); + return businessDocumentService.saveOrUpdate(businessDocument); + } + + /** + * 批量保存业务单据 + * @param businessDocumentList + * @return + */ + public Boolean saveOrUpdateBatch(List businessDocumentList) { + return businessDocumentService.saveOrUpdateBatch(businessDocumentList); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/entity/ConditionalMapping.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/entity/ConditionalMapping.java new file mode 100644 index 000000000..035b8d8c9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/entity/ConditionalMapping.java @@ -0,0 +1,58 @@ +package com.mhd.bms.domain.conditionalMapping.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 条件映射管理对象 conditional_mapping + * + * @author gen + * @date 2024-08-07 + */ + +@Data +public class ConditionalMapping extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("条件映射表id") + @TableId(type = IdType.AUTO) + private Long conditionalMappingId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("源内容") + @Excel(name = "源内容") + private String sourceContent; + + @ApiModelProperty("映射后") + @Excel(name = "映射后") + private String afterMapping; + + @ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)") + @Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果") + private Integer mappingType; + + @ApiModelProperty("映射语句") + @Excel(name = "映射语句") + private String mappedStatement; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/facade/IConditionalMappingService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/facade/IConditionalMappingService.java new file mode 100644 index 000000000..a3273235d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/facade/IConditionalMappingService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.conditionalMapping.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; + +import java.util.List; + +/** + * 条件映射管理Service接口 + * + * @author gen + * @date 2024-08-07 + */ +public interface IConditionalMappingService extends IService +{ + /** + * 分页查询条件映射管理列表 + */ + public List queryList(ConditionalMappingDO conditionalMappingDO); + + /** + * 新增条件映射管理 + */ + public Boolean insert(ConditionalMappingDO conditionalMappingDO); + + /** + * 修改条件映射管理 + */ + public Boolean update(ConditionalMappingDO conditionalMappingDO); + + /** + * 批量删除条件映射管理 + */ + public Boolean delete(Long[] conditionalMappingIds); + + + /** + * 查询条件映射管理 + */ + public ConditionalMappingPO getInfo(Long conditionalMappingId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/mapper/ConditionalMappingMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/mapper/ConditionalMappingMapper.java new file mode 100644 index 000000000..7a2d71219 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/mapper/ConditionalMappingMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.conditionalMapping.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import org.apache.ibatis.annotations.Param; +/** + * 条件映射管理Mapper接口 + * + * @author gen + * @date 2024-08-07 + */ +public interface ConditionalMappingMapper extends BaseMapper +{ + /** + * 查询条件映射管理列表 + */ + public List queryList(@Param("conditionalMappingDO") ConditionalMappingDO conditionalMappingDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/persistence/ConditionalMappingImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/persistence/ConditionalMappingImpl.java new file mode 100644 index 000000000..ce7a62c7b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/persistence/ConditionalMappingImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.conditionalMapping.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping; +import com.mhd.bms.domain.conditionalMapping.repository.facade.IConditionalMappingService; +import com.mhd.bms.domain.conditionalMapping.repository.mapper.ConditionalMappingMapper; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 条件映射管理Service业务层处理 + * + * @author gen + * @date 2024-08-07 + */ +@Service +public class ConditionalMappingImpl extends ServiceImpl implements IConditionalMappingService{ + @Autowired + private ConditionalMappingMapper conditionalMappingMapper; + + /** + * 查询条件映射管理列表 + */ + @Override + public List queryList(ConditionalMappingDO conditionalMappingDO) + { + return conditionalMappingMapper.queryList(conditionalMappingDO); + } + + /** + * 新增条件映射管理 + */ + @Override + public Boolean insert(ConditionalMappingDO conditionalMappingDO) { + ConditionalMapping conditionalMapping = new ConditionalMapping(); + BeanUtils.copyProperties(conditionalMappingDO,conditionalMapping); + return this.save(conditionalMapping); + } + + /** + * 修改条件映射管理 + */ + @Override + public Boolean update(ConditionalMappingDO conditionalMappingDO) { + ConditionalMapping conditionalMapping = new ConditionalMapping(); + BeanUtils.copyProperties(conditionalMappingDO,conditionalMapping); + return this.updateById(conditionalMapping); + } + + /** + * 批量删除条件映射管理 + */ + @Override + public Boolean delete(Long[] conditionalMappingIds ) { + List list = new ArrayList<>(); + for (Long id : conditionalMappingIds) { + ConditionalMapping conditionalMapping = new ConditionalMapping(); + conditionalMapping.setConditionalMappingId(id); + conditionalMapping.setDelFlag(2); + list.add(conditionalMapping); + } + return this.updateBatchById(list); + } + + /** + * 修改条件映射管理 + */ + @Override + public ConditionalMappingPO getInfo(Long conditionalMappingId) { + ConditionalMapping conditionalMapping = this.getById(conditionalMappingId); + ConditionalMappingPO conditionalMappingPO = new ConditionalMappingPO(); + BeanUtils.copyProperties(conditionalMapping,conditionalMappingPO); + return conditionalMappingPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/po/ConditionalMappingPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/po/ConditionalMappingPO.java new file mode 100644 index 000000000..dc990c448 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/po/ConditionalMappingPO.java @@ -0,0 +1,58 @@ +package com.mhd.bms.domain.conditionalMapping.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 条件映射管理对象 conditional_mapping + * + * @author gen + * @date 2024-08-07 + */ + +@Data +@ApiModel(value = "条件映射管理对象", description = "条件映射管理响应对象") +public class ConditionalMappingPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("条件映射表id") + private Long conditionalMappingId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("源内容") + @Excel(name = "源内容") + private String sourceContent; + + @ApiModelProperty("映射后") + @Excel(name = "映射后") + private String afterMapping; + + @ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)") + @Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果") + private Integer mappingType; + + @ApiModelProperty("映射语句") + @Excel(name = "映射语句") + private String mappedStatement; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/todo/ConditionalMappingDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/todo/ConditionalMappingDO.java new file mode 100644 index 000000000..a78cf9abf --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/repository/todo/ConditionalMappingDO.java @@ -0,0 +1,61 @@ +package com.mhd.bms.domain.conditionalMapping.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 条件映射管理对象 conditional_mapping + * + * @author gen + * @date 2024-08-07 + */ + +@Data +public class ConditionalMappingDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("条件映射表id") + private Long conditionalMappingId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("源内容") + @Excel(name = "源内容") + private String sourceContent; + + @ApiModelProperty("映射后") + @Excel(name = "映射后") + private String afterMapping; + + @ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)") + @Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果") + private Integer mappingType; + + @ApiModelProperty("映射语句") + @Excel(name = "映射语句") + private String mappedStatement; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/service/ConditionalMappingDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/service/ConditionalMappingDomainService.java new file mode 100644 index 000000000..20eddd9f6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/conditionalMapping/service/ConditionalMappingDomainService.java @@ -0,0 +1,64 @@ +package com.mhd.bms.domain.conditionalMapping.service; + +import com.mhd.bms.domain.conditionalMapping.repository.facade.IConditionalMappingService; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 条件映射管理 + * + * @author gen + * @date 2024-08-07 + */ +@Service +@Slf4j +public class ConditionalMappingDomainService { + + @Autowired + private IConditionalMappingService conditionalMappingService; + + + /** + * 分页查询条件映射管理列表 + */ + public List queryList(ConditionalMappingDO conditionalMappingDO) { + return conditionalMappingService.queryList(conditionalMappingDO); + } + + + /** + * 新增条件映射管理 + */ + public Boolean insert(ConditionalMappingDO conditionalMappingDO) { + + return conditionalMappingService.insert(conditionalMappingDO); + } + + /** + * 修改条件映射管理 + */ + public Boolean update(ConditionalMappingDO conditionalMappingDO) { + return conditionalMappingService.update(conditionalMappingDO); + } + + /** + * 批量删除条件映射管理 + */ + public Boolean delete(Long[] conditionalMappingIds) { + return conditionalMappingService.delete(conditionalMappingIds); + } + + /** + * 获取条件映射管理详细信息 + */ + public ConditionalMappingPO getInfo(Long conditionalMappingId) + { + return conditionalMappingService.getInfo(conditionalMappingId); + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingOutputEntity.java b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingOutputEntity.java new file mode 100644 index 000000000..04e46ada0 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingOutputEntity.java @@ -0,0 +1,27 @@ +package com.mhd.bms.domain.costCalculation.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * 计费参数输出json实体 + */ + +@Data +public class BillingOutputEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("输出字段") + private String outFields; + + @ApiModelProperty("输出计费标识 P1 、P2等") + private String outChargingId; + + @ApiModelProperty("字段类型(1-整数,2-浮点数,3-时间)") + private Integer fieldsType; + + @ApiModelProperty("排序") + private Integer sort; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java new file mode 100644 index 000000000..2922a4c04 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/entity/BillingParamsEntity.java @@ -0,0 +1,38 @@ +package com.mhd.bms.domain.costCalculation.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + + +/** + * 计费参数json实体 + */ + +@Data +public class BillingParamsEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("字段名称") + private String fields; + + @ApiModelProperty("计费标识P1、P2") + private String chargingId; + + @ApiModelProperty("阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)") + private Integer ladderType; + + @ApiModelProperty("1-左开右闭,2-左闭右开") + private Integer ladderRule; + + @ApiModelProperty("阶梯值") + private String ladderNum; + + @ApiModelProperty("标志值") + private String flagValue; + + @ApiModelProperty("排序") + private Integer sort; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java new file mode 100644 index 000000000..145c9faa3 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/costCalculation/po/BillingCostPo.java @@ -0,0 +1,34 @@ +package com.mhd.bms.domain.costCalculation.po; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; + + +/** + * 计费结果返回实体 + */ + +@Data +public class BillingCostPo { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("原始单号") + private String originalBusinessNum; + + @ApiModelProperty("单据类型编码") + private String documentTypeCode; + + @ApiModelProperty("费用科目(一级或二级)") + private String subjectCode; + + @ApiModelProperty("合同编号") + private String contractNumber; + + @ApiModelProperty("预计金额") + private BigDecimal computationalCost; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentFromEntity.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentFromEntity.java new file mode 100644 index 000000000..f980103d5 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentFromEntity.java @@ -0,0 +1,31 @@ +package com.mhd.bms.domain.documentType.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * 单据类型表单json实体 + */ + +@Data +public class DocumentFromEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("字段名称") + private String field; + + @ApiModelProperty("字段描述") + private String title; + + @ApiModelProperty("是否显示 :1是 2否") + private Integer disabled; + + @ApiModelProperty("是否必填:1是 2否") + private Integer notNull; + + @ApiModelProperty("数据类型 下拉框,日期,日期时间,数字,文本") + private String type; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentType.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentType.java new file mode 100644 index 000000000..6ebc96122 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/entity/DocumentType.java @@ -0,0 +1,70 @@ +package com.mhd.bms.domain.documentType.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 单据类型对象 document_type + * + * @author gen + * @date 2024-06-18 + */ + +@Data +public class DocumentType extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("单据类型id") + @TableId(type = IdType.AUTO) + private Long documentTypeId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("参数json数组") + @Excel(name = "参数json数组") + private String formJson; + + @ApiModelProperty("启用状态(1-启用,2-关闭)") + @Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭") + private Integer enablingStatus; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/facade/IDocumentTypeService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/facade/IDocumentTypeService.java new file mode 100644 index 000000000..0fbf95281 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/facade/IDocumentTypeService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.documentType.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; + +import java.util.List; + +/** + * 单据类型Service接口 + * + * @author gen + * @date 2024-06-18 + */ +public interface IDocumentTypeService extends IService +{ + /** + * 分页查询单据类型列表 + */ + public List queryList(DocumentTypeDO documentTypeDO); + + /** + * 新增单据类型 + */ + public Boolean insert(DocumentTypeDO documentTypeDO); + + /** + * 修改单据类型 + */ + public Boolean update(DocumentTypeDO documentTypeDO); + + /** + * 批量删除单据类型 + */ + public Boolean delete(Long[] documentTypeIds); + + + /** + * 查询单据类型 + */ + public DocumentTypePO getInfo(Long documentTypeId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/mapper/DocumentTypeMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/mapper/DocumentTypeMapper.java new file mode 100644 index 000000000..e7046b080 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/mapper/DocumentTypeMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.documentType.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import org.apache.ibatis.annotations.Param; +/** + * 单据类型Mapper接口 + * + * @author gen + * @date 2024-06-18 + */ +public interface DocumentTypeMapper extends BaseMapper +{ + /** + * 查询单据类型列表 + */ + public List queryList(@Param("documentTypeDO") DocumentTypeDO documentTypeDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/persistence/DocumentTypeImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/persistence/DocumentTypeImpl.java new file mode 100644 index 000000000..f9d06879d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/persistence/DocumentTypeImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.documentType.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.facade.IDocumentTypeService; +import com.mhd.bms.domain.documentType.repository.mapper.DocumentTypeMapper; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 单据类型Service业务层处理 + * + * @author gen + * @date 2024-06-18 + */ +@Service +public class DocumentTypeImpl extends ServiceImpl implements IDocumentTypeService{ + @Autowired + private DocumentTypeMapper documentTypeMapper; + + /** + * 查询单据类型列表 + */ + @Override + public List queryList(DocumentTypeDO documentTypeDO) + { + return documentTypeMapper.queryList(documentTypeDO); + } + + /** + * 新增单据类型 + */ + @Override + public Boolean insert(DocumentTypeDO documentTypeDO) { + DocumentType documentType = new DocumentType(); + BeanUtils.copyProperties(documentTypeDO,documentType); + return this.save(documentType); + } + + /** + * 修改单据类型 + */ + @Override + public Boolean update(DocumentTypeDO documentTypeDO) { + DocumentType documentType = new DocumentType(); + BeanUtils.copyProperties(documentTypeDO,documentType); + return this.updateById(documentType); + } + + /** + * 批量删除单据类型 + */ + @Override + public Boolean delete(Long[] documentTypeIds ) { + List list = new ArrayList<>(); + for (Long id : documentTypeIds) { + DocumentType documentType = new DocumentType(); + documentType.setDocumentTypeId(id); + documentType.setDelFlag(2); + list.add(documentType); + } + return this.updateBatchById(list); + } + + /** + * 修改单据类型 + */ + @Override + public DocumentTypePO getInfo(Long documentTypeId) { + DocumentType documentType = this.getById(documentTypeId); + DocumentTypePO documentTypePO = new DocumentTypePO(); + BeanUtils.copyProperties(documentType,documentTypePO); + return documentTypePO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/po/DocumentTypePO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/po/DocumentTypePO.java new file mode 100644 index 000000000..a05b6ebf0 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/po/DocumentTypePO.java @@ -0,0 +1,70 @@ +package com.mhd.bms.domain.documentType.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 单据类型对象 document_type + * + * @author gen + * @date 2024-06-18 + */ + +@Data +@ApiModel(value = "单据类型对象", description = "单据类型响应对象") +public class DocumentTypePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("单据类型id") + private Long documentTypeId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("参数json数组") + @Excel(name = "参数json数组") + private String formJson; + + @ApiModelProperty("启用状态(1-启用,2-关闭)") + @Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭") + private Integer enablingStatus; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/todo/DocumentTypeDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/todo/DocumentTypeDO.java new file mode 100644 index 000000000..64435c715 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/repository/todo/DocumentTypeDO.java @@ -0,0 +1,84 @@ +package com.mhd.bms.domain.documentType.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; +import java.util.Set; + + +/** + * 单据类型对象 document_type + * + * @author gen + * @date 2024-06-18 + */ + +@Data +public class DocumentTypeDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("单据类型id") + private Long documentTypeId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("参数json数组") + @Excel(name = "参数json数组") + private String formJson; + + @ApiModelProperty("启用状态(1-启用,2-关闭)") + @Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭") + private Integer enablingStatus; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "单据Code集合") + private Set documentTypeCodeSet; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/service/DocumentTypeDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/service/DocumentTypeDomainService.java new file mode 100644 index 000000000..5645b809c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/documentType/service/DocumentTypeDomainService.java @@ -0,0 +1,74 @@ +package com.mhd.bms.domain.documentType.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.documentType.entity.DocumentType; +import com.mhd.bms.domain.documentType.repository.facade.IDocumentTypeService; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import com.mhd.common.security.utils.SecurityUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 单据类型 + * + * @author gen + * @date 2024-06-18 + */ +@Service +@Slf4j +public class DocumentTypeDomainService { + + @Autowired + private IDocumentTypeService documentTypeService; + + + /** + * 分页查询单据类型列表 + */ + public List queryList(DocumentTypeDO documentTypeDO) { + return documentTypeService.queryList(documentTypeDO); + } + + + /** + * 新增单据类型 + */ + public Boolean insert(DocumentTypeDO documentTypeDO) { + + return documentTypeService.insert(documentTypeDO); + } + + /** + * 修改单据类型 + */ + public Boolean update(DocumentTypeDO documentTypeDO) { + return documentTypeService.update(documentTypeDO); + } + + /** + * 批量删除单据类型 + */ + public Boolean delete(Long[] documentTypeIds) { + return documentTypeService.delete(documentTypeIds); + } + + /** + * 获取单据类型详细信息 + */ + public DocumentTypePO getInfo(Long documentTypeId) + { + return documentTypeService.getInfo(documentTypeId); + } + + + public DocumentType queryByCode(String documentTypeCode) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DocumentType::getDocumentTypeCode, documentTypeCode); + queryWrapper.eq(DocumentType::getTopOrganizationId, SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId()); + queryWrapper.eq(DocumentType::getDelFlag ,1); + return documentTypeService.getOne(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/entity/MappingMethod.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/entity/MappingMethod.java new file mode 100644 index 000000000..3951e69eb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/entity/MappingMethod.java @@ -0,0 +1,58 @@ +package com.mhd.bms.domain.mappingMethod.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 方法映射对象 mapping_method + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class MappingMethod extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("方法映射表id") + @TableId(type = IdType.AUTO) + private Long mappingMethodId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("方法名称") + @Excel(name = "方法名称") + private String methodName; + + @ApiModelProperty("映射方法") + @Excel(name = "映射方法") + private String mappingMethod; + + @ApiModelProperty("类型(1-内置方法,2-逻辑语句)") + @Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句") + private Integer mappingType; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/facade/IMappingMethodService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/facade/IMappingMethodService.java new file mode 100644 index 000000000..b26d5d0fe --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/facade/IMappingMethodService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.mappingMethod.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.mappingMethod.entity.MappingMethod; +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; + +import java.util.List; + +/** + * 方法映射Service接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface IMappingMethodService extends IService +{ + /** + * 分页查询方法映射列表 + */ + public List queryList(MappingMethodDO mappingMethodDO); + + /** + * 新增方法映射 + */ + public Boolean insert(MappingMethodDO mappingMethodDO); + + /** + * 修改方法映射 + */ + public Boolean update(MappingMethodDO mappingMethodDO); + + /** + * 批量删除方法映射 + */ + public Boolean delete(Long[] mappingMethodIds); + + + /** + * 查询方法映射 + */ + public MappingMethodPO getInfo(Long mappingMethodId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/mapper/MappingMethodMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/mapper/MappingMethodMapper.java new file mode 100644 index 000000000..ebbc4b111 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/mapper/MappingMethodMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.mappingMethod.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.mappingMethod.entity.MappingMethod; +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import org.apache.ibatis.annotations.Param; +/** + * 方法映射Mapper接口 + * + * @author gen + * @date 2024-07-12 + */ +public interface MappingMethodMapper extends BaseMapper +{ + /** + * 查询方法映射列表 + */ + public List queryList(@Param("mappingMethodDO") MappingMethodDO mappingMethodDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/persistence/MappingMethodImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/persistence/MappingMethodImpl.java new file mode 100644 index 000000000..bce8ac662 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/persistence/MappingMethodImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.mappingMethod.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.mappingMethod.entity.MappingMethod; +import com.mhd.bms.domain.mappingMethod.repository.facade.IMappingMethodService; +import com.mhd.bms.domain.mappingMethod.repository.mapper.MappingMethodMapper; +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 方法映射Service业务层处理 + * + * @author gen + * @date 2024-07-12 + */ +@Service +public class MappingMethodImpl extends ServiceImpl implements IMappingMethodService{ + @Autowired + private MappingMethodMapper mappingMethodMapper; + + /** + * 查询方法映射列表 + */ + @Override + public List queryList(MappingMethodDO mappingMethodDO) + { + return mappingMethodMapper.queryList(mappingMethodDO); + } + + /** + * 新增方法映射 + */ + @Override + public Boolean insert(MappingMethodDO mappingMethodDO) { + MappingMethod mappingMethod = new MappingMethod(); + BeanUtils.copyProperties(mappingMethodDO,mappingMethod); + return this.save(mappingMethod); + } + + /** + * 修改方法映射 + */ + @Override + public Boolean update(MappingMethodDO mappingMethodDO) { + MappingMethod mappingMethod = new MappingMethod(); + BeanUtils.copyProperties(mappingMethodDO,mappingMethod); + return this.updateById(mappingMethod); + } + + /** + * 批量删除方法映射 + */ + @Override + public Boolean delete(Long[] mappingMethodIds ) { + List list = new ArrayList<>(); + for (Long id : mappingMethodIds) { + MappingMethod mappingMethod = new MappingMethod(); + mappingMethod.setMappingMethodId(id); + mappingMethod.setDelFlag(2); + list.add(mappingMethod); + } + return this.updateBatchById(list); + } + + /** + * 修改方法映射 + */ + @Override + public MappingMethodPO getInfo(Long mappingMethodId) { + MappingMethod mappingMethod = this.getById(mappingMethodId); + MappingMethodPO mappingMethodPO = new MappingMethodPO(); + BeanUtils.copyProperties(mappingMethod,mappingMethodPO); + return mappingMethodPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/po/MappingMethodPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/po/MappingMethodPO.java new file mode 100644 index 000000000..237cab02d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/po/MappingMethodPO.java @@ -0,0 +1,58 @@ +package com.mhd.bms.domain.mappingMethod.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 方法映射对象 mapping_method + * + * @author gen + * @date 2024-07-12 + */ + +@Data +@ApiModel(value = "方法映射对象", description = "方法映射响应对象") +public class MappingMethodPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("方法映射表id") + private Long mappingMethodId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("方法名称") + @Excel(name = "方法名称") + private String methodName; + + @ApiModelProperty("映射方法") + @Excel(name = "映射方法") + private String mappingMethod; + + @ApiModelProperty("类型(1-内置方法,2-逻辑语句)") + @Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句") + private Integer mappingType; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/todo/MappingMethodDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/todo/MappingMethodDO.java new file mode 100644 index 000000000..06bdce915 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/repository/todo/MappingMethodDO.java @@ -0,0 +1,64 @@ +package com.mhd.bms.domain.mappingMethod.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 方法映射对象 mapping_method + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class MappingMethodDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("方法映射表id") + private Long mappingMethodId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("方法名称") + @Excel(name = "方法名称") + private String methodName; + + @ApiModelProperty("映射方法") + @Excel(name = "映射方法") + private String mappingMethod; + + @ApiModelProperty("类型(1-内置方法,2-逻辑语句)") + @Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句") + private Integer mappingType; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("方法映射表ids") + private String mappingMethodIds; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/service/MappingMethodDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/service/MappingMethodDomainService.java new file mode 100644 index 000000000..0390a1373 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/mappingMethod/service/MappingMethodDomainService.java @@ -0,0 +1,76 @@ +package com.mhd.bms.domain.mappingMethod.service; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.mappingMethod.repository.facade.IMappingMethodService; +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; +/** + * 方法映射 + * + * @author gen + * @date 2024-07-12 + */ +@Service +@Slf4j +public class MappingMethodDomainService { + + @Autowired + private IMappingMethodService mappingMethodService; + + + /** + * 分页查询方法映射列表 + */ + public List queryList(MappingMethodDO mappingMethodDO) { + return mappingMethodService.queryList(mappingMethodDO); + } + + + /** + * 新增方法映射 + */ + public Boolean insert(MappingMethodDO mappingMethodDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + mappingMethodDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + mappingMethodDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + mappingMethodDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + return mappingMethodService.insert(mappingMethodDO); + } + + /** + * 修改方法映射 + */ + public Boolean update(MappingMethodDO mappingMethodDO) { + return mappingMethodService.update(mappingMethodDO); + } + + /** + * 批量删除方法映射 + */ + public Boolean delete(Long[] mappingMethodIds) { + return mappingMethodService.delete(mappingMethodIds); + } + + /** + * 获取方法映射详细信息 + */ + public MappingMethodPO getInfo(Long mappingMethodId) + { + return mappingMethodService.getInfo(mappingMethodId); + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/entity/PaymentManage.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/entity/PaymentManage.java new file mode 100644 index 000000000..d7cdec112 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/entity/PaymentManage.java @@ -0,0 +1,50 @@ +package com.mhd.bms.domain.paymentManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 支付管理对象 payment_manage + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentManage extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付管理id") + @TableId(type = IdType.AUTO) + private Long paymentManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/facade/IPaymentManageService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/facade/IPaymentManageService.java new file mode 100644 index 000000000..372ed4fe0 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/facade/IPaymentManageService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.paymentManage.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; + +import java.util.List; + +/** + * 支付管理Service接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface IPaymentManageService extends IService +{ + /** + * 分页查询支付管理列表 + */ + public List queryList(PaymentManageDO paymentManageDO); + + /** + * 新增支付管理 + */ + public Boolean insert(PaymentManageDO paymentManageDO); + + /** + * 修改支付管理 + */ + public Boolean update(PaymentManageDO paymentManageDO); + + /** + * 批量删除支付管理 + */ + public Boolean delete(Long[] paymentManageIds); + + + /** + * 查询支付管理 + */ + public PaymentManagePO getInfo(Long paymentManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/mapper/PaymentManageMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/mapper/PaymentManageMapper.java new file mode 100644 index 000000000..6f2690342 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/mapper/PaymentManageMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.paymentManage.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import org.apache.ibatis.annotations.Param; +/** + * 支付管理Mapper接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface PaymentManageMapper extends BaseMapper +{ + /** + * 查询支付管理列表 + */ + public List queryList(PaymentManageDO paymentManageDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/persistence/PaymentManageImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/persistence/PaymentManageImpl.java new file mode 100644 index 000000000..cfc11eb1f --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/persistence/PaymentManageImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.paymentManage.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.facade.IPaymentManageService; +import com.mhd.bms.domain.paymentManage.repository.mapper.PaymentManageMapper; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 支付管理Service业务层处理 + * + * @author gen + * @date 2024-07-09 + */ +@Service +public class PaymentManageImpl extends ServiceImpl implements IPaymentManageService{ + @Autowired + private PaymentManageMapper paymentManageMapper; + + /** + * 查询支付管理列表 + */ + @Override + public List queryList(PaymentManageDO paymentManageDO) + { + return paymentManageMapper.queryList(paymentManageDO); + } + + /** + * 新增支付管理 + */ + @Override + public Boolean insert(PaymentManageDO paymentManageDO) { + PaymentManage paymentManage = new PaymentManage(); + BeanUtils.copyProperties(paymentManageDO,paymentManage); + return this.save(paymentManage); + } + + /** + * 修改支付管理 + */ + @Override + public Boolean update(PaymentManageDO paymentManageDO) { + PaymentManage paymentManage = new PaymentManage(); + BeanUtils.copyProperties(paymentManageDO,paymentManage); + return this.updateById(paymentManage); + } + + /** + * 批量删除支付管理 + */ + @Override + public Boolean delete(Long[] paymentManageIds ) { + List list = new ArrayList<>(); + for (Long id : paymentManageIds) { + PaymentManage paymentManage = new PaymentManage(); + paymentManage.setPaymentManageId(id); + paymentManage.setDelFlag(2); + list.add(paymentManage); + } + return this.updateBatchById(list); + } + + /** + * 修改支付管理 + */ + @Override + public PaymentManagePO getInfo(Long paymentManageId) { + PaymentManage paymentManage = this.getById(paymentManageId); + PaymentManagePO paymentManagePO = new PaymentManagePO(); + BeanUtils.copyProperties(paymentManage,paymentManagePO); + return paymentManagePO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/po/PaymentManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/po/PaymentManagePO.java new file mode 100644 index 000000000..dba9bc7b4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/po/PaymentManagePO.java @@ -0,0 +1,50 @@ +package com.mhd.bms.domain.paymentManage.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 支付管理对象 payment_manage + * + * @author gen + * @date 2024-07-09 + */ + +@Data +@ApiModel(value = "支付管理对象", description = "支付管理响应对象") +public class PaymentManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付管理id") + private Long paymentManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/todo/PaymentManageDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/todo/PaymentManageDO.java new file mode 100644 index 000000000..a366d8313 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/repository/todo/PaymentManageDO.java @@ -0,0 +1,53 @@ +package com.mhd.bms.domain.paymentManage.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 支付管理对象 payment_manage + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentManageDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付管理id") + private Long paymentManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/service/PaymentManageDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/service/PaymentManageDomainService.java new file mode 100644 index 000000000..7464c4b55 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentManage/service/PaymentManageDomainService.java @@ -0,0 +1,83 @@ +package com.mhd.bms.domain.paymentManage.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.repository.facade.IPaymentManageService; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 支付管理 + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class PaymentManageDomainService { + + @Autowired + private IPaymentManageService paymentManageService; + + + /** + * 分页查询支付管理列表 + */ + public List queryList(PaymentManageDO paymentManageDO) { + return paymentManageService.queryList(paymentManageDO); + } + + + /** + * 新增支付管理 + */ + public Boolean insert(PaymentManageDO paymentManageDO) { + + return paymentManageService.insert(paymentManageDO); + } + + /** + * 修改支付管理 + */ + public Boolean update(PaymentManageDO paymentManageDO) { + return paymentManageService.update(paymentManageDO); + } + + /** + * 批量删除支付管理 + */ + public Boolean delete(Long[] paymentManageIds) { + return paymentManageService.delete(paymentManageIds); + } + + /** + * 获取支付管理详细信息 + */ + public PaymentManagePO getInfo(Long paymentManageId) + { + return paymentManageService.getInfo(paymentManageId); + } + + + public PaymentManage selectByPaymentCode(String paymentCode) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PaymentManage::getPaymentMethodCode,paymentCode); + queryWrapper.eq(PaymentManage::getDelFlag,1); + queryWrapper.eq(PaymentManage::getOrganizationId,loginUser.getUserPo().getOrganizationId()); + return paymentManageService.getOne(queryWrapper); + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrder.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrder.java new file mode 100644 index 000000000..da2e6dcd2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrder.java @@ -0,0 +1,112 @@ +package com.mhd.bms.domain.paymentOrder.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 付款单对象 payment_order + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrder extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + @TableId(type = IdType.AUTO) + private Long paymentOrderId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付通道code") + @Excel(name = "支付通道code") + private String paymentChannelCode; + + @ApiModelProperty("支付通道name") + @Excel(name = "支付通道name") + private String paymentChannelName; + + @ApiModelProperty("付款方式code") + @Excel(name = "付款方式code") + private String paymentMethodCode; + + @ApiModelProperty("付款方式") + @Excel(name = "付款方式") + private String paymentMethod; + + @ApiModelProperty("付款人") + private String paymentBindingName; + + @ApiModelProperty("付款卡号id") + @Excel(name = "付款卡号id") + private Long paymentCardId; + + @ApiModelProperty("卡号") + @Excel(name = "卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("付款凭证") + @Excel(name = "付款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String paymentRemark; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; + + @ApiModelProperty("结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算主体") + private String settlementEntity; + + @ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)") + private Integer paymentState; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("付款来源(1-人工付款,2-线上支付)") + private Integer paymentSource; + + @ApiModelProperty("开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + private String bankBindingName; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrderDetails.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrderDetails.java new file mode 100644 index 000000000..824d62e04 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/entity/PaymentOrderDetails.java @@ -0,0 +1,69 @@ +package com.mhd.bms.domain.paymentOrder.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 付款单详情对象 payment_order_details + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrderDetails extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + @TableId(type = IdType.AUTO) + private Long paymentOrderDetailsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已付金额") + @Excel(name = "已付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("本次付款金额") + @Excel(name = "本次付款金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("剩余未付金额") + @Excel(name = "剩余未付金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderDetailsService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderDetailsService.java new file mode 100644 index 000000000..9e855fa13 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderDetailsService.java @@ -0,0 +1,45 @@ +package com.mhd.bms.domain.paymentOrder.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO; + +import java.util.List; + +/** + * 付款单详情Service接口 + * + * @author gen + * @date 2024-07-16 + */ +public interface IPaymentOrderDetailsService extends IService +{ + /** + * 分页查询付款单详情列表 + */ + public List queryList(PaymentOrderDetailsDO paymentOrderDetailsDO); + + /** + * 新增付款单详情 + */ + public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO); + + /** + * 修改付款单详情 + */ + public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO); + + /** + * 批量删除付款单详情 + */ + public Boolean delete(Long[] paymentOrderDetailsIds); + + + /** + * 查询付款单详情 + */ + public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId); + + PaymentOrderDetailsPO getInfoByPaymentOrderId(Long paymentOrderId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderService.java new file mode 100644 index 000000000..bf270f80e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/facade/IPaymentOrderService.java @@ -0,0 +1,45 @@ +package com.mhd.bms.domain.paymentOrder.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; + +import java.util.List; + +/** + * 付款单Service接口 + * + * @author gen + * @date 2024-07-16 + */ +public interface IPaymentOrderService extends IService +{ + /** + * 分页查询付款单列表 + */ + public List queryList(PaymentOrderDO paymentOrderDO); + + /** + * 新增付款单 + */ + public Boolean insert(PaymentOrderDO paymentOrderDO); + + /** + * 修改付款单 + */ + public Boolean update(PaymentOrderDO paymentOrderDO); + + /** + * 批量删除付款单 + */ + public Boolean delete(Long[] paymentOrderIds); + + + /** + * 查询付款单 + */ + public PaymentOrderPO getInfo(Long paymentOrderId); + + List getDetailsByBillManageId(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderDetailsMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderDetailsMapper.java new file mode 100644 index 000000000..543bf7610 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderDetailsMapper.java @@ -0,0 +1,18 @@ +package com.mhd.bms.domain.paymentOrder.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO; +import org.apache.ibatis.annotations.Param; +/** + * 付款单详情Mapper接口 + * + * @author gen + * @date 2024-07-16 + */ +public interface PaymentOrderDetailsMapper extends BaseMapper +{ + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderMapper.java new file mode 100644 index 000000000..6cdcdf915 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/mapper/PaymentOrderMapper.java @@ -0,0 +1,23 @@ +package com.mhd.bms.domain.paymentOrder.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import org.apache.ibatis.annotations.Param; +/** + * 付款单Mapper接口 + * + * @author gen + * @date 2024-07-16 + */ +public interface PaymentOrderMapper extends BaseMapper +{ + /** + * 查询付款单列表 + */ + public List queryList(@Param("paymentOrderDO") PaymentOrderDO paymentOrderDO); + + List getDetailsByBillManageId(@Param("billManageId") Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderDetailsImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderDetailsImpl.java new file mode 100644 index 000000000..ed58c65dc --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderDetailsImpl.java @@ -0,0 +1,94 @@ +package com.mhd.bms.domain.paymentOrder.repository.persistence; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService; +import com.mhd.bms.domain.paymentOrder.repository.mapper.PaymentOrderDetailsMapper; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 付款单详情Service业务层处理 + * + * @author gen + * @date 2024-07-16 + */ +@Service +public class PaymentOrderDetailsImpl extends ServiceImpl implements IPaymentOrderDetailsService { + @Autowired + private PaymentOrderDetailsMapper paymentOrderDetailsMapper; + + /** + * 查询付款单详情列表 + */ + @Override + public List queryList(PaymentOrderDetailsDO paymentOrderDetailsDO) + { + return null; + } + + /** + * 新增付款单详情 + */ + @Override + public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO) { + PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails(); + BeanUtils.copyProperties(paymentOrderDetailsDO,paymentOrderDetails); + return this.save(paymentOrderDetails); + } + + /** + * 修改付款单详情 + */ + @Override + public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO) { + PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails(); + BeanUtils.copyProperties(paymentOrderDetailsDO,paymentOrderDetails); + return this.updateById(paymentOrderDetails); + } + + /** + * 批量删除付款单详情 + */ + @Override + public Boolean delete(Long[] paymentOrderDetailsIds ) { + List list = new ArrayList<>(); + for (Long id : paymentOrderDetailsIds) { + PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails(); + paymentOrderDetails.setPaymentOrderDetailsId(id); + paymentOrderDetails.setDelFlag(2); + list.add(paymentOrderDetails); + } + return this.updateBatchById(list); + } + + /** + * 修改付款单详情 + */ + @Override + public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId) { + PaymentOrderDetails paymentOrderDetails = this.getById(paymentOrderDetailsId); + PaymentOrderDetailsPO paymentOrderDetailsPO = new PaymentOrderDetailsPO(); + BeanUtils.copyProperties(paymentOrderDetails,paymentOrderDetailsPO); + return paymentOrderDetailsPO; + } + + @Override + public PaymentOrderDetailsPO getInfoByPaymentOrderId(Long paymentOrderId) { + PaymentOrderDetailsPO paymentOrderDetailsPO = new PaymentOrderDetailsPO(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PaymentOrderDetails::getPaymentOrderId,paymentOrderId); + PaymentOrderDetails paymentOrderDetails = this.getOne(queryWrapper); + if(paymentOrderDetails != null){ + BeanUtils.copyProperties(paymentOrderDetails,paymentOrderDetailsPO); + } + return paymentOrderDetailsPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderImpl.java new file mode 100644 index 000000000..b0509b2f1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/persistence/PaymentOrderImpl.java @@ -0,0 +1,86 @@ +package com.mhd.bms.domain.paymentOrder.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder; +import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderService; +import com.mhd.bms.domain.paymentOrder.repository.mapper.PaymentOrderMapper; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 付款单Service业务层处理 + * + * @author gen + * @date 2024-07-16 + */ +@Service +public class PaymentOrderImpl extends ServiceImpl implements IPaymentOrderService{ + @Autowired + private PaymentOrderMapper paymentOrderMapper; + + /** + * 查询付款单列表 + */ + @Override + public List queryList(PaymentOrderDO paymentOrderDO) + { + return paymentOrderMapper.queryList(paymentOrderDO); + } + + /** + * 新增付款单 + */ + @Override + public Boolean insert(PaymentOrderDO paymentOrderDO) { + PaymentOrder paymentOrder = new PaymentOrder(); + BeanUtils.copyProperties(paymentOrderDO,paymentOrder); + return this.save(paymentOrder); + } + + /** + * 修改付款单 + */ + @Override + public Boolean update(PaymentOrderDO paymentOrderDO) { + PaymentOrder paymentOrder = new PaymentOrder(); + BeanUtils.copyProperties(paymentOrderDO,paymentOrder); + return this.updateById(paymentOrder); + } + + /** + * 批量删除付款单 + */ + @Override + public Boolean delete(Long[] paymentOrderIds ) { + List list = new ArrayList<>(); + for (Long id : paymentOrderIds) { + PaymentOrder paymentOrder = new PaymentOrder(); + paymentOrder.setPaymentOrderId(id); + paymentOrder.setDelFlag(2); + list.add(paymentOrder); + } + return this.updateBatchById(list); + } + + /** + * 修改付款单 + */ + @Override + public PaymentOrderPO getInfo(Long paymentOrderId) { + PaymentOrder paymentOrder = this.getById(paymentOrderId); + PaymentOrderPO paymentOrderPO = new PaymentOrderPO(); + BeanUtils.copyProperties(paymentOrder,paymentOrderPO); + return paymentOrderPO; + } + + @Override + public List getDetailsByBillManageId(Long billManageId) { + return paymentOrderMapper.getDetailsByBillManageId(billManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderDetailsPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderDetailsPO.java new file mode 100644 index 000000000..ed60559c7 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderDetailsPO.java @@ -0,0 +1,69 @@ +package com.mhd.bms.domain.paymentOrder.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 付款单详情对象 payment_order_details + * + * @author gen + * @date 2024-07-16 + */ + +@Data +@ApiModel(value = "付款单详情对象", description = "付款单详情响应对象") +public class PaymentOrderDetailsPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderDetailsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已付金额") + @Excel(name = "已付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("本次付款金额") + @Excel(name = "本次付款金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("剩余未付金额") + @Excel(name = "剩余未付金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderPO.java new file mode 100644 index 000000000..4bcf56646 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/po/PaymentOrderPO.java @@ -0,0 +1,117 @@ +package com.mhd.bms.domain.paymentOrder.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 付款单对象 payment_order + * + * @author gen + * @date 2024-07-16 + */ + +@Data +@ApiModel(value = "付款单对象", description = "付款单响应对象") +public class PaymentOrderPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付通道code") + @Excel(name = "支付通道code") + private String paymentChannelCode; + + @ApiModelProperty("支付通道name") + @Excel(name = "支付通道name") + private String paymentChannelName; + + @ApiModelProperty("付款方式code") + @Excel(name = "付款方式code") + private String paymentMethodCode; + + @ApiModelProperty("付款方式") + @Excel(name = "付款方式") + private String paymentMethod; + + @ApiModelProperty("付款卡号id") + @Excel(name = "付款卡号id") + private Long paymentCardId; + + @ApiModelProperty("付款人") + private String paymentBindingName; + + @ApiModelProperty("卡号") + @Excel(name = "卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("付款凭证") + @Excel(name = "付款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String paymentRemark; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; + + @ApiModelProperty("结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算主体") + private String settlementEntity; + + @ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)") + private Integer paymentState; + + @ApiModelProperty("结算单明细实体") + private PaymentOrderDetailsPO paymentOrderDetailsPO; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("付款来源(1-人工付款,2-线上支付)") + private Integer paymentSource; + + @ApiModelProperty("开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty("本次付款金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("账单编号") + private String billNumber; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDO.java new file mode 100644 index 000000000..5a569014b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDO.java @@ -0,0 +1,129 @@ +package com.mhd.bms.domain.paymentOrder.repository.todo; + +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 付款单对象 payment_order + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrderDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付通道code") + @Excel(name = "支付通道code") + private String paymentChannelCode; + + @ApiModelProperty("支付通道name") + @Excel(name = "支付通道name") + private String paymentChannelName; + + @ApiModelProperty("付款方式code") + @Excel(name = "付款方式code") + private String paymentMethodCode; + + @ApiModelProperty("付款方式") + @Excel(name = "付款方式") + private String paymentMethod; + + @ApiModelProperty("付款卡号id") + @Excel(name = "付款卡号id") + private Long paymentCardId; + + @ApiModelProperty("付款人") + private String paymentBindingName; + + @ApiModelProperty("卡号") + @Excel(name = "卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("付款凭证") + @Excel(name = "付款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String paymentRemark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("账单管理ids") + private String billManageIds; + + @ApiModelProperty(name = "付款账单明细") + private List paymentOrderDetailsDTOList; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; + + @ApiModelProperty("结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算主体") + private String settlementEntity; + + @ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)") + private Integer paymentState; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("付款来源(1-人工付款,2-线上支付)") + private Integer paymentSource; + + @ApiModelProperty("开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty(name = "支付密码") + private String payPassword; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDetailsDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDetailsDO.java new file mode 100644 index 000000000..f71eb438e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/repository/todo/PaymentOrderDetailsDO.java @@ -0,0 +1,76 @@ +package com.mhd.bms.domain.paymentOrder.repository.todo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 付款单详情对象 payment_order_details + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrderDetailsDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderDetailsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已付金额") + @Excel(name = "已付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("本次付款金额") + @Excel(name = "本次付款金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("剩余未付金额") + @Excel(name = "剩余未付金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDetailsDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDetailsDomainService.java new file mode 100644 index 000000000..afe6834d3 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDetailsDomainService.java @@ -0,0 +1,78 @@ +package com.mhd.bms.domain.paymentOrder.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +/** + * 付款单详情 + * + * @author gen + * @date 2024-07-16 + */ +@Service +@Slf4j +public class PaymentOrderDetailsDomainService { + + @Autowired + private IPaymentOrderDetailsService paymentOrderDetailsService; + + + /** + * 分页查询付款单详情列表 + */ + public List queryList(PaymentOrderDetailsDO paymentOrderDetailsDO) { + return paymentOrderDetailsService.queryList(paymentOrderDetailsDO); + } + + + /** + * 新增付款单详情 + */ + public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO) { + + return paymentOrderDetailsService.insert(paymentOrderDetailsDO); + } + + /** + * 修改付款单详情 + */ + public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO) { + return paymentOrderDetailsService.update(paymentOrderDetailsDO); + } + + /** + * 批量删除付款单详情 + */ + public Boolean delete(Long[] paymentOrderDetailsIds) { + return paymentOrderDetailsService.delete(paymentOrderDetailsIds); + } + + /** + * 获取付款单详情详细信息 + */ + public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId) + { + return paymentOrderDetailsService.getInfo(paymentOrderDetailsId); + } + + + /** + * 根据付款单ID查询付款单详情 + * @param orderIdSet + * @return + */ + public List queryListByIdSet(Set orderIdSet) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(PaymentOrderDetails::getPaymentOrderId, orderIdSet); + return paymentOrderDetailsService.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDomainService.java new file mode 100644 index 000000000..70f618bc6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentOrder/service/PaymentOrderDomainService.java @@ -0,0 +1,315 @@ +package com.mhd.bms.domain.paymentOrder.service; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.service.PaymentManageDomainService; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder; +import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails; +import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService; +import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderService; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.service.PaymentWalletDomainService; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO; +import com.mhd.common.core.domain.po.SysDictDataVo; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.enums.DictCode; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.model.LoginUser; +import io.swagger.annotations.ApiModelProperty; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 付款单 + * + * @author gen + * @date 2024-07-16 + */ +@Service +@Slf4j +public class PaymentOrderDomainService { + + @Autowired + private IPaymentOrderService paymentOrderService; + @Autowired + private BillManageDomainService billManageDomainService; + @Autowired + private SettlementCustomersDomainService settlementCustomersDomainService; + @Autowired + private PaymentManageDomainService paymentManageDomainService; + @Autowired + private PaymentWalletDomainService paymentWalletDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private IPaymentOrderDetailsService paymentOrderDetailsService; + + + /** + * 分页查询付款单列表 + */ + public List queryList(PaymentOrderDO paymentOrderDO) { + return paymentOrderService.queryList(paymentOrderDO); + } + + + /** + * 新增付款单 + */ + public Boolean insert(PaymentOrderDO paymentOrderDO) { + + return paymentOrderService.insert(paymentOrderDO); + } + + /** + * 修改付款单 + */ + public Boolean update(PaymentOrderDO paymentOrderDO) { + return paymentOrderService.update(paymentOrderDO); + } + + /** + * 批量删除付款单 + */ + public Boolean delete(Long[] paymentOrderIds) { + return paymentOrderService.delete(paymentOrderIds); + } + + /** + * 获取付款单详细信息 + */ + public PaymentOrderPO getInfo(Long paymentOrderId) + { + return paymentOrderService.getInfo(paymentOrderId); + } + + + /** + * 校验付款单状态 + */ + public void checkSettlementStatus(PaymentOrderDO paymentOrderDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Set bills = Stream.of(paymentOrderDO.getBillManageIds()).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,bills); + List billManageList = billManageDomainService.queryListLambda(queryWrapper); + if(billManageList ==null || billManageList.size()==0){ + throw new ServiceException("账单信息未找到"); + } + List paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList(); + if(paymentOrderDetailsDTOList == null || paymentOrderDetailsDTOList.size() == 0){ + throw new ServiceException("付款账单明细不能为空"); + } + billManageList.forEach(billManage -> { + if(billManage.getBillType() != 2){ + throw new ServiceException("账单" + billManage.getBillNumber() + "收付类型错误,请重试"); + } + if (billManage.getBillState() != 3 && billManage.getBillState() != 4) { + throw new ServiceException("账单" + billManage.getBillNumber() + "状态错误无法完成付款,请刷新后重试"); + } + //校验金额是否满足付款,判断未收金额是否大于0 + if (billManage.getBillAmountUnsettled().compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "未收金额小于等于0,无法完成付款,请刷新后重试"); + } + //校验本次账单付款金额是否大于未收金额 + PaymentOrderDetailsDTO paymentOrderDetailsDTO = paymentOrderDetailsDTOList.stream().filter(item -> ObjectUtil.equal(billManage.getBillManageId(), item.getBillManageId())).findAny().orElse(null); + if(null == paymentOrderDetailsDTO){ + throw new ServiceException("账单" + billManage.getBillNumber() + "明细未找到"); + } + if (billManage.getBillAmountUnsettled().compareTo(paymentOrderDetailsDTO.getPaymentAmount()) < 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "付款金额大于剩余未收金额,无法完成付款,请刷新后重试"); + } + //校验剩余未收金额是否大于0 + if (paymentOrderDetailsDTO.getBillAmountUnsettledResidue().compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "剩余未付金额小于0,无法完成付款,请刷新后重试"); + } + }); + + + } + + /** + * 批量付款 + */ + public Boolean batchPayment(PaymentOrderDO paymentOrderDO) { + /* + 2024年7月16日第一版:每一个账单生成一个付款单 + */ + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList(); + if(paymentOrderDetailsDTOList == null || paymentOrderDetailsDTOList.size() == 0){ + throw new ServiceException("付款账单明细不能为空"); + } + Set bills = Stream.of(paymentOrderDO.getBillManageIds().split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,bills); + List billManageList = billManageDomainService.queryListLambda(queryWrapper); + if(billManageList ==null || billManageList.size()==0){ + throw new ServiceException("账单信息未找到"); + } + paymentOrderDO.setSettlementCustomersCode(billManageList.get(0).getSettlementCustomersCode()); + //处理数据 + handleData(paymentOrderDO); + paymentOrderDO.setPaymentSource(1); + //线下转账,默认转账成功 + paymentOrderDO.setPaymentState(3); + List paymentOrderList = new ArrayList<>(); + List paymentOrderDetailsList = new ArrayList<>(); + PaymentOrderDetails common = new PaymentOrderDetails(); + common.setCreateBy(loginUser.getUserPo().getUserId()); + common.setCreateTime(new Date()); + common.setCreateByName(loginUser.getUserPo().getUserName()); + common.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + common.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + common.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + //循环遍历,每个账单都生成一个付款单 + for (PaymentOrderDetailsDTO paymentOrderDetailsDTO : paymentOrderDetailsDTOList) { + BillManage billManage = billManageList.stream().filter(item -> ObjectUtil.equal(paymentOrderDetailsDTO.getBillManageId(), item.getBillManageId())).findAny().orElse(null); + if(null == billManage){ + throw new ServiceException("账单信息未找到,请重试"); + } + PaymentOrder paymentOrder = new PaymentOrder(); + BeanUtils.copyProperties(paymentOrderDO,paymentOrder); + paymentOrder.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + paymentOrder.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + paymentOrder.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + paymentOrder.setCreateBy(loginUser.getUserPo().getUserId()); + paymentOrder.setCreateByName(loginUser.getUserPo().getUserName()); + paymentOrder.setCreateTime(new Date()); + paymentOrder.setPaymentOrderNum(OrderSequence.getOrderCode("FK")); + paymentOrderDetailsDTO.setPaymentOrderNum(paymentOrder.getPaymentOrderNum()); + PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails(); + BeanUtils.copyProperties(common,paymentOrderDetails); + paymentOrderDetails.setBillNumber(billManage.getBillNumber()); + paymentOrderDetails.setBillManageId(billManage.getBillManageId()); + paymentOrderDetails.setBillAmount(billManage.getBillAmount()); + paymentOrderDetails.setPaymentAmount(paymentOrderDetailsDTO.getPaymentAmount()); + //已付金额 = 账单已付金额 + 本次付款金额 + paymentOrderDetails.setBillAmountSettlement(billManage.getBillAmountSettlement().add(paymentOrderDetailsDTO.getPaymentAmount())); + //剩余未付金额 = 账单剩余未付金额 - 本次付款金额 + paymentOrderDetails.setBillAmountUnsettledResidue(billManage.getBillAmountUnsettled().subtract(paymentOrderDetailsDTO.getPaymentAmount())); + paymentOrderDetails.setPaymentOrderNum(paymentOrder.getPaymentOrderNum()); + paymentOrderList.add(paymentOrder); + paymentOrderDetailsList.add(paymentOrderDetails); + } + if(paymentOrderList.size() > 0){ + //批量插入付款单 + Boolean flag = paymentOrderService.saveBatch(paymentOrderList); + if(flag){ + //循环paymentOrderList和paymentOrderDetailsList补充付款单ID + for (PaymentOrderDetails paymentOrderDetails : paymentOrderDetailsList) { + PaymentOrder paymentOrder = paymentOrderList.stream().filter(item -> ObjectUtil.equal(paymentOrderDetails.getPaymentOrderNum(), item.getPaymentOrderNum())).findAny().orElse(null); + if(null != paymentOrder){ + paymentOrderDetails.setPaymentOrderId(paymentOrder.getPaymentOrderId()); + } + } + } + //批量插入付款单明细 + Boolean flagTwo = paymentOrderDetailsService.saveBatch(paymentOrderDetailsList); + return flag && flagTwo; + } + + return false; + } + + /** + * 处理数据 + */ + private void handleData(PaymentOrderDO paymentOrderDO) { + //获取结算对象信息 + SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(paymentOrderDO.getSettlementCustomersCode()); + if (null != settlementCustomers) { + paymentOrderDO.setSettlementCustomersCode(settlementCustomers.getSettlementCustomersCode()); + paymentOrderDO.setSettlementEntity(settlementCustomers.getSettlementEntity()); + paymentOrderDO.setSettlementCustomersId(settlementCustomers.getSettlementCustomersId()); + paymentOrderDO.setBankName(settlementCustomers.getBankName()); + paymentOrderDO.setBankBindingName(settlementCustomers.getBankBindingName()); + paymentOrderDO.setBankCardNumber(settlementCustomers.getBankCardNumber()); + } + //获取支付通道 + List sysDictDataVoList = new ArrayList<>(); + AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.payment_channel.getCode()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class); + sysDictDataVoList.stream().filter(item -> ObjectUtil.equal(paymentOrderDO.getPaymentChannelCode(), item.getDictValue())).findAny().ifPresent(item -> { + paymentOrderDO.setPaymentChannelName(item.getDictLabel()); + }); + } + //收款方式、收款卡号 + if(StringUtils.isNotEmpty(paymentOrderDO.getPaymentMethodCode())){ + //查询收款方式 + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentOrderDO.getPaymentMethodCode()); + if(null == paymentManage){ + throw new ServiceException("收款方式信息未找到"); + } + paymentOrderDO.setPaymentMethod(paymentManage.getPaymentMethod()); + } + if(paymentOrderDO.getPaymentCardId() != null){ + //查询收款卡号 + PaymentWalletPO paymentWalletPO = paymentWalletDomainService.getInfo(paymentOrderDO.getPaymentCardId()); + if(null == paymentWalletPO){ + throw new ServiceException("收款卡信息未找到"); + } + paymentOrderDO.setPaymentCard(paymentWalletPO.getMainNumber()); + } + + } + + /** + * 根据id获取付款单 + */ + public PaymentOrderPO getInfoById(Long paymentOrderId) { + PaymentOrderPO paymentOrderPO = paymentOrderService.getInfo(paymentOrderId); + if(null == paymentOrderPO){ + throw new ServiceException("付款单详情信息未找到"); + } + PaymentOrderDetailsPO paymentOrderDetailsPO = paymentOrderDetailsService.getInfoByPaymentOrderId(paymentOrderId); + paymentOrderPO.setPaymentOrderDetailsPO(paymentOrderDetailsPO); + return paymentOrderPO; + } + + + public List getDetailsByBillManageId(Long billManageId) { + return paymentOrderService.getDetailsByBillManageId(billManageId); + } + + public List settlementAnalysisList(QueryWrapper queryWrapper) { + return paymentOrderService.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/entity/PaymentWallet.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/entity/PaymentWallet.java new file mode 100644 index 000000000..ef10d640a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/entity/PaymentWallet.java @@ -0,0 +1,74 @@ +package com.mhd.bms.domain.paymentWallet.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 支付钱包管理对象 payment_wallet + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentWallet extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付钱包管理id") + @TableId(type = IdType.AUTO) + private Long paymentWalletId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("主体编码(银行卡号、微信openid、支付宝openid等)") + @Excel(name = "主体编码", readConverterExp = "银=行卡号、微信openid、支付宝openid等") + private String mainNumber; + + @ApiModelProperty("主体名称") + @Excel(name = "主体名称") + private String mainName; + + @ApiModelProperty("银行名称") + @Excel(name = "银行名称") + private String bankName; + + @ApiModelProperty("开户行") + @Excel(name = "开户行") + private String bankDeposi; + + @ApiModelProperty("手机号") + @Excel(name = "手机号") + private String phone; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + @ApiModelProperty("支付方式id") + @Excel(name = "支付方式id") + private Long paymentManageId; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/facade/IPaymentWalletService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/facade/IPaymentWalletService.java new file mode 100644 index 000000000..70fc08131 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/facade/IPaymentWalletService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.paymentWallet.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.paymentWallet.entity.PaymentWallet; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; + +import java.util.List; + +/** + * 支付钱包管理Service接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface IPaymentWalletService extends IService +{ + /** + * 分页查询支付钱包管理列表 + */ + public List queryList(PaymentWalletDO paymentWalletDO); + + /** + * 新增支付钱包管理 + */ + public Boolean insert(PaymentWalletDO paymentWalletDO); + + /** + * 修改支付钱包管理 + */ + public Boolean update(PaymentWalletDO paymentWalletDO); + + /** + * 批量删除支付钱包管理 + */ + public Boolean delete(Long[] paymentWalletIds); + + + /** + * 查询支付钱包管理 + */ + public PaymentWalletPO getInfo(Long paymentWalletId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/mapper/PaymentWalletMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/mapper/PaymentWalletMapper.java new file mode 100644 index 000000000..fe300d111 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/mapper/PaymentWalletMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.paymentWallet.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.paymentWallet.entity.PaymentWallet; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import org.apache.ibatis.annotations.Param; +/** + * 支付钱包管理Mapper接口 + * + * @author gen + * @date 2024-07-09 + */ +public interface PaymentWalletMapper extends BaseMapper +{ + /** + * 查询支付钱包管理列表 + */ + public List queryList(PaymentWalletDO paymentWalletDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/persistence/PaymentWalletImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/persistence/PaymentWalletImpl.java new file mode 100644 index 000000000..46de625e0 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/persistence/PaymentWalletImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.paymentWallet.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.paymentWallet.entity.PaymentWallet; +import com.mhd.bms.domain.paymentWallet.repository.facade.IPaymentWalletService; +import com.mhd.bms.domain.paymentWallet.repository.mapper.PaymentWalletMapper; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 支付钱包管理Service业务层处理 + * + * @author gen + * @date 2024-07-09 + */ +@Service +public class PaymentWalletImpl extends ServiceImpl implements IPaymentWalletService{ + @Autowired + private PaymentWalletMapper paymentWalletMapper; + + /** + * 查询支付钱包管理列表 + */ + @Override + public List queryList(PaymentWalletDO paymentWalletDO) + { + return paymentWalletMapper.queryList(paymentWalletDO); + } + + /** + * 新增支付钱包管理 + */ + @Override + public Boolean insert(PaymentWalletDO paymentWalletDO) { + PaymentWallet paymentWallet = new PaymentWallet(); + BeanUtils.copyProperties(paymentWalletDO,paymentWallet); + return this.save(paymentWallet); + } + + /** + * 修改支付钱包管理 + */ + @Override + public Boolean update(PaymentWalletDO paymentWalletDO) { + PaymentWallet paymentWallet = new PaymentWallet(); + BeanUtils.copyProperties(paymentWalletDO,paymentWallet); + return this.updateById(paymentWallet); + } + + /** + * 批量删除支付钱包管理 + */ + @Override + public Boolean delete(Long[] paymentWalletIds ) { + List list = new ArrayList<>(); + for (Long id : paymentWalletIds) { + PaymentWallet paymentWallet = new PaymentWallet(); + paymentWallet.setPaymentWalletId(id); + paymentWallet.setDelFlag(2); + list.add(paymentWallet); + } + return this.updateBatchById(list); + } + + /** + * 修改支付钱包管理 + */ + @Override + public PaymentWalletPO getInfo(Long paymentWalletId) { + PaymentWallet paymentWallet = this.getById(paymentWalletId); + PaymentWalletPO paymentWalletPO = new PaymentWalletPO(); + BeanUtils.copyProperties(paymentWallet,paymentWalletPO); + return paymentWalletPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/po/PaymentWalletPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/po/PaymentWalletPO.java new file mode 100644 index 000000000..62a440865 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/po/PaymentWalletPO.java @@ -0,0 +1,74 @@ +package com.mhd.bms.domain.paymentWallet.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 支付钱包管理对象 payment_wallet + * + * @author gen + * @date 2024-07-09 + */ + +@Data +@ApiModel(value = "支付钱包管理对象", description = "支付钱包管理响应对象") +public class PaymentWalletPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付钱包管理id") + private Long paymentWalletId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("主体编码(银行卡号、微信openid、支付宝openid等)") + @Excel(name = "主体编码", readConverterExp = "银=行卡号、微信openid、支付宝openid等") + private String mainNumber; + + @ApiModelProperty("主体名称") + @Excel(name = "主体名称") + private String mainName; + + @ApiModelProperty("银行名称") + @Excel(name = "银行名称") + private String bankName; + + @ApiModelProperty("开户行") + @Excel(name = "开户行") + private String bankDeposi; + + @ApiModelProperty("手机号") + @Excel(name = "手机号") + private String phone; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + @ApiModelProperty("支付方式id") + @Excel(name = "支付方式id") + private Long paymentManageId; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/todo/PaymentWalletDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/todo/PaymentWalletDO.java new file mode 100644 index 000000000..1968dacf9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/repository/todo/PaymentWalletDO.java @@ -0,0 +1,77 @@ +package com.mhd.bms.domain.paymentWallet.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 支付钱包管理对象 payment_wallet + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentWalletDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付钱包管理id") + private Long paymentWalletId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("主体编码(银行卡号、微信openid、支付宝openid等)") + @Excel(name = "主体编码", readConverterExp = "银=行卡号、微信openid、支付宝openid等") + private String mainNumber; + + @ApiModelProperty("主体名称") + @Excel(name = "主体名称") + private String mainName; + + @ApiModelProperty("银行名称") + @Excel(name = "银行名称") + private String bankName; + + @ApiModelProperty("开户行") + @Excel(name = "开户行") + private String bankDeposi; + + @ApiModelProperty("手机号") + @Excel(name = "手机号") + private String phone; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + @ApiModelProperty("支付方式id") + @Excel(name = "支付方式id") + private Long paymentManageId; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/service/PaymentWalletDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/service/PaymentWalletDomainService.java new file mode 100644 index 000000000..40373fa61 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/paymentWallet/service/PaymentWalletDomainService.java @@ -0,0 +1,64 @@ +package com.mhd.bms.domain.paymentWallet.service; + +import com.mhd.bms.domain.paymentWallet.repository.facade.IPaymentWalletService; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 支付钱包管理 + * + * @author gen + * @date 2024-07-09 + */ +@Service +@Slf4j +public class PaymentWalletDomainService { + + @Autowired + private IPaymentWalletService paymentWalletService; + + + /** + * 分页查询支付钱包管理列表 + */ + public List queryList(PaymentWalletDO paymentWalletDO) { + return paymentWalletService.queryList(paymentWalletDO); + } + + + /** + * 新增支付钱包管理 + */ + public Boolean insert(PaymentWalletDO paymentWalletDO) { + + return paymentWalletService.insert(paymentWalletDO); + } + + /** + * 修改支付钱包管理 + */ + public Boolean update(PaymentWalletDO paymentWalletDO) { + return paymentWalletService.update(paymentWalletDO); + } + + /** + * 批量删除支付钱包管理 + */ + public Boolean delete(Long[] paymentWalletIds) { + return paymentWalletService.delete(paymentWalletIds); + } + + /** + * 获取支付钱包管理详细信息 + */ + public PaymentWalletPO getInfo(Long paymentWalletId) + { + return paymentWalletService.getInfo(paymentWalletId); + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptDetail.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptDetail.java new file mode 100644 index 000000000..37ae4c1d2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptDetail.java @@ -0,0 +1,82 @@ +package com.mhd.bms.domain.receiptManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 收款单详情对象 receipt_detail + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptDetail extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + @TableId(type = IdType.AUTO) + private Long receiptDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单id") + @Excel(name = "账单id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("剩余未收金额") + @Excel(name = "剩余未收金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("收款单id") + @Excel(name = "收款单id") + private Long receiptManageId; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptManage.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptManage.java new file mode 100644 index 000000000..ff9ae7bf1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/entity/ReceiptManage.java @@ -0,0 +1,139 @@ +package com.mhd.bms.domain.receiptManage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * 收款单管理对象 receipt_manage + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptManage extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + @TableId(type = IdType.AUTO) + private Long receiptManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("剩余未收") + @Excel(name = "剩余未收") + private BigDecimal uncollectedAmount; + + @ApiModelProperty("收款方式code") + @Excel(name = "收款方式code") + private String paymentMethodCode; + + @ApiModelProperty("收款方式") + @Excel(name = "收款方式") + private String paymentMethod; + + @ApiModelProperty("收款卡号id") + @Excel(name = "收款卡号id") + private Long paymentCardId; + + @ApiModelProperty("收款卡号") + @Excel(name = "收款卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("收据号") + @Excel(name = "收据号") + private String receiptNumber; + + @ApiModelProperty("收款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date collectionTime; + + @ApiModelProperty("收款凭证") + @Excel(name = "收款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String collectionRemark; + + @ApiModelProperty(name = "收款人用户ID") + private Long payeeUserId; + + @ApiModelProperty("收款人") + private String payeeName; + + @ApiModelProperty("退款金额") + private BigDecimal refundAmount; + + @ApiModelProperty("退款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date refundTime; + + @ApiModelProperty("收款状态(1-正常,2-退款)") + private Integer paymentStatus; + + @ApiModelProperty("收款来源(1-人工付款,2-线上支付)") + private Integer collectionSource; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptDetailService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptDetailService.java new file mode 100644 index 000000000..c82681231 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptDetailService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.receiptManage.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptDetailDO; + +import java.util.List; + +/** + * 收款单详情Service接口 + * + * @author gen + * @date 2024-07-08 + */ +public interface IReceiptDetailService extends IService +{ + /** + * 分页查询收款单详情列表 + */ + public List queryList(ReceiptDetailDO receiptDetailDO); + + /** + * 新增收款单详情 + */ + public Boolean insert(ReceiptDetailDO receiptDetailDO); + + /** + * 修改收款单详情 + */ + public Boolean update(ReceiptDetailDO receiptDetailDO); + + /** + * 批量删除收款单详情 + */ + public Boolean delete(Long[] receiptDetailIds); + + + /** + * 查询收款单详情 + */ + public ReceiptDetailPO getInfo(Long receiptDetailId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptManageService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptManageService.java new file mode 100644 index 000000000..5962f1547 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/facade/IReceiptManageService.java @@ -0,0 +1,49 @@ +package com.mhd.bms.domain.receiptManage.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; + +import java.util.List; + +/** + * 收款单管理Service接口 + * + * @author gen + * @date 2024-07-08 + */ +public interface IReceiptManageService extends IService +{ + /** + * 分页查询收款单管理列表 + */ + public List queryList(ReceiptManageDO receiptManageDO); + + /** + * 新增收款单管理 + */ + public Boolean insert(ReceiptManageDO receiptManageDO); + + /** + * 修改收款单管理 + */ + public Boolean update(ReceiptManageDO receiptManageDO); + + /** + * 批量删除收款单管理 + */ + public Boolean delete(Long[] receiptManageIds); + + + /** + * 查询收款单管理 + */ + public ReceiptManagePO getInfo(Long receiptManageId); + + /** + * 根据账单id查询账单收款记录信息 + */ + List getDetailsByBillManageId(Long billManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptDetailMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptDetailMapper.java new file mode 100644 index 000000000..2c86c696d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptDetailMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.receiptManage.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptDetailDO; +import org.apache.ibatis.annotations.Param; +/** + * 收款单详情Mapper接口 + * + * @author gen + * @date 2024-07-08 + */ +public interface ReceiptDetailMapper extends BaseMapper +{ + /** + * 查询收款单详情列表 + */ + public List queryList(@Param("receiptDetailDO") ReceiptDetailDO receiptDetailDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptManageMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptManageMapper.java new file mode 100644 index 000000000..5c601ae4a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/mapper/ReceiptManageMapper.java @@ -0,0 +1,28 @@ +package com.mhd.bms.domain.receiptManage.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import org.apache.ibatis.annotations.Param; +/** + * 收款单管理Mapper接口 + * + * @author gen + * @date 2024-07-08 + */ +public interface ReceiptManageMapper extends BaseMapper +{ + /** + * 查询收款单管理列表 + */ + public List queryList(@Param("receiptManageDO") ReceiptManageDO receiptManageDO); + + /** + * 根据账单id查询账单收款记录信息 + */ + List getDetailsByBillManageId(@Param("billManageId") Long billManageId); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptDetailImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptDetailImpl.java new file mode 100644 index 000000000..0ccd9006d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptDetailImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.receiptManage.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.repository.facade.IReceiptDetailService; +import com.mhd.bms.domain.receiptManage.repository.mapper.ReceiptDetailMapper; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptDetailDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 收款单详情Service业务层处理 + * + * @author gen + * @date 2024-07-08 + */ +@Service +public class ReceiptDetailImpl extends ServiceImpl implements IReceiptDetailService { + @Autowired + private ReceiptDetailMapper receiptDetailMapper; + + /** + * 查询收款单详情列表 + */ + @Override + public List queryList(ReceiptDetailDO receiptDetailDO) + { + return receiptDetailMapper.queryList(receiptDetailDO); + } + + /** + * 新增收款单详情 + */ + @Override + public Boolean insert(ReceiptDetailDO receiptDetailDO) { + ReceiptDetail receiptDetail = new ReceiptDetail(); + BeanUtils.copyProperties(receiptDetailDO,receiptDetail); + return this.save(receiptDetail); + } + + /** + * 修改收款单详情 + */ + @Override + public Boolean update(ReceiptDetailDO receiptDetailDO) { + ReceiptDetail receiptDetail = new ReceiptDetail(); + BeanUtils.copyProperties(receiptDetailDO,receiptDetail); + return this.updateById(receiptDetail); + } + + /** + * 批量删除收款单详情 + */ + @Override + public Boolean delete(Long[] receiptDetailIds ) { + List list = new ArrayList<>(); + for (Long id : receiptDetailIds) { + ReceiptDetail receiptDetail = new ReceiptDetail(); + receiptDetail.setReceiptDetailId(id); + receiptDetail.setDelFlag(2); + list.add(receiptDetail); + } + return this.updateBatchById(list); + } + + /** + * 修改收款单详情 + */ + @Override + public ReceiptDetailPO getInfo(Long receiptDetailId) { + ReceiptDetail receiptDetail = this.getById(receiptDetailId); + ReceiptDetailPO receiptDetailPO = new ReceiptDetailPO(); + BeanUtils.copyProperties(receiptDetail,receiptDetailPO); + return receiptDetailPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptManageImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptManageImpl.java new file mode 100644 index 000000000..fa824538c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/persistence/ReceiptManageImpl.java @@ -0,0 +1,92 @@ +package com.mhd.bms.domain.receiptManage.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.repository.facade.IReceiptManageService; +import com.mhd.bms.domain.receiptManage.repository.mapper.ReceiptManageMapper; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 收款单管理Service业务层处理 + * + * @author gen + * @date 2024-07-08 + */ +@Service +public class ReceiptManageImpl extends ServiceImpl implements IReceiptManageService{ + @Autowired + private ReceiptManageMapper receiptManageMapper; + + /** + * 查询收款单管理列表 + */ + @Override + public List queryList(ReceiptManageDO receiptManageDO) + { + return receiptManageMapper.queryList(receiptManageDO); + } + + /** + * 新增收款单管理 + */ + @Override + public Boolean insert(ReceiptManageDO receiptManageDO) { + ReceiptManage receiptManage = new ReceiptManage(); + BeanUtils.copyProperties(receiptManageDO,receiptManage); + return this.save(receiptManage); + } + + /** + * 修改收款单管理 + */ + @Override + public Boolean update(ReceiptManageDO receiptManageDO) { + ReceiptManage receiptManage = new ReceiptManage(); + BeanUtils.copyProperties(receiptManageDO,receiptManage); + return this.updateById(receiptManage); + } + + /** + * 批量删除收款单管理 + */ + @Override + public Boolean delete(Long[] receiptManageIds ) { + List list = new ArrayList<>(); + for (Long id : receiptManageIds) { + ReceiptManage receiptManage = new ReceiptManage(); + receiptManage.setReceiptManageId(id); + receiptManage.setDelFlag(2); + list.add(receiptManage); + } + return this.updateBatchById(list); + } + + /** + * 修改收款单管理 + */ + @Override + public ReceiptManagePO getInfo(Long receiptManageId) { + ReceiptManage receiptManage = this.getById(receiptManageId); + ReceiptManagePO receiptManagePO = new ReceiptManagePO(); + BeanUtils.copyProperties(receiptManage,receiptManagePO); + return receiptManagePO; + } + + + /** + * 根据账单id查询账单收款记录信息 + */ + @Override + public List getDetailsByBillManageId(Long billManageId) { + return receiptManageMapper.getDetailsByBillManageId(billManageId); + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptDetailPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptDetailPO.java new file mode 100644 index 000000000..ff834b098 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptDetailPO.java @@ -0,0 +1,142 @@ +package com.mhd.bms.domain.receiptManage.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * 收款单详情对象 receipt_detail + * + * @author gen + * @date 2024-07-08 + */ + +@Data +@ApiModel(value = "收款单详情对象", description = "收款单详情响应对象") +public class ReceiptDetailPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单id") + @Excel(name = "账单id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("剩余未收金额") + @Excel(name = "剩余未收金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("收款金额(实收金额)") + @Excel(name = "收款金额(实收金额)") + private BigDecimal collectedAmount; + + @ApiModelProperty("收款总金额") + @Excel(name = "收款总金额") + private BigDecimal collectedTotaAmount; + + @ApiModelProperty("收款单id") + @Excel(name = "收款单id") + private Long receiptManageId; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("收款方式code") + @Excel(name = "收款方式code") + private String paymentMethodCode; + + @ApiModelProperty("收款方式") + @Excel(name = "收款方式") + private String paymentMethod; + + @ApiModelProperty("收款卡号id") + @Excel(name = "收款卡号id") + private Long paymentCardId; + + @ApiModelProperty("收款卡号") + @Excel(name = "收款卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("收据号") + @Excel(name = "收据号") + private String receiptNumber; + + @ApiModelProperty("收款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date collectionTime; + + @ApiModelProperty("收款凭证") + @Excel(name = "收款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String collectionRemark; + + @ApiModelProperty(name = "收款人用户ID") + private Long payeeUserId; + @ApiModelProperty("收款人") + private String payeeName; + + @ApiModelProperty("收款来源(1-人工付款,2-线上支付)") + private Integer collectionSource; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptManagePO.java new file mode 100644 index 000000000..476f81de6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/po/ReceiptManagePO.java @@ -0,0 +1,144 @@ +package com.mhd.bms.domain.receiptManage.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.List; + +import com.mhd.common.core.web.domain.BaseVOEntity; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * 收款单管理对象 receipt_manage + * + * @author gen + * @date 2024-07-08 + */ + +@Data +@ApiModel(value = "收款单管理对象", description = "收款单管理响应对象") +public class ReceiptManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("剩余未收") + @Excel(name = "剩余未收") + private BigDecimal uncollectedAmount; + + @ApiModelProperty("收款方式code") + @Excel(name = "收款方式code") + private String paymentMethodCode; + + @ApiModelProperty("收款方式") + @Excel(name = "收款方式") + private String paymentMethod; + + @ApiModelProperty("收款卡号id") + @Excel(name = "收款卡号id") + private Long paymentCardId; + + @ApiModelProperty("收款卡号") + @Excel(name = "收款卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("收据号") + @Excel(name = "收据号") + private String receiptNumber; + + @ApiModelProperty("收款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date collectionTime; + + @ApiModelProperty("收款凭证") + @Excel(name = "收款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String collectionRemark; + + @ApiModelProperty(name = "收款人用户ID") + private Long payeeUserId; + @ApiModelProperty("收款人") + private String payeeName; + + @ApiModelProperty("退款金额") + private BigDecimal refundAmount; + + @ApiModelProperty("退款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date refundTime; + + @ApiModelProperty("收款状态(1-正常,2-退款)") + private Integer paymentStatus; + + @ApiModelProperty("收款账单明细") + private List receiptDetailPOList; + + @ApiModelProperty("收款来源(1-人工付款,2-线上支付)") + private Integer collectionSource; + + @ApiModelProperty("账单编号") + private String billNumbers; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptDetailDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptDetailDO.java new file mode 100644 index 000000000..32b699e61 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptDetailDO.java @@ -0,0 +1,85 @@ +package com.mhd.bms.domain.receiptManage.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 收款单详情对象 receipt_detail + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptDetailDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单id") + @Excel(name = "账单id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("剩余未收金额") + @Excel(name = "剩余未收金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("收款单id") + @Excel(name = "收款单id") + private Long receiptManageId; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptManageDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptManageDO.java new file mode 100644 index 000000000..a860af0e6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/repository/todo/ReceiptManageDO.java @@ -0,0 +1,168 @@ +package com.mhd.bms.domain.receiptManage.repository.todo; + +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.List; + + +/** + * 收款单管理对象 receipt_manage + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptManageDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("剩余未收") + @Excel(name = "剩余未收") + private BigDecimal uncollectedAmount; + + @ApiModelProperty("收款方式code") + @Excel(name = "收款方式code") + private String paymentMethodCode; + + @ApiModelProperty("收款方式") + @Excel(name = "收款方式") + private String paymentMethod; + + @ApiModelProperty("收款卡号id") + @Excel(name = "收款卡号id") + private Long paymentCardId; + + @ApiModelProperty("收款卡号") + @Excel(name = "收款卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("收据号") + @Excel(name = "收据号") + private String receiptNumber; + + @ApiModelProperty("收款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date collectionTime; + + @ApiModelProperty("收款凭证") + @Excel(name = "收款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String collectionRemark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("账单管理ids") + private String billManageIds; + + @ApiModelProperty("账单管理ids") + private List receiptDetailDTOList; + + @ApiModelProperty(name = "收款人用户ID") + private Long payeeUserId; + @ApiModelProperty("收款人") + private String payeeName; + + @ApiModelProperty("退款金额") + private BigDecimal refundAmount; + + @ApiModelProperty("退款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date refundTime; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + @ApiModelProperty(name = "收款时间查询条件开始日期") + private String collectionTimeStart; + @ApiModelProperty(name = "收款时间查询条件结束日期") + private String collectionTimeEnd; + + @ApiModelProperty("收款状态(1-正常,2-退款)") + private Integer paymentStatus; + + @ApiModelProperty(name = "支付密码") + private String payPassword; + + @ApiModelProperty("收款单ids") + private String receiptManageIds; + + @ApiModelProperty("收款状态(1-正常,2-退款)") + private Integer collectionSource; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptDetailDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptDetailDomainService.java new file mode 100644 index 000000000..7b6d93988 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptDetailDomainService.java @@ -0,0 +1,100 @@ +package com.mhd.bms.domain.receiptManage.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.repository.facade.IReceiptDetailService; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptDetailDO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +/** + * 收款单详情 + * + * @author gen + * @date 2024-07-08 + */ +@Service +@Slf4j +public class ReceiptDetailDomainService { + + @Autowired + private IReceiptDetailService receiptDetailService; + + + /** + * 分页查询收款单详情列表 + */ + public List queryList(ReceiptDetailDO receiptDetailDO) { + return receiptDetailService.queryList(receiptDetailDO); + } + + + /** + * 新增收款单详情 + */ + public Boolean insert(ReceiptDetailDO receiptDetailDO) { + + return receiptDetailService.insert(receiptDetailDO); + } + + /** + * 修改收款单详情 + */ + public Boolean update(ReceiptDetailDO receiptDetailDO) { + return receiptDetailService.update(receiptDetailDO); + } + + /** + * 批量删除收款单详情 + */ + public Boolean delete(Long[] receiptDetailIds) { + return receiptDetailService.delete(receiptDetailIds); + } + + /** + * 获取收款单详情详细信息 + */ + public ReceiptDetailPO getInfo(Long receiptDetailId) + { + return receiptDetailService.getInfo(receiptDetailId); + } + + + public Boolean saveBatch(List receiptDetails) { + return receiptDetailService.saveBatch(receiptDetails); + } + + public List queryListByLambda(LambdaQueryWrapper queryWrapperDetail) { + return receiptDetailService.list(queryWrapperDetail); + } + + public List getDetailsByReceiptManageId(Long receiptManageId) { + List receiptDetailPOList = new ArrayList<>(); + LambdaQueryWrapper queryWrapperDetail = new LambdaQueryWrapper<>(); + queryWrapperDetail.eq(ReceiptDetail::getReceiptManageId, receiptManageId); + queryWrapperDetail.eq(ReceiptDetail::getDelFlag, 1); + List receiptDetailList = receiptDetailService.list(queryWrapperDetail); + if(receiptDetailList != null && receiptDetailList.size() > 0){ + //复制集合receiptDetailList到返回值receiptDetailPOList中 + for (ReceiptDetail receiptDetail : receiptDetailList) { + ReceiptDetailPO receiptDetailPO = new ReceiptDetailPO(); + BeanUtils.copyProperties(receiptDetail, receiptDetailPO); + receiptDetailPOList.add(receiptDetailPO); + } + } + return receiptDetailPOList; + } + + public List queryListByIdSet(Set orderIdSet) { + LambdaQueryWrapper queryWrapperDetail = new LambdaQueryWrapper<>(); + queryWrapperDetail.in(ReceiptDetail::getReceiptManageId, orderIdSet); + return receiptDetailService.list(queryWrapperDetail); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptManageDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptManageDomainService.java new file mode 100644 index 000000000..93857f3fb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/receiptManage/service/ReceiptManageDomainService.java @@ -0,0 +1,315 @@ +package com.mhd.bms.domain.receiptManage.service; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billManage.service.BillManageDomainService; +import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService; +import com.mhd.bms.domain.paymentManage.entity.PaymentManage; +import com.mhd.bms.domain.paymentManage.service.PaymentManageDomainService; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.domain.paymentWallet.service.PaymentWalletDomainService; +import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail; +import com.mhd.bms.domain.receiptManage.entity.ReceiptManage; +import com.mhd.bms.domain.receiptManage.repository.facade.IReceiptManageService; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptDetailPO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.infrastructure.constant.BillLogsConstants; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.UserServiceFeign; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 收款单管理 + * + * @author gen + * @date 2024-07-08 + */ +@Service +@Slf4j +public class ReceiptManageDomainService { + + @Autowired + private IReceiptManageService receiptManageService; + @Autowired + private BillManageDomainService billManageDomainService; + @Autowired + private UserServiceFeign userServiceFeign; + @Autowired + private ReceiptDetailDomainService receiptDetailDomainService; + @Autowired + private PaymentManageDomainService paymentManageDomainService; + @Autowired + private PaymentWalletDomainService paymentWalletDomainService; + @Autowired + private BillOperationLogDomainService billOperationLogDomainService; + + + /** + * 分页查询收款单管理列表 + */ + public List queryList(ReceiptManageDO receiptManageDO) { + return receiptManageService.queryList(receiptManageDO); + } + + + /** + * 新增收款单管理 + */ + public Boolean insert(ReceiptManageDO receiptManageDO) { + + return receiptManageService.insert(receiptManageDO); + } + + /** + * 修改收款单管理 + */ + public Boolean update(ReceiptManageDO receiptManageDO) { + return receiptManageService.update(receiptManageDO); + } + + /** + * 批量删除收款单管理 + */ + public Boolean delete(Long[] receiptManageIds) { + return receiptManageService.delete(receiptManageIds); + } + + /** + * 获取收款单管理详细信息 + */ + public ReceiptManagePO getInfo(Long receiptManageId) + { + return receiptManageService.getInfo(receiptManageId); + } + + + /** + * 校验结算状态是否合规 + */ + public void checkSettlementStatus(ReceiptManageDO receiptManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Set bills = Stream.of(receiptManageDO.getBillManageIds()).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(BillManage::getBillManageId,bills); + List billManageList = billManageDomainService.queryListLambda(queryWrapper); + if(billManageList ==null || billManageList.size()==0){ + throw new ServiceException("账单信息未找到"); + } + List receiptDetailDTOList = receiptManageDO.getReceiptDetailDTOList(); + billManageList.forEach(billManage -> { + if(billManage.getBillType() != 1){ + throw new ServiceException("账单" + billManage.getBillNumber() + "收付类型错误,请重试"); + } + if (billManage.getBillState() != 3 && billManage.getBillState() != 4) { + throw new ServiceException("账单" + billManage.getBillNumber() + "状态错误无法完成收款,请刷新后重试"); + } + //校验金额是否满足收款,判断未收金额是否大于0 + if (billManage.getBillAmountUnsettled().compareTo(BigDecimal.ZERO) <= 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "未收金额小于等于0,无法完成收款,请刷新后重试"); + } + //校验本次账单收款金额是否大于未收金额 + ReceiptDetailDTO receiptDetailDTO = receiptDetailDTOList.stream().filter(item -> ObjectUtil.equal(billManage.getBillManageId(), item.getBillManageId())).findAny().orElse(null); + if(null == receiptDetailDTO){ + throw new ServiceException("账单" + billManage.getBillNumber() + "明细未找到"); + } + if (billManage.getBillAmountUnsettled().compareTo(receiptDetailDTO.getCollectedAmount()) < 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "未收金额小于本次收款金额,无法完成收款,请刷新后重试"); + } + //校验剩余未收金额是否大于0 + if (receiptDetailDTO.getBillAmountUnsettledResidue().compareTo(BigDecimal.ZERO) < 0) { + throw new ServiceException("账单" + billManage.getBillNumber() + "剩余未收金额小于0,无法完成收款,请刷新后重试"); + } + }); + } + + + /** + * 批量保存结算单 + */ + public Boolean batchCollection(ReceiptManageDO receiptManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List receiptDetailPOList = receiptManageDO.getReceiptDetailDTOList(); + if(receiptDetailPOList == null || receiptDetailPOList.size()==0){ + throw new ServiceException("费用结算明细不能为空"); + } + //校验账单总金额是否对账,计算结算单账单金额是否等于已收金额加 收款优惠 加 收款金额 加剩余未收金额 + if(receiptManageDO.getBillAmount().compareTo(receiptManageDO.getBillAmountSettlement().add(receiptManageDO.getUncollectedAmount()).add(receiptManageDO.getCollectedDiscount()).add(receiptManageDO.getCollectedAmount())) != 0){ + throw new ServiceException("结算单金额不匹配,请刷新后重试"); + } + //处理数据 + handleData(receiptManageDO); + receiptManageDO.setCollectionNum(OrderSequence.getOrderCode("JSSK")); + receiptManageDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + receiptManageDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + receiptManageDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + receiptManageDO.setCreateBy(loginUser.getUserPo().getUserId()); + receiptManageDO.setCreateByName(loginUser.getUserPo().getUserName()); + receiptManageDO.setCreateTime(new Date()); + ReceiptManage receiptManage = new ReceiptManage(); + BeanUtils.copyProperties(receiptManageDO,receiptManage); + Boolean flagTwo = receiptManageService.save(receiptManage); + List receiptDetails = new ArrayList<>(); + for (ReceiptDetailDTO receiptDetailDTO : receiptDetailPOList) { + //计算账单金额是否等于已收金额加 收款优惠 加 收款金额 加剩余未收金额 + if(receiptDetailDTO.getBillAmount().compareTo(receiptDetailDTO.getBillAmountSettlement().add(receiptDetailDTO.getBillAmountUnsettledResidue()).add(receiptDetailDTO.getCollectedDiscount()).add(receiptDetailDTO.getCollectedAmount())) != 0){ + throw new ServiceException("账单"+ receiptDetailDTO.getBillNumber() +"金额不匹配,请刷新后重试"); + } + ReceiptDetail receiptDetail = new ReceiptDetail(); + BeanUtils.copyProperties(receiptDetailDTO,receiptDetail); + receiptDetail.setCollectionNum(receiptManage.getCollectionNum()); + receiptDetail.setReceiptManageId(receiptManage.getReceiptManageId()); + receiptDetail.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + receiptDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + receiptDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + receiptDetail.setCreateBy(loginUser.getUserPo().getUserId()); + receiptDetail.setCreateByName(loginUser.getUserPo().getUserName()); + receiptDetail.setCreateTime(new Date()); + receiptDetails.add(receiptDetail); + } + Boolean flag = receiptDetailDomainService.saveBatch(receiptDetails); + return flag && flagTwo; + } + + /** + * 处理数据封装 + */ + private void handleData(ReceiptManageDO receiptManageDO) { + if(receiptManageDO.getPayeeUserId() == null){ + throw new ServiceException("收款人信息不能为空"); + } + AjaxResult ajaxResult = userServiceFeign.getInfo(receiptManageDO.getPayeeUserId()); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + UserPo userPo = JSONUtil.toBean(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); + receiptManageDO.setPayeeName(userPo.getUserName()); + } + //收款方式、收款卡号 + if(StringUtils.isNotEmpty(receiptManageDO.getPaymentMethodCode())){ + //查询收款方式 + PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(receiptManageDO.getPaymentMethodCode()); + if(null == paymentManage){ + throw new ServiceException("收款方式信息未找到"); + } + receiptManageDO.setPaymentMethod(paymentManage.getPaymentMethod()); + } + if(receiptManageDO.getPaymentCardId() != null){ + //查询收款卡号 + PaymentWalletPO paymentWalletPO = paymentWalletDomainService.getInfo(receiptManageDO.getPaymentCardId()); + if(null == paymentWalletPO){ + throw new ServiceException("收款卡信息未找到"); + } + receiptManageDO.setPaymentCard(paymentWalletPO.getMainNumber()); + } + } + + + /** + * 根据账单id查询账单收款记录信息 + */ + public List getDetailsByBillManageId(Long billManageId) { + return receiptManageService.getDetailsByBillManageId(billManageId); + } + + + /** + * 退款 + */ + public Boolean refund(ReceiptManageDO receiptManageDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + Set receiptManageIds = Stream.of(receiptManageDO.getReceiptManageIds().split(",")).collect(Collectors.toSet()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ReceiptManage::getReceiptManageId, receiptManageIds); + List receiptManageList = receiptManageService.list(queryWrapper); + if(receiptManageList == null || receiptManageList.size()==0){ + throw new ServiceException("收款单信息未找到"); + } + //查询账单列表 + LambdaQueryWrapper queryWrapperDetail = new LambdaQueryWrapper<>(); + queryWrapperDetail.in(ReceiptDetail::getReceiptManageId, receiptManageIds); + List receiptDetails = receiptDetailDomainService.queryListByLambda(queryWrapperDetail); + if(null == receiptDetails || receiptDetails.size()==0){ + throw new ServiceException("收款单明细信息未找到"); + } + //TODO 执行退款操作 + + //修改账单状态 + List billManageList = new ArrayList<>(); + for (ReceiptDetail receiptDetail : receiptDetails) { + BillManage billManageUpdate = new BillManage(); + billManageUpdate.setBillManageId(receiptDetail.getBillManageId()); + billManageUpdate.setBillState(7); + billManageUpdate.setUpdateBy(loginUser.getUserPo().getUserId()); + billManageUpdate.setUpdateTime(new Date()); + billManageUpdate.setUpdateByName(loginUser.getUserPo().getUserName()); + billManageList.add(billManageUpdate); + } + + List receiptManageSaveList = new ArrayList<>(); + for (ReceiptManage receiptManage : receiptManageList) { + //修改退款后结算单状态 + ReceiptManage receiptManageSave = new ReceiptManage(); + receiptManageSave.setReceiptManageId(receiptManage.getReceiptManageId()); + receiptManageSave.setPaymentStatus(2); + receiptManageSave.setRefundTime(new Date()); + receiptManageSave.setRefundAmount(receiptManage.getCollectedAmount()); + receiptManageSaveList.add(receiptManageSave); + } + Boolean flag = receiptManageService.updateBatchById(receiptManageSaveList); + Boolean flagTwo = billManageDomainService.saveRefundLogs(receiptDetails); + Boolean flagThree = billManageDomainService.updateBatchById(billManageList); + return flag && flagTwo && flagThree; + } + + /** + * 查询收款单详情 + */ + public ReceiptManagePO getDetailsInfo(Long receiptManageId) { + ReceiptManagePO receiptManagePO = receiptManageService.getInfo(receiptManageId); + List receiptDetailPOList = receiptDetailDomainService.getDetailsByReceiptManageId(receiptManageId); + if(null != receiptManagePO){ + receiptManagePO.setReceiptDetailPOList(receiptDetailPOList); + } + return receiptManagePO; + } + + public List settlementAnalysisList(QueryWrapper queryWrapper) { + return receiptManageService.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryManage.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryManage.java new file mode 100644 index 000000000..7e7e0a9ac --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryManage.java @@ -0,0 +1,56 @@ +package com.mhd.bms.domain.reportForm.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 查询条件管理对象 form_query_manage + * + * @author gen + * @date 2024-07-26 + */ + +@Data +public class FormQueryManage extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("查询条件管理id") + @TableId(type = IdType.AUTO) + private Long formQueryManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("查询条件名称") + @Excel(name = "查询条件名称") + private String formQueryName; + + @ApiModelProperty("所属报表类型((1-综合分析报表,2-账单分析报表,3-结算分析报表))") + @Excel(name = "所属报表类型", readConverterExp = "(=1-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("默认状态(1-是,2-否)") + private Integer defaultFlag; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryParams.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryParams.java new file mode 100644 index 000000000..7a9a9b56e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/FormQueryParams.java @@ -0,0 +1,75 @@ +package com.mhd.bms.domain.reportForm.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 报查询条件管理对象 form_query_params + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class FormQueryParams extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询条件id") + @TableId(type = IdType.AUTO) + private Long formQueryParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("字段编码") + @Excel(name = "字段编码") + private String field; + + @ApiModelProperty("字段名称") + @Excel(name = "字段名称") + private String fieldName; + + @ApiModelProperty("过滤方法(1-=,2-!=,3->,4->=,5-<,6-<=,7-包含,8-不包含,9-在列表,10-不在列表)") + private Integer filterMethod; + + @ApiModelProperty("输入框值") + @Excel(name = "输入框值") + private String inputBoxText; + + + @ApiModelProperty("输入框类型(1-文本,2-下拉框,3-日期选择器)") + @Excel(name = "输入框类型", readConverterExp = "1=-文本,2-下拉框,3-日期选择器") + private Integer inputBoxType; + + @ApiModelProperty("关系(1-并且,2-或者)") + @Excel(name = "关系", readConverterExp = "1=-并且,2-或者") + private Integer queryRelation; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("查询条件json(前端保存用)") + private String paramsInfoJson; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/ReportForm.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/ReportForm.java new file mode 100644 index 000000000..c0c3fbc19 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/entity/ReportForm.java @@ -0,0 +1,66 @@ +package com.mhd.bms.domain.reportForm.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 分析报管理对象 report_form + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class ReportForm extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询id") + @TableId(type = IdType.AUTO) + private Long reportFormId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("报表名称") + @Excel(name = "报表名称") + private String reportFormName; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("描述") + @Excel(name = "描述") + private String formDescribe; + + @ApiModelProperty("创建人") + @Excel(name = "创建人") + private String createFormName; + + @ApiModelProperty("查询条件json") + @Excel(name = "查询条件json") + private String queryParamJson; + + @ApiModelProperty("报表类型(1-综合分析报表,2-账单分析报表,3-结算分析报表)") + @Excel(name = "报表类型", readConverterExp = "1=-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryManageService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryManageService.java new file mode 100644 index 000000000..aac6ca07a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryManageService.java @@ -0,0 +1,46 @@ +package com.mhd.bms.domain.reportForm.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; + +import java.util.List; + +/** + * 查询条件管理Service接口 + * + * @author gen + * @date 2024-07-26 + */ +public interface IFormQueryManageService extends IService +{ + /** + * 分页查询查询条件管理列表 + */ + public List queryList(FormQueryManageDO formQueryManageDO); + + /** + * 新增查询条件管理 + */ + public Boolean insert(FormQueryManageDO formQueryManageDO); + + /** + * 修改查询条件管理 + */ + public Boolean update(FormQueryManageDO formQueryManageDO); + + /** + * 批量删除查询条件管理 + */ + public Boolean delete(Long[] formQueryManageIds); + + + /** + * 查询查询条件管理 + */ + public FormQueryManagePO getInfo(Long formQueryManageId); + + List queryListAll(); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryParamsService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryParamsService.java new file mode 100644 index 000000000..78ff631b1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IFormQueryParamsService.java @@ -0,0 +1,45 @@ +package com.mhd.bms.domain.reportForm.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; + +import java.util.List; + +/** + * 报查询条件管理Service接口 + * + * @author gen + * @date 2024-07-25 + */ +public interface IFormQueryParamsService extends IService +{ + /** + * 分页查询报查询条件管理列表 + */ + public List queryList(FormQueryParamsDO formQueryParamsDO); + + /** + * 新增报查询条件管理 + */ + public Boolean insert(FormQueryParamsDO formQueryParamsDO); + + /** + * 修改报查询条件管理 + */ + public Boolean update(FormQueryParamsDO formQueryParamsDO); + + /** + * 批量删除报查询条件管理 + */ + public Boolean delete(Long[] formQueryParamsIds); + + + /** + * 查询报查询条件管理 + */ + public FormQueryParamsPO getInfo(Long formQueryParamsId); + + List queryListByManageId(Long formQueryManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IReportFormService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IReportFormService.java new file mode 100644 index 000000000..805bf8e2d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/facade/IReportFormService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.reportForm.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.reportForm.entity.ReportForm; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; + +import java.util.List; + +/** + * 分析报管理Service接口 + * + * @author gen + * @date 2024-07-25 + */ +public interface IReportFormService extends IService +{ + /** + * 分页查询分析报管理列表 + */ + public List queryList(ReportFormDO reportFormDO); + + /** + * 新增分析报管理 + */ + public Boolean insert(ReportFormDO reportFormDO); + + /** + * 修改分析报管理 + */ + public Boolean update(ReportFormDO reportFormDO); + + /** + * 批量删除分析报管理 + */ + public Boolean delete(Long[] reportFormIds); + + + /** + * 查询分析报管理 + */ + public ReportFormPO getInfo(Long reportFormId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryManageMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryManageMapper.java new file mode 100644 index 000000000..0987c526d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryManageMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.reportForm.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import org.apache.ibatis.annotations.Param; +/** + * 查询条件管理Mapper接口 + * + * @author gen + * @date 2024-07-26 + */ +public interface FormQueryManageMapper extends BaseMapper +{ + /** + * 查询查询条件管理列表 + */ + public List queryList(@Param("formQueryManageDO") FormQueryManageDO formQueryManageDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryParamsMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryParamsMapper.java new file mode 100644 index 000000000..5749d10d2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/FormQueryParamsMapper.java @@ -0,0 +1,23 @@ +package com.mhd.bms.domain.reportForm.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import org.apache.ibatis.annotations.Param; +/** + * 报查询条件管理Mapper接口 + * + * @author gen + * @date 2024-07-25 + */ +public interface FormQueryParamsMapper extends BaseMapper +{ + /** + * 查询报查询条件管理列表 + */ + public List queryList(@Param("formQueryParamsDO") FormQueryParamsDO formQueryParamsDO); + + List queryListByManageId(@Param("formQueryManageId") Long formQueryManageId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/ReportFormMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/ReportFormMapper.java new file mode 100644 index 000000000..93ecb88f2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/mapper/ReportFormMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.reportForm.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.reportForm.entity.ReportForm; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import org.apache.ibatis.annotations.Param; +/** + * 分析报管理Mapper接口 + * + * @author gen + * @date 2024-07-25 + */ +public interface ReportFormMapper extends BaseMapper +{ + /** + * 查询分析报管理列表 + */ + public List queryList(@Param("reportFormDO") ReportFormDO reportFormDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryManageImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryManageImpl.java new file mode 100644 index 000000000..087dd7ccc --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryManageImpl.java @@ -0,0 +1,100 @@ +package com.mhd.bms.domain.reportForm.repository.persistence; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.repository.facade.IFormQueryManageService; +import com.mhd.bms.domain.reportForm.repository.mapper.FormQueryManageMapper; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 查询条件管理Service业务层处理 + * + * @author gen + * @date 2024-07-26 + */ +@Service +public class FormQueryManageImpl extends ServiceImpl implements IFormQueryManageService{ + @Autowired + private FormQueryManageMapper formQueryManageMapper; + + /** + * 查询查询条件管理列表 + */ + @Override + public List queryList(FormQueryManageDO formQueryManageDO) + { + return formQueryManageMapper.queryList(formQueryManageDO); + } + + /** + * 新增查询条件管理 + */ + @Override + public Boolean insert(FormQueryManageDO formQueryManageDO) { + FormQueryManage formQueryManage = new FormQueryManage(); + BeanUtils.copyProperties(formQueryManageDO,formQueryManage); + boolean flag = this.save(formQueryManage); + formQueryManageDO.setFormQueryManageId(formQueryManage.getFormQueryManageId()); + return flag; + } + + /** + * 修改查询条件管理 + */ + @Override + public Boolean update(FormQueryManageDO formQueryManageDO) { + FormQueryManage formQueryManage = new FormQueryManage(); + BeanUtils.copyProperties(formQueryManageDO,formQueryManage); + return this.updateById(formQueryManage); + } + + /** + * 批量删除查询条件管理 + */ + @Override + public Boolean delete(Long[] formQueryManageIds ) { + List list = new ArrayList<>(); + for (Long id : formQueryManageIds) { + FormQueryManage formQueryManage = new FormQueryManage(); + formQueryManage.setFormQueryManageId(id); + formQueryManage.setDelFlag(2); + list.add(formQueryManage); + } + return this.updateBatchById(list); + } + + /** + * 修改查询条件管理 + */ + @Override + public FormQueryManagePO getInfo(Long formQueryManageId) { + FormQueryManage formQueryManage = this.getById(formQueryManageId); + FormQueryManagePO formQueryManagePO = new FormQueryManagePO(); + BeanUtils.copyProperties(formQueryManage,formQueryManagePO); + return formQueryManagePO; + } + + @Override + public List queryListAll() { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(FormQueryManage::getCreateBy,loginUser.getUserPo().getUserId()); + return this.list(queryWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryParamsImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryParamsImpl.java new file mode 100644 index 000000000..fd93874fd --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/FormQueryParamsImpl.java @@ -0,0 +1,86 @@ +package com.mhd.bms.domain.reportForm.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.facade.IFormQueryParamsService; +import com.mhd.bms.domain.reportForm.repository.mapper.FormQueryParamsMapper; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 报查询条件管理Service业务层处理 + * + * @author gen + * @date 2024-07-25 + */ +@Service +public class FormQueryParamsImpl extends ServiceImpl implements IFormQueryParamsService{ + @Autowired + private FormQueryParamsMapper formQueryParamsMapper; + + /** + * 查询报查询条件管理列表 + */ + @Override + public List queryList(FormQueryParamsDO formQueryParamsDO) + { + return formQueryParamsMapper.queryList(formQueryParamsDO); + } + + /** + * 新增报查询条件管理 + */ + @Override + public Boolean insert(FormQueryParamsDO formQueryParamsDO) { + FormQueryParams formQueryParams = new FormQueryParams(); + BeanUtils.copyProperties(formQueryParamsDO,formQueryParams); + return this.save(formQueryParams); + } + + /** + * 修改报查询条件管理 + */ + @Override + public Boolean update(FormQueryParamsDO formQueryParamsDO) { + FormQueryParams formQueryParams = new FormQueryParams(); + BeanUtils.copyProperties(formQueryParamsDO,formQueryParams); + return this.updateById(formQueryParams); + } + + /** + * 批量删除报查询条件管理 + */ + @Override + public Boolean delete(Long[] formQueryParamsIds ) { + List list = new ArrayList<>(); + for (Long id : formQueryParamsIds) { + FormQueryParams formQueryParams = new FormQueryParams(); + formQueryParams.setFormQueryParamsId(id); + formQueryParams.setDelFlag(2); + list.add(formQueryParams); + } + return this.updateBatchById(list); + } + + /** + * 修改报查询条件管理 + */ + @Override + public FormQueryParamsPO getInfo(Long formQueryParamsId) { + FormQueryParams formQueryParams = this.getById(formQueryParamsId); + FormQueryParamsPO formQueryParamsPO = new FormQueryParamsPO(); + BeanUtils.copyProperties(formQueryParams,formQueryParamsPO); + return formQueryParamsPO; + } + + @Override + public List queryListByManageId(Long formQueryManageId) { + return formQueryParamsMapper.queryListByManageId(formQueryManageId); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/ReportFormImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/ReportFormImpl.java new file mode 100644 index 000000000..36938d5c4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/persistence/ReportFormImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.reportForm.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.reportForm.entity.ReportForm; +import com.mhd.bms.domain.reportForm.repository.facade.IReportFormService; +import com.mhd.bms.domain.reportForm.repository.mapper.ReportFormMapper; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 分析报管理Service业务层处理 + * + * @author gen + * @date 2024-07-25 + */ +@Service +public class ReportFormImpl extends ServiceImpl implements IReportFormService{ + @Autowired + private ReportFormMapper reportFormMapper; + + /** + * 查询分析报管理列表 + */ + @Override + public List queryList(ReportFormDO reportFormDO) + { + return reportFormMapper.queryList(reportFormDO); + } + + /** + * 新增分析报管理 + */ + @Override + public Boolean insert(ReportFormDO reportFormDO) { + ReportForm reportForm = new ReportForm(); + BeanUtils.copyProperties(reportFormDO,reportForm); + return this.save(reportForm); + } + + /** + * 修改分析报管理 + */ + @Override + public Boolean update(ReportFormDO reportFormDO) { + ReportForm reportForm = new ReportForm(); + BeanUtils.copyProperties(reportFormDO,reportForm); + return this.updateById(reportForm); + } + + /** + * 批量删除分析报管理 + */ + @Override + public Boolean delete(Long[] reportFormIds ) { + List list = new ArrayList<>(); + for (Long id : reportFormIds) { + ReportForm reportForm = new ReportForm(); + reportForm.setReportFormId(id); + reportForm.setDelFlag(2); + list.add(reportForm); + } + return this.updateBatchById(list); + } + + /** + * 修改分析报管理 + */ + @Override + public ReportFormPO getInfo(Long reportFormId) { + ReportForm reportForm = this.getById(reportFormId); + ReportFormPO reportFormPO = new ReportFormPO(); + BeanUtils.copyProperties(reportForm,reportFormPO); + return reportFormPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryManagePO.java new file mode 100644 index 000000000..88e4e7a92 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryManagePO.java @@ -0,0 +1,59 @@ +package com.mhd.bms.domain.reportForm.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.List; + +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 查询条件管理对象 form_query_manage + * + * @author gen + * @date 2024-07-26 + */ + +@Data +@ApiModel(value = "查询条件管理对象", description = "查询条件管理响应对象") +public class FormQueryManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("查询条件名称") + @Excel(name = "查询条件名称") + private String formQueryName; + + @ApiModelProperty("所属报表类型((1-综合分析报表,2-账单分析报表,3-结算分析报表))") + @Excel(name = "所属报表类型", readConverterExp = "(=1-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty("查询条件名称") + private List formQueryParamsPOList; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("默认状态(1-是,2-否)") + private Integer defaultFlag; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryParamsPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryParamsPO.java new file mode 100644 index 000000000..12b79b6b9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/FormQueryParamsPO.java @@ -0,0 +1,77 @@ +package com.mhd.bms.domain.reportForm.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 报查询条件管理对象 form_query_params + * + * @author gen + * @date 2024-07-25 + */ + +@Data +@ApiModel(value = "报查询条件管理对象", description = "报查询条件管理响应对象") +public class FormQueryParamsPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询条件id") + private Long formQueryParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("字段编码") + @Excel(name = "字段编码") + private String field; + + @ApiModelProperty("字段名称") + @Excel(name = "字段名称") + private String fieldName; + + @ApiModelProperty("过滤方法(1-=,2-!=,3->,4->=,5-<,6-<=,7-包含,8-不包含,9-在列表,10-不在列表)") + private Integer filterMethod; + + @ApiModelProperty("输入框值") + @Excel(name = "输入框值") + private String inputBoxText; + + @ApiModelProperty("输入框查询方法") + @Excel(name = "输入框查询方法") + private String inputBoxMethod; + + @ApiModelProperty("输入框类型(1-文本,2-下拉框,3-日期选择器)") + @Excel(name = "输入框类型", readConverterExp = "1=-文本,2-下拉框,3-日期选择器") + private Integer inputBoxType; + + @ApiModelProperty("关系(1-并且,2-或者)") + @Excel(name = "关系", readConverterExp = "1=-并且,2-或者") + private Integer queryRelation; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("查询条件json(前端保存用)") + private String paramsInfoJson; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/ReportFormPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/ReportFormPO.java new file mode 100644 index 000000000..4f8afea8e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/po/ReportFormPO.java @@ -0,0 +1,68 @@ +package com.mhd.bms.domain.reportForm.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 分析报管理对象 report_form + * + * @author gen + * @date 2024-07-25 + */ + +@Data +@ApiModel(value = "分析报管理对象", description = "分析报管理响应对象") +public class ReportFormPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("报表名称") + @Excel(name = "报表名称") + private String reportFormName; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("描述") + @Excel(name = "描述") + private String formDescribe; + + @ApiModelProperty("创建人") + @Excel(name = "创建人") + private String createFormName; + + @ApiModelProperty("查询字段json") + @Excel(name = "查询字段json") + private String queryParamJson; + + @ApiModelProperty("报表类型(1-综合分析报表,2-账单分析报表,3-结算分析报表)") + @Excel(name = "报表类型", readConverterExp = "1=-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty("查询条件json") + @Excel(name = "查询条件json") + private String queryConditionJson; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryManageDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryManageDO.java new file mode 100644 index 000000000..de101eafb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryManageDO.java @@ -0,0 +1,64 @@ +package com.mhd.bms.domain.reportForm.repository.todo; + +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 查询条件管理对象 form_query_manage + * + * @author gen + * @date 2024-07-26 + */ + +@Data +public class FormQueryManageDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("查询条件名称") + @Excel(name = "查询条件名称") + private String formQueryName; + + @ApiModelProperty("所属报表类型((1-综合分析报表,2-账单分析报表,3-结算分析报表))") + @Excel(name = "所属报表类型", readConverterExp = "(=1-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "查询条件明细列表") + private List formQueryParamsDTOList; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("默认状态(1-是,2-否)") + private Integer defaultFlag; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryParamsDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryParamsDO.java new file mode 100644 index 000000000..3f889785c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/FormQueryParamsDO.java @@ -0,0 +1,82 @@ +package com.mhd.bms.domain.reportForm.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 报查询条件管理对象 form_query_params + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class FormQueryParamsDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询条件id") + private Long formQueryParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("字段编码") + @Excel(name = "字段编码") + private String field; + + @ApiModelProperty("字段名称") + @Excel(name = "字段名称") + private String fieldName; + + @ApiModelProperty("过滤方法(1-=,2-!=,3->,4->=,5-<,6-<=,7-包含,8-不包含,9-在列表,10-不在列表)") + private Integer filterMethod; + + @ApiModelProperty("输入框值") + @Excel(name = "输入框值") + private String inputBoxText; + + @ApiModelProperty("输入框查询方法") + @Excel(name = "输入框查询方法") + private String inputBoxMethod; + + @ApiModelProperty("输入框类型(1-文本,2-下拉框,3-日期选择器)") + @Excel(name = "输入框类型", readConverterExp = "1=-文本,2-下拉框,3-日期选择器") + private Integer inputBoxType; + + @ApiModelProperty("关系(1-并且,2-或者)") + @Excel(name = "关系", readConverterExp = "1=-并且,2-或者") + private Integer queryRelation; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("查询条件json(前端保存用)") + private String paramsInfoJson; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/ReportFormDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/ReportFormDO.java new file mode 100644 index 000000000..5055b6255 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/repository/todo/ReportFormDO.java @@ -0,0 +1,72 @@ +package com.mhd.bms.domain.reportForm.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 分析报管理对象 report_form + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class ReportFormDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("报表名称") + @Excel(name = "报表名称") + private String reportFormName; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("描述") + @Excel(name = "描述") + private String formDescribe; + + @ApiModelProperty("创建人") + @Excel(name = "创建人") + private String createFormName; + + @ApiModelProperty("查询条件json") + @Excel(name = "查询条件json") + private String queryParamJson; + + @ApiModelProperty("报表类型(1-综合分析报表,2-账单分析报表,3-结算分析报表)") + @Excel(name = "报表类型", readConverterExp = "1=-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("收支类型(1-应收,2-应付)") + private Integer accountExpenseType; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryManageDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryManageDomainService.java new file mode 100644 index 000000000..e7239354f --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryManageDomainService.java @@ -0,0 +1,127 @@ +package com.mhd.bms.domain.reportForm.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.facade.IFormQueryManageService; +import com.mhd.bms.domain.reportForm.repository.facade.IFormQueryParamsService; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 查询条件管理 + * + * @author gen + * @date 2024-07-26 + */ +@Service +@Slf4j +public class FormQueryManageDomainService { + + @Autowired + private IFormQueryManageService formQueryManageService; + @Autowired + private IFormQueryParamsService formQueryParamsService; + + + /** + * 分页查询查询条件管理列表 + */ + public List queryList(FormQueryManageDO formQueryManageDO) { + return formQueryManageService.queryList(formQueryManageDO); + } + + + /** + * 新增查询条件管理 + */ + public Boolean insert(FormQueryManageDO formQueryManageDO) { + if(StringUtils.isEmpty(formQueryManageDO.getFormQueryName())){ + //查询当前用户下所有条件信息,按顺序获取查询条件名 + List formQueryManageList = formQueryManageService.queryListAll(); + int size = formQueryManageList.size() + 1; + formQueryManageDO.setFormQueryName("查询条件" + size); + } + return formQueryManageService.insert(formQueryManageDO); + } + + /** + * 修改查询条件管理 + */ + public Boolean update(FormQueryManageDO formQueryManageDO) { + return formQueryManageService.update(formQueryManageDO); + } + + /** + * 批量删除查询条件管理 + */ + public Boolean delete(Long[] formQueryManageIds) { + return formQueryManageService.delete(formQueryManageIds); + } + + /** + * 获取查询条件管理详细信息 + */ + public FormQueryManagePO getInfo(Long formQueryManageId) + { + return formQueryManageService.getInfo(formQueryManageId); + } + + + public Boolean deleteById(Long formQueryManageId) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(FormQueryManage::getFormQueryManageId, formQueryManageId); + updateWrapper.set(FormQueryManage::getDelFlag, 2); + return formQueryManageService.update(updateWrapper); + } + + /** + * 将该用户下所有查询条件管理设置为非默认 + */ + public Boolean updateDefaultFlag(Integer formType) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(FormQueryManage::getFormType,formType) + .eq(FormQueryManage::getOrganizationId,loginUser.getUserPo().getOrganizationId()) + .eq(FormQueryManage::getTopOrganizationId,loginUser.getUserPo().getTopOrganizationId()) + .eq(FormQueryManage::getCreateBy,loginUser.getUserPo().getUserId()) + .set(FormQueryManage::getDefaultFlag,2); + return formQueryManageService.update(updateWrapper); + } + + /** + * 根据报表ID查询报表下默认的查询条件,并返回 + * @param reportFormId 报表ID + * @return 默认查询条件 + */ + public FormQueryManagePO getDefaultFlagPo(Long reportFormId) { + FormQueryManagePO formQueryManagePO = null; + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(FormQueryManage::getReportFormId,reportFormId) + .eq(FormQueryManage::getDefaultFlag,1); + FormQueryManage formQueryManage = formQueryManageService.getOne(queryWrapper); + if(null != formQueryManage){ + formQueryManagePO = new FormQueryManagePO(); + BeanUtils.copyProperties(formQueryManage,formQueryManagePO); + List formQueryParamsPOList = formQueryParamsService.queryListByManageId(formQueryManage.getFormQueryManageId()); + formQueryManagePO.setFormQueryParamsPOList(formQueryParamsPOList); + } + return formQueryManagePO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryParamsDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryParamsDomainService.java new file mode 100644 index 000000000..4b0f8d028 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/FormQueryParamsDomainService.java @@ -0,0 +1,141 @@ +package com.mhd.bms.domain.reportForm.service; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryParams; +import com.mhd.bms.domain.reportForm.repository.facade.IFormQueryParamsService; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +/** + * 报查询条件管理 + * + * @author gen + * @date 2024-07-25 + */ +@Service +@Slf4j +public class FormQueryParamsDomainService { + + @Autowired + private IFormQueryParamsService formQueryParamsService; + + + /** + * 分页查询报查询条件管理列表 + */ + public List queryList(FormQueryParamsDO formQueryParamsDO) { + return formQueryParamsService.queryList(formQueryParamsDO); + } + + + /** + * 新增报查询条件管理 + */ + public Boolean insert(FormQueryParamsDO formQueryParamsDO) { + + return formQueryParamsService.insert(formQueryParamsDO); + } + + /** + * 修改报查询条件管理 + */ + public Boolean update(List formQueryParamsDTOList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List formQueryParamsList = new ArrayList<>(); + for (FormQueryParamsDTO formQueryParamsDTO : formQueryParamsDTOList) { + FormQueryParams formQueryParams = new FormQueryParams(); + BeanUtils.copyProperties(formQueryParamsDTO, formQueryParams); + if(formQueryParams.getFormQueryParamsId() == null){ + formQueryParams.setCreateBy(loginUser.getUserPo().getUserId()); + formQueryParams.setCreateTime(new Date()); + formQueryParams.setCreateByName(loginUser.getUserPo().getUserName()); + formQueryParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + formQueryParams.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + formQueryParams.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + }else { + formQueryParams.setDelFlag(1); + formQueryParams.setUpdateBy(loginUser.getUserPo().getUserId()); + formQueryParams.setUpdateTime(new Date()); + formQueryParams.setUpdateByName(loginUser.getUserPo().getUserName()); + } + formQueryParamsList.add(formQueryParams); + } + return formQueryParamsService.saveOrUpdateBatch(formQueryParamsList); + } + + /** + * 批量删除报查询条件管理 + */ + public Boolean delete(Long[] formQueryParamsIds) { + return formQueryParamsService.delete(formQueryParamsIds); + } + + /** + * 获取报查询条件管理详细信息 + */ + public FormQueryParamsPO getInfo(Long formQueryParamsId) + { + return formQueryParamsService.getInfo(formQueryParamsId); + } + + + /** + * 批量保存报查询条件参数 + */ + public Boolean saveBatch(List formQueryParamsDTOList) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + List formQueryParamsList = new ArrayList<>(); + for (FormQueryParamsDTO formQueryParamsDTO : formQueryParamsDTOList) { + FormQueryParams formQueryParams = new FormQueryParams(); + BeanUtils.copyProperties(formQueryParamsDTO, formQueryParams); + formQueryParams.setCreateBy(loginUser.getUserPo().getUserId()); + formQueryParams.setCreateTime(new Date()); + formQueryParams.setCreateByName(loginUser.getUserPo().getUserName()); + formQueryParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + formQueryParams.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + formQueryParams.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + formQueryParamsList.add(formQueryParams); + } + return formQueryParamsService.saveBatch(formQueryParamsList); + } + + public Boolean deleteByFormQueryManageId(Long formQueryManageId) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(FormQueryParams::getDelFlag, 2); + updateWrapper.eq(FormQueryParams::getFormQueryManageId, formQueryManageId); + return formQueryParamsService.update(updateWrapper); + } + + public List getInfoByFormQueryManageId(Long formQueryManageId) { + List formQueryParamsPOList = new ArrayList<>(); + List formQueryParamsList = formQueryParamsService.list(new LambdaQueryWrapper().eq(FormQueryParams::getFormQueryManageId, formQueryManageId).eq(FormQueryParams::getDelFlag, 1)); + if(formQueryParamsList!=null && formQueryParamsList.size()>0){ + for (FormQueryParams formQueryParams : formQueryParamsList) { + FormQueryParamsPO formQueryParamsPO = new FormQueryParamsPO(); + BeanUtils.copyProperties(formQueryParams, formQueryParamsPO); + formQueryParamsPOList.add(formQueryParamsPO); + } + } + return formQueryParamsPOList; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/ReportFormDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/ReportFormDomainService.java new file mode 100644 index 000000000..7e1084a82 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/reportForm/service/ReportFormDomainService.java @@ -0,0 +1,93 @@ +package com.mhd.bms.domain.reportForm.service; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.mhd.bms.domain.reportForm.entity.FormQueryManage; +import com.mhd.bms.domain.reportForm.entity.ReportForm; +import com.mhd.bms.domain.reportForm.repository.facade.IReportFormService; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import lombok.extern.slf4j.Slf4j; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 分析报管理 + * + * @author gen + * @date 2024-07-25 + */ +@Service +@Slf4j +public class ReportFormDomainService { + + @Autowired + private IReportFormService reportFormService; + @Autowired + private FormQueryManageDomainService formQueryManageDomainService; + + + /** + * 分页查询分析报管理列表 + */ + public List queryList(ReportFormDO reportFormDO) { + List reportFormPOList = reportFormService.queryList(reportFormDO); + if(reportFormPOList != null && reportFormPOList.size() > 0){ + for (ReportFormPO reportFormPO : reportFormPOList) { + //查询每个报表的默认查询条件,并返回 + FormQueryManagePO formQueryManagePO = formQueryManageDomainService.getDefaultFlagPo(reportFormPO.getReportFormId()); + if(null != formQueryManagePO){ + reportFormPO.setQueryConditionJson(JSON.toJSONString(formQueryManagePO)); + } + } + } + return reportFormPOList; + } + + + /** + * 新增分析报管理 + */ + public Boolean insert(ReportFormDO reportFormDO) { + + return reportFormService.insert(reportFormDO); + } + + /** + * 修改分析报管理 + */ + public Boolean update(ReportFormDO reportFormDO) { + return reportFormService.update(reportFormDO); + } + + /** + * 批量删除分析报管理 + */ + public Boolean delete(Long[] reportFormIds) { + return reportFormService.delete(reportFormIds); + } + + /** + * 获取分析报管理详细信息 + */ + public ReportFormPO getInfo(Long reportFormId) + { + return reportFormService.getInfo(reportFormId); + } + + + /** + * 删除分析报管理 + * @param reportFormId + * @return + */ + public Boolean deleteByIds(Long reportFormId) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(ReportForm::getDelFlag, 2); + updateWrapper.eq(ReportForm::getReportFormId, reportFormId); + return reportFormService.update(updateWrapper); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/entity/SettlementCustomers.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/entity/SettlementCustomers.java new file mode 100644 index 000000000..57e6892e1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/entity/SettlementCustomers.java @@ -0,0 +1,95 @@ +package com.mhd.bms.domain.settlementCustomers.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 结算对象对象 settlement_customers + * + * @author gen + * @date 2024-06-17 + */ + +@Data +public class SettlementCustomers extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("结算对象id") + @TableId(type = IdType.AUTO) + private Long settlementCustomersId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象编码") + @Excel(name = "结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算主体id") + @Excel(name = "结算主体id") + private Long settlementEntityId; + + @ApiModelProperty("结算主体") + @Excel(name = "结算主体") + private String settlementEntity; + + @ApiModelProperty("结算方式") + @Excel(name = "结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + @Excel(name = "结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("开户银行名称") + @Excel(name = "开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + @Excel(name = "银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + @Excel(name = "银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色(1-客户,2-供应商)") + private Integer mainRole; + + @ApiModelProperty("客户类型") + private String customerType; + + @ApiModelProperty("客户类型编码") + private String customerTypeCode; + + @ApiModelProperty("项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + private String projectName; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/facade/ISettlementCustomersService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/facade/ISettlementCustomersService.java new file mode 100644 index 000000000..9c5c24fb6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/facade/ISettlementCustomersService.java @@ -0,0 +1,48 @@ +package com.mhd.bms.domain.settlementCustomers.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; + +import java.util.List; + +/** + * 结算对象Service接口 + * + * @author gen + * @date 2024-06-17 + */ +public interface ISettlementCustomersService extends IService +{ + /** + * 分页查询结算对象列表 + */ + public List queryList(SettlementCustomersDO settlementCustomersDO); + + /** + * 查询结算对象键值 + */ + public List querySettlementObjects(); + + /** + * 新增结算对象 + */ + public Boolean insert(SettlementCustomersDO settlementCustomersDO); + + /** + * 修改结算对象 + */ + public Boolean update(SettlementCustomersDO settlementCustomersDO); + + /** + * 批量删除结算对象 + */ + public Boolean delete(Long[] settlementCustomersIds); + + + /** + * 查询结算对象 + */ + public SettlementCustomersPO getInfo(Long settlementCustomersId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/mapper/SettlementCustomersMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/mapper/SettlementCustomersMapper.java new file mode 100644 index 000000000..1ca06dc05 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/mapper/SettlementCustomersMapper.java @@ -0,0 +1,27 @@ +package com.mhd.bms.domain.settlementCustomers.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import org.apache.ibatis.annotations.Param; +/** + * 结算对象Mapper接口 + * + * @author gen + * @date 2024-06-17 + */ +public interface SettlementCustomersMapper extends BaseMapper +{ + /** + * 查询结算对象列表 + */ + public List queryList(@Param("settlementCustomersDO") SettlementCustomersDO settlementCustomersDO); + + /** + * 查询结算对象键值 + */ + public List querySettlementObjects(); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/persistence/SettlementCustomersImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/persistence/SettlementCustomersImpl.java new file mode 100644 index 000000000..9b176f853 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/persistence/SettlementCustomersImpl.java @@ -0,0 +1,91 @@ +package com.mhd.bms.domain.settlementCustomers.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.facade.ISettlementCustomersService; +import com.mhd.bms.domain.settlementCustomers.repository.mapper.SettlementCustomersMapper; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 结算对象Service业务层处理 + * + * @author gen + * @date 2024-06-17 + */ +@Service +public class SettlementCustomersImpl extends ServiceImpl implements ISettlementCustomersService{ + @Autowired + private SettlementCustomersMapper settlementCustomersMapper; + + /** + * 查询结算对象列表 + */ + @Override + public List queryList(SettlementCustomersDO settlementCustomersDO) + { + return settlementCustomersMapper.queryList(settlementCustomersDO); + } + + @Override + public List querySettlementObjects() { + return settlementCustomersMapper.querySettlementObjects(); + } + + /** + * 查询结算对象键值 + */ + + + /** + * 新增结算对象 + */ + @Override + public Boolean insert(SettlementCustomersDO settlementCustomersDO) { + SettlementCustomers settlementCustomers = new SettlementCustomers(); + BeanUtils.copyProperties(settlementCustomersDO,settlementCustomers); + return this.save(settlementCustomers); + } + + /** + * 修改结算对象 + */ + @Override + public Boolean update(SettlementCustomersDO settlementCustomersDO) { + SettlementCustomers settlementCustomers = new SettlementCustomers(); + BeanUtils.copyProperties(settlementCustomersDO,settlementCustomers); + return this.updateById(settlementCustomers); + } + + /** + * 批量删除结算对象 + */ + @Override + public Boolean delete(Long[] settlementCustomersIds ) { + List list = new ArrayList<>(); + for (Long id : settlementCustomersIds) { + SettlementCustomers settlementCustomers = new SettlementCustomers(); + settlementCustomers.setSettlementCustomersId(id); + settlementCustomers.setDelFlag(2); + list.add(settlementCustomers); + } + return this.updateBatchById(list); + } + + /** + * 修改结算对象 + */ + @Override + public SettlementCustomersPO getInfo(Long settlementCustomersId) { + SettlementCustomers settlementCustomers = this.getById(settlementCustomersId); + SettlementCustomersPO settlementCustomersPO = new SettlementCustomersPO(); + BeanUtils.copyProperties(settlementCustomers,settlementCustomersPO); + return settlementCustomersPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java new file mode 100644 index 000000000..eb3f42b7e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/po/SettlementCustomersPO.java @@ -0,0 +1,95 @@ +package com.mhd.bms.domain.settlementCustomers.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 结算对象对象 settlement_customers + * + * @author gen + * @date 2024-06-17 + */ + +@Data +@ApiModel(value = "结算对象对象", description = "结算对象响应对象") +public class SettlementCustomersPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象编码") + @Excel(name = "结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算主体id") + @Excel(name = "结算主体id") + private Long settlementEntityId; + + @ApiModelProperty("结算主体") + @Excel(name = "结算主体") + private String settlementEntity; + + @ApiModelProperty("结算方式") + @Excel(name = "结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + @Excel(name = "结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("开户银行名称") + @Excel(name = "开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + @Excel(name = "银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + @Excel(name = "银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色(1-客户,2-供应商)") + private Integer mainRole; + + @ApiModelProperty("客户类型") + private String customerType; + + @ApiModelProperty("客户类型编码") + private String customerTypeCode; + + @ApiModelProperty("项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + private String projectName; + + private String settlementObject; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/todo/SettlementCustomersDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/todo/SettlementCustomersDO.java new file mode 100644 index 000000000..0d8147a26 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/repository/todo/SettlementCustomersDO.java @@ -0,0 +1,107 @@ +package com.mhd.bms.domain.settlementCustomers.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 结算对象对象 settlement_customers + * + * @author gen + * @date 2024-06-17 + */ + +@Data +public class SettlementCustomersDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象编码") + @Excel(name = "结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算主体id(用户ID)") + @Excel(name = "结算主体id") + private Long settlementEntityId; + + @ApiModelProperty("结算主体") + @Excel(name = "结算主体") + private String settlementEntity; + + @ApiModelProperty("结算方式") + @Excel(name = "结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + @Excel(name = "结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("开户银行名称") + @Excel(name = "开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + @Excel(name = "银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + @Excel(name = "银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + @ApiModelProperty("结算对象ids") + private String settlementCustomersIds; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色(1-客户,2-供应商)") + private Integer mainRole; + + @ApiModelProperty("客户类型") + private String customerType; + + @ApiModelProperty("客户类型编码") + private String customerTypeCode; + + @ApiModelProperty("项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + private String projectName; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/service/SettlementCustomersDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/service/SettlementCustomersDomainService.java new file mode 100644 index 000000000..b366e7052 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/settlementCustomers/service/SettlementCustomersDomainService.java @@ -0,0 +1,87 @@ +package com.mhd.bms.domain.settlementCustomers.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers; +import com.mhd.bms.domain.settlementCustomers.repository.facade.ISettlementCustomersService; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import com.mhd.common.security.utils.SecurityUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 结算对象 + * + * @author gen + * @date 2024-06-17 + */ +@Service +@Slf4j +public class SettlementCustomersDomainService { + + @Autowired + private ISettlementCustomersService settlementCustomersService; + + + /** + * 分页查询结算对象列表 + */ + public List queryList(SettlementCustomersDO settlementCustomersDO) { + return settlementCustomersService.queryList(settlementCustomersDO); + } + + public List getSettlementObjects(){ + return settlementCustomersService.querySettlementObjects(); + } + + + /** + * 新增结算对象 + */ + public Boolean insert(SettlementCustomersDO settlementCustomersDO) { + + return settlementCustomersService.insert(settlementCustomersDO); + } + + /** + * 修改结算对象 + */ + public Boolean update(SettlementCustomersDO settlementCustomersDO) { + return settlementCustomersService.update(settlementCustomersDO); + } + + /** + * 批量删除结算对象 + */ + public Boolean delete(Long[] settlementCustomersIds) { + return settlementCustomersService.delete(settlementCustomersIds); + } + + /** + * 获取结算对象详细信息 + */ + public SettlementCustomersPO getInfo(Long settlementCustomersId) + { + return settlementCustomersService.getInfo(settlementCustomersId); + } + + + /** + * 根据结算编码查询结算对象 + * @param settlementCustomersCode + * @return + */ + public SettlementCustomers queryByCode(String settlementCustomersCode) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SettlementCustomers::getSettlementCustomersCode, settlementCustomersCode); + queryWrapper.eq(SettlementCustomers::getTopOrganizationId, SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId()); + queryWrapper.eq(SettlementCustomers::getDelFlag, 1); + return settlementCustomersService.getOne(queryWrapper); + } + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/entity/TaskFlowRecords.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/entity/TaskFlowRecords.java new file mode 100644 index 000000000..6f6dbb5e6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/entity/TaskFlowRecords.java @@ -0,0 +1,134 @@ +package com.mhd.bms.domain.taskFlowRecords.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import java.math.BigDecimal; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + + +/** + * 任务流水记录对象 task_flow_records + * + * @author gen + * @date 2024-06-20 + */ + +@Data +public class TaskFlowRecords extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("任务流水记录id") + @TableId(type = IdType.AUTO) + private Long taskFlowRecordsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("任务流水") + @Excel(name = "任务流水") + private String taskFlow; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("单据类别id") + @Excel(name = "单据类别id") + private Long documentTypeId; + + @ApiModelProperty("单据类别code") + @Excel(name = "单据类别code") + private String documentTypeCode; + + @ApiModelProperty("单据类别") + @Excel(name = "单据类别") + private String documentType; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色", readConverterExp = "1-客户,2-供应商") + private Integer mainRole; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("计费规则id") + @Excel(name = "计费规则id") + private Long billingRulesId; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称") + private String billingRules; + + @ApiModelProperty("计费规则code") + @Excel(name = "计费规则code") + private String billingRulesCode; + + @ApiModelProperty("计费过程") + @Excel(name = "计费过程") + private String billingProcess; + + @ApiModelProperty("计费结果") + @Excel(name = "计费结果") + private String billingResults; + + @ApiModelProperty("原始参数json") + @Excel(name = "原始参数json") + private String requestParams; + + @ApiModelProperty("费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + private String serviceItemsName; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/facade/ITaskFlowRecordsService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/facade/ITaskFlowRecordsService.java new file mode 100644 index 000000000..ef36ef094 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/facade/ITaskFlowRecordsService.java @@ -0,0 +1,43 @@ +package com.mhd.bms.domain.taskFlowRecords.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.bms.domain.taskFlowRecords.entity.TaskFlowRecords; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; + +import java.util.List; + +/** + * 任务流水记录Service接口 + * + * @author gen + * @date 2024-06-20 + */ +public interface ITaskFlowRecordsService extends IService +{ + /** + * 分页查询任务流水记录列表 + */ + public List queryList(TaskFlowRecordsDO taskFlowRecordsDO); + + /** + * 新增任务流水记录 + */ + public Boolean insert(TaskFlowRecordsDO taskFlowRecordsDO); + + /** + * 修改任务流水记录 + */ + public Boolean update(TaskFlowRecordsDO taskFlowRecordsDO); + + /** + * 批量删除任务流水记录 + */ + public Boolean delete(Long[] taskFlowRecordsIds); + + + /** + * 查询任务流水记录 + */ + public TaskFlowRecordsPO getInfo(Long taskFlowRecordsId); +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/mapper/TaskFlowRecordsMapper.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/mapper/TaskFlowRecordsMapper.java new file mode 100644 index 000000000..5340a79a2 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/mapper/TaskFlowRecordsMapper.java @@ -0,0 +1,22 @@ +package com.mhd.bms.domain.taskFlowRecords.repository.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.bms.domain.taskFlowRecords.entity.TaskFlowRecords; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import org.apache.ibatis.annotations.Param; +/** + * 任务流水记录Mapper接口 + * + * @author gen + * @date 2024-06-20 + */ +public interface TaskFlowRecordsMapper extends BaseMapper +{ + /** + * 查询任务流水记录列表 + */ + public List queryList(@Param("taskFlowRecordsDO") TaskFlowRecordsDO taskFlowRecordsDO); + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/persistence/TaskFlowRecordsImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/persistence/TaskFlowRecordsImpl.java new file mode 100644 index 000000000..f55c3c211 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/persistence/TaskFlowRecordsImpl.java @@ -0,0 +1,81 @@ +package com.mhd.bms.domain.taskFlowRecords.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.bms.domain.taskFlowRecords.entity.TaskFlowRecords; +import com.mhd.bms.domain.taskFlowRecords.repository.facade.ITaskFlowRecordsService; +import com.mhd.bms.domain.taskFlowRecords.repository.mapper.TaskFlowRecordsMapper; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 任务流水记录Service业务层处理 + * + * @author gen + * @date 2024-06-20 + */ +@Service +public class TaskFlowRecordsImpl extends ServiceImpl implements ITaskFlowRecordsService{ + @Autowired + private TaskFlowRecordsMapper taskFlowRecordsMapper; + + /** + * 查询任务流水记录列表 + */ + @Override + public List queryList(TaskFlowRecordsDO taskFlowRecordsDO) + { + return taskFlowRecordsMapper.queryList(taskFlowRecordsDO); + } + + /** + * 新增任务流水记录 + */ + @Override + public Boolean insert(TaskFlowRecordsDO taskFlowRecordsDO) { + TaskFlowRecords taskFlowRecords = new TaskFlowRecords(); + BeanUtils.copyProperties(taskFlowRecordsDO,taskFlowRecords); + return this.save(taskFlowRecords); + } + + /** + * 修改任务流水记录 + */ + @Override + public Boolean update(TaskFlowRecordsDO taskFlowRecordsDO) { + TaskFlowRecords taskFlowRecords = new TaskFlowRecords(); + BeanUtils.copyProperties(taskFlowRecordsDO,taskFlowRecords); + return this.updateById(taskFlowRecords); + } + + /** + * 批量删除任务流水记录 + */ + @Override + public Boolean delete(Long[] taskFlowRecordsIds ) { + List list = new ArrayList<>(); + for (Long id : taskFlowRecordsIds) { + TaskFlowRecords taskFlowRecords = new TaskFlowRecords(); + taskFlowRecords.setTaskFlowRecordsId(id); + taskFlowRecords.setDelFlag(2); + list.add(taskFlowRecords); + } + return this.updateBatchById(list); + } + + /** + * 修改任务流水记录 + */ + @Override + public TaskFlowRecordsPO getInfo(Long taskFlowRecordsId) { + TaskFlowRecords taskFlowRecords = this.getById(taskFlowRecordsId); + TaskFlowRecordsPO taskFlowRecordsPO = new TaskFlowRecordsPO(); + BeanUtils.copyProperties(taskFlowRecords,taskFlowRecordsPO); + return taskFlowRecordsPO; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/po/TaskFlowRecordsPO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/po/TaskFlowRecordsPO.java new file mode 100644 index 000000000..96f9629b3 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/po/TaskFlowRecordsPO.java @@ -0,0 +1,134 @@ +package com.mhd.bms.domain.taskFlowRecords.repository.po; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.mhd.common.core.web.domain.BaseVOEntity; + + +/** + * 任务流水记录对象 task_flow_records + * + * @author gen + * @date 2024-06-20 + */ + +@Data +@ApiModel(value = "任务流水记录对象", description = "任务流水记录响应对象") +public class TaskFlowRecordsPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("任务流水记录id") + private Long taskFlowRecordsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("任务流水") + @Excel(name = "任务流水") + private String taskFlow; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("单据类别id") + @Excel(name = "单据类别id") + private Long documentTypeId; + + @ApiModelProperty("单据类别code") + @Excel(name = "单据类别code") + private String documentTypeCode; + + @ApiModelProperty("单据类别") + @Excel(name = "单据类别") + private String documentType; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色", readConverterExp = "1-客户,2-供应商") + private Integer mainRole; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("计费规则id") + @Excel(name = "计费规则id") + private Long billingRulesId; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称") + private String billingRules; + + @ApiModelProperty("计费规则code") + @Excel(name = "计费规则code") + private String billingRulesCode; + + @ApiModelProperty("计费过程") + @Excel(name = "计费过程") + private String billingProcess; + + @ApiModelProperty("计费结果") + @Excel(name = "计费结果") + private String billingResults; + + @ApiModelProperty("原始参数json") + @Excel(name = "原始参数json") + private String requestParams; + + @ApiModelProperty("费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + private String serviceItemsName; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/todo/TaskFlowRecordsDO.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/todo/TaskFlowRecordsDO.java new file mode 100644 index 000000000..d31da8b21 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/repository/todo/TaskFlowRecordsDO.java @@ -0,0 +1,148 @@ +package com.mhd.bms.domain.taskFlowRecords.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + + +/** + * 任务流水记录对象 task_flow_records + * + * @author gen + * @date 2024-06-20 + */ + +@Data +public class TaskFlowRecordsDO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("任务流水记录id") + private Long taskFlowRecordsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("任务流水") + @Excel(name = "任务流水") + private String taskFlow; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("单据类别id") + @Excel(name = "单据类别id") + private Long documentTypeId; + + @ApiModelProperty("单据类别code") + @Excel(name = "单据类别code") + private String documentTypeCode; + + @ApiModelProperty("单据类别") + @Excel(name = "单据类别") + private String documentType; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色", readConverterExp = "1-客户,2-供应商") + private Integer mainRole; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("计费规则id") + @Excel(name = "计费规则id") + private Long billingRulesId; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称") + private String billingRules; + + @ApiModelProperty("计费规则code") + @Excel(name = "计费规则code") + private String billingRulesCode; + + @ApiModelProperty("计费过程") + @Excel(name = "计费过程") + private String billingProcess; + + @ApiModelProperty("计费结果") + @Excel(name = "计费结果") + private String billingResults; + + @ApiModelProperty("原始参数json") + @Excel(name = "原始参数json") + private String requestParams; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + private String serviceItemsName; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/service/TaskFlowRecordsDomainService.java b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/service/TaskFlowRecordsDomainService.java new file mode 100644 index 000000000..acfc15656 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/taskFlowRecords/service/TaskFlowRecordsDomainService.java @@ -0,0 +1,86 @@ +package com.mhd.bms.domain.taskFlowRecords.service; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.taskFlowRecords.repository.facade.ITaskFlowRecordsService; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +/** + * 任务流水记录 + * + * @author gen + * @date 2024-06-20 + */ +@Service +@Slf4j +public class TaskFlowRecordsDomainService { + + @Autowired + private ITaskFlowRecordsService taskFlowRecordsService; + + + /** + * 分页查询任务流水记录列表 + */ + public List queryList(TaskFlowRecordsDO taskFlowRecordsDO) { + return taskFlowRecordsService.queryList(taskFlowRecordsDO); + } + + + /** + * 新增任务流水记录 + */ + public Boolean insert(TaskFlowRecordsDO taskFlowRecordsDO) { + + return taskFlowRecordsService.insert(taskFlowRecordsDO); + } + + /** + * 修改任务流水记录 + */ + public Boolean update(TaskFlowRecordsDO taskFlowRecordsDO) { + return taskFlowRecordsService.update(taskFlowRecordsDO); + } + + /** + * 批量删除任务流水记录 + */ + public Boolean delete(Long[] taskFlowRecordsIds) { + return taskFlowRecordsService.delete(taskFlowRecordsIds); + } + + /** + * 获取任务流水记录详细信息 + */ + public TaskFlowRecordsPO getInfo(Long taskFlowRecordsId) + { + return taskFlowRecordsService.getInfo(taskFlowRecordsId); + } + + + /** + * 保存任务流水 + */ + public Boolean saveInCost(TaskFlowRecordsDO taskFlowRecordsDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + taskFlowRecordsDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + taskFlowRecordsDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + taskFlowRecordsDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + taskFlowRecordsDO.setCreateBy(loginUser.getUserPo().getUserId()); + taskFlowRecordsDO.setCreateByName(loginUser.getUserPo().getUserName()); + taskFlowRecordsDO.setCreateTime(new Date()); + return taskFlowRecordsService.insert(taskFlowRecordsDO); + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/constant/BillLogsConstants.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/constant/BillLogsConstants.java new file mode 100644 index 000000000..8c6ff068e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/constant/BillLogsConstants.java @@ -0,0 +1,99 @@ +package com.mhd.bms.infrastructure.constant; + +/** + * 账单消息通知模板常量 + * + */ +public class BillLogsConstants +{ + + + /** + 创建账单 + 账单编号:{},账单金额:{}元 + */ + public static final String create_bill_title = "创建账单"; + public static final String create_bill_text = "账单编号:{},账单金额:{}元"; + + /** + * 调整账单 + * 账单金额:{}元 + */ + public static final String change_bill_title = "调整账单"; + public static final String change_bill_text = "账单金额:{}元"; + + /** + * 确认账单 + * + */ + public static final String confirm_bill_title = "确认账单"; + public static final String confirm_bill_text = ""; + + /** + * 发起账单 + * + */ + public static final String initiate_bill_title = "发起账单"; + public static final String initiate_bill_text = ""; + + /** + * 客户确认 + * 确认结果:核对无误 + * 确认结果:申请调账({意见描述}),期望金额:{}元 + */ + public static final String customer_confirm_title = "客户确认"; + public static final String customer_confirm_text_one = "确认结果:核对无误"; + public static final String customer_confirm_text_two = "确认结果:申请调账({}),期望金额:{}元"; + + + /** + * 财务审核 + * 审核结果:同意,账单金额:{}元 + * 审核结果:拒绝({意见描述}),账单金额:{}元 + */ + public static final String financial_review_title = "客户确认"; + public static final String financial_review_text_one = "审核结果:同意({}),账单金额:{}元"; + public static final String financial_review_text_two = "审核结果:拒绝({}),账单金额:{}元"; + + + /** + * 作废账单 + * + */ + public static final String nullify_bill_title = "作废账单"; + public static final String nullify_bill_text = ""; + + + /** + * 删除账单 + * + */ + public static final String delete_bill_title = "删除账单"; + public static final String delete_bill_text = ""; + + + /** + * 收款 + * 收款单号:{},收款金额:{}元 + */ + public static final String collection_bill_title = "收款"; + public static final String collection_bill_text = "收款单号:{},收款金额:{}元(实收{}元,优惠{}元)"; + + + /** + * 退款 + * 收款单号:{},退款金额:{}元 + */ + public static final String refund_bill_title = "退款"; + public static final String refund_bill_text = "退款单号:{},退款金额:{}元"; + + + /** + * 付款 + * 付款单号:{},付款金额:{}元 + */ + public static final String payment_bill_title = "付款"; + public static final String payment_bill_text = "付款单号:{},付款金额:{}元"; + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManageDetailPO.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManageDetailPO.java new file mode 100644 index 000000000..7ba827968 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManageDetailPO.java @@ -0,0 +1,100 @@ +package com.mhd.bms.infrastructure.feign.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + + +/** + * 合同管理详情对象 contract_manage_detail + * + * @author gen + * @date 2024-06-07 + */ + +@Data +@ApiModel(value = "合同管理详情对象", description = "合同管理详情响应对象") +public class ContractManageDetailPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("合同管理详情id") + private Long contractManageDetailId; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算科目类型(1-通用,2-临时)") + @Excel(name = "结算科目类型", readConverterExp = "1=-通用,2-临时") + private Integer subjectType; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("计费策略id") + @Excel(name = "计费策略id") + private Long accountingStrategyId; + + @ApiModelProperty("计费策略") + @Excel(name = "计费策略") + private String accountingStrategy; + + @ApiModelProperty("计费策略编码") + @Excel(name = "计费策略编码") + private String accountingStrategyCode; + + @ApiModelProperty("计费周期") + @Excel(name = "计费周期") + private String billingAttributes; + + @ApiModelProperty("计费周期编码") + @Excel(name = "计费周期编码") + private String billingAttributesCode; + + @ApiModelProperty("合同有效日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同有效日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date subjectEffectiveDate; + + @ApiModelProperty("合同到期日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同到期日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date subjectExpirationDate; + + @ApiModelProperty("单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + private String documentType; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManagePO.java new file mode 100644 index 000000000..8fefd8216 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ContractManagePO.java @@ -0,0 +1,172 @@ +package com.mhd.bms.infrastructure.feign.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + + +/** + * 合同管理对象 contract_manage + * + * @author gen + * @date 2024-06-07 + */ + +@Data +@ApiModel(value = "合同管理对象", description = "合同管理响应对象") +public class ContractManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("合同管理id") + private Long contractManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("原始合同编号") + @Excel(name = "原始合同编号") + private String originalContractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("是否通用合同(1-是,2-否)") + @Excel(name = "是否通用合同", readConverterExp = "1=-是,2-否") + private Integer commonContractFlag; + + @ApiModelProperty("合同类型(1-仓储,2-运输)") + @Excel(name = "合同类型", readConverterExp = "1=-仓储,2-运输") + private Integer contractType; + + @ApiModelProperty("合同状态(1-未生效,2-使用中,3-已过期,4-已作废)") + @Excel(name = "合同状态", readConverterExp = "1=-未生效,2-使用中,3-已过期,4-已作废") + private Integer contractState; + + @ApiModelProperty("签订单位") + @Excel(name = "签订单位") + private String signingUnit; + + @ApiModelProperty("结算主体") + @Excel(name = "结算主体") + private String settlementCustomers; + + @ApiModelProperty("结算主体id") + @Excel(name = "结算主体id") + private Long settlementCustomersId; + + @ApiModelProperty("结算主体code") + @Excel(name = "结算主体code") + private String settlementCustomersCode; + + @ApiModelProperty("我司身份(1-甲方,2-乙方)") + @Excel(name = "我司身份", readConverterExp = "1=-甲方,2-乙方") + private Integer ourIdentity; + + @ApiModelProperty("账期(1-每月,2-双月,3-季度)") + @Excel(name = "账期", readConverterExp = "1=-每月,2-双月,3-季度") + private Integer accountingPeriod; + + @ApiModelProperty("合同签订日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同签订日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date signingDate; + + @ApiModelProperty("合同生效日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同生效日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date effectiveDate; + + @ApiModelProperty("合同到期日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "合同到期日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expirationDate; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("合同正本附件地址") + @Excel(name = "合同正本附件地址") + private String contractOriginalUrl; + + @ApiModelProperty("廉政协议附件地址") + @Excel(name = "廉政协议附件地址") + private String integrityAgreementUrl; + + @ApiModelProperty("安全协议附件地址") + @Excel(name = "安全协议附件地址") + private String securityProtocolUrl; + + @ApiModelProperty("其他附件地址") + @Excel(name = "其他附件地址") + private String otherAttachmentsUrl; + + @ApiModelProperty("我司签订人") + @Excel(name = "我司签订人") + private String ourSinged; + + @ApiModelProperty("我司签订人联系方式") + @Excel(name = "我司签订人联系方式") + private String ourSingedPhone; + + @ApiModelProperty("我司经办人") + @Excel(name = "我司经办人") + private String ourOperator; + + @ApiModelProperty("我司经办人联系方式") + @Excel(name = "我司经办人联系方式") + private String ourOperatorPhone; + + @ApiModelProperty("对方签订人") + @Excel(name = "对方签订人") + private String theySinged; + + @ApiModelProperty("对方签订人联系方式") + @Excel(name = "对方签订人联系方式") + private String theySingedPhone; + + @ApiModelProperty("对方经办人") + @Excel(name = "对方经办人") + private String theyOperator; + + @ApiModelProperty("对方经办人联系方式") + @Excel(name = "对方经办人联系方式") + private String theyOperatorPhone; + + @ApiModelProperty("合同详情列表") + private List contractManageDetailPOList; + + @ApiModelProperty(name = "结算主体基础数据id(可以是用户id也可以是企业id)") + private String settlementId; + + @ApiModelProperty(name = "是否自动出账(1-是,2-否)") + private Integer automaticFlag; + + @ApiModelProperty("出账日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date paymentDate; + + @ApiModelProperty(name = "主体类型(1-货主,2-客户,3-承运商)") + private Integer principalType; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java new file mode 100644 index 000000000..e1d138975 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ExpenseAccountPO.java @@ -0,0 +1,105 @@ +package com.mhd.bms.infrastructure.feign.vo; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + + +/** + * 费用科目对象 expense_account + * + * @author gen + * @date 2024-06-04 + */ + +@Data +@ApiModel(value = "费用科目对象", description = "费用科目响应对象") +public class ExpenseAccountPO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("费用科目id") + private Long expenseAccountId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("科目编码") + @Excel(name = "科目编码") + private String subjectCode; + + @ApiModelProperty("科目名称") + @Excel(name = "科目名称") + private String subjectName; + + @ApiModelProperty("计费属性编码") + @Excel(name = "计费属性编码") + private String billingAttributesCode; + + @ApiModelProperty("计费属性") + @Excel(name = "计费属性") + private String billingAttributes; + + @ApiModelProperty("所属模块编码") + @Excel(name = "所属模块编码") + private String belongModuleCode; + + @ApiModelProperty("所属编码") + @Excel(name = "所属编码") + private String belongModule; + + @ApiModelProperty("是否一级科目(1-是,2-否)") + @Excel(name = "是否一级科目", readConverterExp = "1=-是,2-否") + private Integer firstSubjectFlag; + + @ApiModelProperty("上级科目编码") + @Excel(name = "上级科目编码") + private String upperSubjectCode; + + @ApiModelProperty("上级科目名称") + @Excel(name = "上级科目名称") + private String upperSubject; + + @ApiModelProperty("启用状态(1-启动,2-停用)") + @Excel(name = "启用状态", readConverterExp = "1=-启动,2-停用") + private Integer status; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("关联服务项管理id") + @Excel(name = "关联服务项管理id") + private Long serviceItemsManageId; + + /** 收支类型(1-收入,2-支出) */ + @ApiModelProperty(name = "收支类型") + private Integer accountExpenseType; + + private List expenseAccountPOList; + + @ApiModelProperty("服务项编码") + @Excel(name = "服务项编码") + private String serviceItemsCode; + + @ApiModelProperty("服务项名称") + @Excel(name = "服务项名称") + private String serviceItemsName; + + @ApiModelProperty("服务项税率") + @Excel(name = "服务项税率") + private BigDecimal taxRate; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ServiceItemsManagePO.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ServiceItemsManagePO.java new file mode 100644 index 000000000..b2e6503b1 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/feign/vo/ServiceItemsManagePO.java @@ -0,0 +1,57 @@ +package com.mhd.bms.infrastructure.feign.vo; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + + +/** + * 服务项管理对象 service_items_manage + * + * @author gen + * @date 2024-06-03 + */ + +@Data +@ApiModel(value = "服务项管理对象", description = "服务项管理响应对象") +public class ServiceItemsManagePO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("服务项管理id") + private Long serviceItemsManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("服务项编码") + @Excel(name = "服务项编码") + private String serviceItemsCode; + + @ApiModelProperty("服务项名称") + @Excel(name = "服务项名称") + private String serviceItemsName; + + @ApiModelProperty("服务项税率") + @Excel(name = "服务项税率") + private BigDecimal taxRate; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/CheckPasswordUtil.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/CheckPasswordUtil.java new file mode 100644 index 000000000..463738b98 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/CheckPasswordUtil.java @@ -0,0 +1,65 @@ +package com.mhd.bms.infrastructure.utils; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.AESUtil; +import com.mhd.common.core.utils.SpringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.common.security.utils.password.PasswordUtil; +import com.mhd.system.api.UserServiceFeign; +import com.mhd.system.api.model.LoginUser; +import org.apache.commons.lang3.StringUtils; + + +/** + * 校验支付密码 + **/ +public class CheckPasswordUtil { + + + /** + * 校验支付密码 + * @param payPassword 需要校验的密码 (前端加密后的) + * @param userId 校验密码查询的用户id (不传默认当前登录用户) + */ + public static void checkPayPassword(String payPassword,Long userId) { + //获取当前登录用户 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + //获取校验人id + userId = userId == null ? loginUser.getUserid() : userId; + //解密支付密码 + payPassword = AESUtil.decrypt(payPassword); + //此处不用缓存中的数据,用数据库实时查询 + UserPo userPo = new UserPo(); + UserServiceFeign userServiceFeign = SpringUtils.getBean(UserServiceFeign.class); + AjaxResult ajaxResult = userServiceFeign.getInfo(userId); + if("200".equals(String.valueOf(ajaxResult.get("code")))){ + userPo = JSONUtil.toBean(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); + if(null == userPo){ + throw new ServiceException("用户信息不存在"); + } + } + if(StringUtils.isEmpty(userPo.getUserPayPassword())){ + throw new ServiceException("请设置支付密码"); + } + //校验用户支付密码是否正确 + if (!PasswordUtil.matchesPassword(userPo.getUserAccount(), payPassword, userPo.getUserSalt(), userPo.getUserPayPassword())) { + throw new ServiceException("密码错误"); + } + //TODO 设置密码错误次数,并校验 + + + } + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/DynamicCalculationUtil.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/DynamicCalculationUtil.java new file mode 100644 index 000000000..f23d5c8e9 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/DynamicCalculationUtil.java @@ -0,0 +1,41 @@ +package com.mhd.bms.infrastructure.utils; + + + +import lombok.extern.slf4j.Slf4j; +import org.nfunk.jep.JEP; + +import java.math.BigDecimal; + +/** + * JEP动态计算 + **/ +@Slf4j +public class DynamicCalculationUtil { + + + /** + * 动态计算 + * @param formula 计算公式 + * @return 计算结果 + */ + public static BigDecimal calculate(String formula) { + try { + + // 创建 JEP 实例 + JEP jep = new JEP(); + // 设置要计算的表达式 + jep.parseExpression(formula); + // 计算表达式的结果 + double result = jep.getValue(); + // 将结果转换为 BigDecimal + return new BigDecimal(result); + } catch (Exception e) { + // 处理可能的异常 + log.error("动态计算失败:"+e.getMessage()); + } + return BigDecimal.ZERO; + } + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/UniqueKeyUtil.java b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/UniqueKeyUtil.java new file mode 100644 index 000000000..a63c61d44 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/infrastructure/utils/UniqueKeyUtil.java @@ -0,0 +1,20 @@ +package com.mhd.bms.infrastructure.utils; + +/** + * @author ZhouGY + * @title UniqueKeyUtil + * @description: 分布式锁-获取唯一key值 + * @date 023/11/6 11:26 + **/ +public class UniqueKeyUtil { + private final static String BILLING_KEY = "billing";// 生成账单 前缀 + + + public static String getBillingKey(String key){ + return String.format("%s:%s", BILLING_KEY , key); + } + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/JobApi/JobApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/JobApi/JobApi.java new file mode 100644 index 000000000..1e897c690 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/JobApi/JobApi.java @@ -0,0 +1,33 @@ +package com.mhd.bms.interfaces.JobApi; + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + + +/** + * 定时任务api + * + */ +@Slf4j +@RestController +@RequestMapping("/xxJobApi") +public class JobApi extends BaseController { + + /** + * 合同自动出账 + */ + @PostMapping("/automaticCheckout") + public AjaxResult automaticCheckout() { + try { + + + + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("操作失败"+e.getMessage()); + } + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillDetailAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillDetailAssembler.java new file mode 100644 index 000000000..2cebbade4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillDetailAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.billManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO; +import com.mhd.bms.interfaces.dto.billManage.BillDetailDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 账单流水明细Assembler + * + * @author gen + * @date 2024-07-02 + */ +@Component +public class BillDetailAssembler { + + /** + * 转换实体 + */ + public BillDetailDO toDO(BillDetailDTO billDetailDTO) { + BillDetailDO billDetailDO = new BillDetailDO(); + // 拷贝 + BeanUtils.copyProperties(billDetailDTO, billDetailDO, IgnoreNullUtil.getNullPropertyNames(billDetailDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billDetailDTO.getBillDetailId() != null){ + if(userId != null){ + billDetailDO.setUpdateBy(userId); + }else { + billDetailDO.setUpdateBy(new Long("0")); + } + billDetailDO.setUpdateByName(userName); + billDetailDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billDetailDO.setCreateBy(userId); + billDetailDO.setUpdateBy(userId); + }else { + billDetailDO.setCreateBy(new Long("0")); + billDetailDO.setUpdateBy(new Long("0")); + } + billDetailDO.setCreateByName(userName); + billDetailDO.setUpdateByName(userName); + billDetailDO.setCreateTime(new Date()); + billDetailDO.setUpdateTime(new Date()); + billDetailDO.setDelFlag(1); + } + return billDetailDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillManageAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillManageAssembler.java new file mode 100644 index 000000000..112cbae0e --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billManage/BillManageAssembler.java @@ -0,0 +1,86 @@ +package com.mhd.bms.interfaces.assembler.billManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billManage.entity.BillManage; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import com.mhd.bms.interfaces.dto.billManage.BillManageDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 账单管理Assembler + * + * @author gen + * @date 2024-07-02 + */ +@Component +public class BillManageAssembler { + + /** + * 转换实体 + */ + public BillManageDO toDO(BillManageDTO billManageDTO) { + BillManageDO billManageDO = new BillManageDO(); + // 拷贝 + BeanUtils.copyProperties(billManageDTO, billManageDO, IgnoreNullUtil.getNullPropertyNames(billManageDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billManageDTO.getBillManageId() != null){ + if(userId != null){ + billManageDO.setUpdateBy(userId); + }else { + billManageDO.setUpdateBy(new Long("0")); + } + billManageDO.setUpdateByName(userName); + billManageDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billManageDO.setCreateBy(userId); + billManageDO.setUpdateBy(userId); + }else { + billManageDO.setCreateBy(new Long("0")); + billManageDO.setUpdateBy(new Long("0")); + } + billManageDO.setCreateByName(userName); + billManageDO.setUpdateByName(userName); + billManageDO.setCreateTime(new Date()); + billManageDO.setUpdateTime(new Date()); + billManageDO.setDelFlag(1); + } + return billManageDO; + } + + public BillManage getEntity() { + BillManage billManage = new BillManage(); + // 拷贝 + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(userId != null){ + billManage.setCreateBy(userId); + }else { + billManage.setCreateBy(new Long("0")); + } + billManage.setCreateByName(userName); + billManage.setCreateTime(new Date()); + billManage.setDelFlag(1); + return billManage; + } +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billOperationLog/BillOperationLogAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billOperationLog/BillOperationLogAssembler.java new file mode 100644 index 000000000..5469f3f8f --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billOperationLog/BillOperationLogAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.billOperationLog; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.interfaces.dto.billOperationLog.BillOperationLogDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 账单操作日志Assembler + * + * @author gen + * @date 2024-07-09 + */ +@Component +public class BillOperationLogAssembler { + + /** + * 转换实体 + */ + public BillOperationLogDO toDO(BillOperationLogDTO billOperationLogDTO) { + BillOperationLogDO billOperationLogDO = new BillOperationLogDO(); + // 拷贝 + BeanUtils.copyProperties(billOperationLogDTO, billOperationLogDO, IgnoreNullUtil.getNullPropertyNames(billOperationLogDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billOperationLogDTO.getBillOperationLogId() != null){ + if(userId != null){ + billOperationLogDO.setUpdateBy(userId); + }else { + billOperationLogDO.setUpdateBy(new Long("0")); + } + billOperationLogDO.setUpdateByName(userName); + billOperationLogDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billOperationLogDO.setCreateBy(userId); + billOperationLogDO.setUpdateBy(userId); + }else { + billOperationLogDO.setCreateBy(new Long("0")); + billOperationLogDO.setUpdateBy(new Long("0")); + } + billOperationLogDO.setCreateByName(userName); + billOperationLogDO.setUpdateByName(userName); + billOperationLogDO.setCreateTime(new Date()); + billOperationLogDO.setUpdateTime(new Date()); + billOperationLogDO.setDelFlag(1); + } + return billOperationLogDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingParamsAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingParamsAssembler.java new file mode 100644 index 000000000..c76d9ea84 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingParamsAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.billingRules; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 计费参数Assembler + * + * @author gen + * @date 2024-07-12 + */ +@Component +public class BillingParamsAssembler { + + /** + * 转换实体 + */ + public BillingParamsDO toDO(BillingParamsDTO billingParamsDTO) { + BillingParamsDO billingParamsDO = new BillingParamsDO(); + // 拷贝 + BeanUtils.copyProperties(billingParamsDTO, billingParamsDO, IgnoreNullUtil.getNullPropertyNames(billingParamsDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billingParamsDTO.getBillingParamsId() != null){ + if(userId != null){ + billingParamsDO.setUpdateBy(userId); + }else { + billingParamsDO.setUpdateBy(new Long("0")); + } + billingParamsDO.setUpdateByName(userName); + billingParamsDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billingParamsDO.setCreateBy(userId); + billingParamsDO.setUpdateBy(userId); + }else { + billingParamsDO.setCreateBy(new Long("0")); + billingParamsDO.setUpdateBy(new Long("0")); + } + billingParamsDO.setCreateByName(userName); + billingParamsDO.setUpdateByName(userName); + billingParamsDO.setCreateTime(new Date()); + billingParamsDO.setUpdateTime(new Date()); + billingParamsDO.setDelFlag(1); + } + return billingParamsDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingRulesAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingRulesAssembler.java new file mode 100644 index 000000000..3942d6cc5 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingRules/BillingRulesAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.billingRules; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import com.mhd.bms.interfaces.dto.billingRules.BillingRulesDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 计费规则Assembler + * + * @author gen + * @date 2024-07-12 + */ +@Component +public class BillingRulesAssembler { + + /** + * 转换实体 + */ + public BillingRulesDO toDO(BillingRulesDTO billingRulesDTO) { + BillingRulesDO billingRulesDO = new BillingRulesDO(); + // 拷贝 + BeanUtils.copyProperties(billingRulesDTO, billingRulesDO, IgnoreNullUtil.getNullPropertyNames(billingRulesDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billingRulesDTO.getBillingRulesId() != null){ + if(userId != null){ + billingRulesDO.setUpdateBy(userId); + }else { + billingRulesDO.setUpdateBy(new Long("0")); + } + billingRulesDO.setUpdateByName(userName); + billingRulesDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billingRulesDO.setCreateBy(userId); + billingRulesDO.setUpdateBy(userId); + }else { + billingRulesDO.setCreateBy(new Long("0")); + billingRulesDO.setUpdateBy(new Long("0")); + } + billingRulesDO.setCreateByName(userName); + billingRulesDO.setUpdateByName(userName); + billingRulesDO.setCreateTime(new Date()); + billingRulesDO.setUpdateTime(new Date()); + billingRulesDO.setDelFlag(1); + } + return billingRulesDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingStatement/BillingStatementAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingStatement/BillingStatementAssembler.java new file mode 100644 index 000000000..64b47c967 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/billingStatement/BillingStatementAssembler.java @@ -0,0 +1,105 @@ +package com.mhd.bms.interfaces.assembler.billingStatement; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementCollectDTO; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 计费流水Assembler + * + * @author gen + * @date 2024-06-26 + */ +@Component +public class BillingStatementAssembler { + + /** + * 转换实体 + */ + public BillingStatementDO toDO(BillingStatementDTO billingStatementDTO) { + BillingStatementDO billingStatementDO = new BillingStatementDO(); + // 拷贝 + BeanUtils.copyProperties(billingStatementDTO, billingStatementDO, IgnoreNullUtil.getNullPropertyNames(billingStatementDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billingStatementDTO.getBillingStatementId() != null){ + if(userId != null){ + billingStatementDO.setUpdateBy(userId); + }else { + billingStatementDO.setUpdateBy(new Long("0")); + } + billingStatementDO.setUpdateByName(userName); + billingStatementDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billingStatementDO.setCreateBy(userId); + billingStatementDO.setUpdateBy(userId); + }else { + billingStatementDO.setCreateBy(new Long("0")); + billingStatementDO.setUpdateBy(new Long("0")); + } + billingStatementDO.setCreateByName(userName); + billingStatementDO.setUpdateByName(userName); + billingStatementDO.setCreateTime(new Date()); + billingStatementDO.setUpdateTime(new Date()); + billingStatementDO.setDelFlag(1); + } + return billingStatementDO; + } + + public BillingStatementCollectDO toCDO(BillingStatementCollectDTO billingStatementCollectDTO) { + BillingStatementCollectDO billingStatementCollectDO = new BillingStatementCollectDO(); + // 拷贝 + BeanUtils.copyProperties(billingStatementCollectDTO, billingStatementCollectDO, IgnoreNullUtil.getNullPropertyNames(billingStatementCollectDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(billingStatementCollectDTO.getBillingStatementId() != null){ + if(userId != null){ + billingStatementCollectDO.setUpdateBy(userId); + }else { + billingStatementCollectDO.setUpdateBy(new Long("0")); + } + billingStatementCollectDO.setUpdateByName(userName); + billingStatementCollectDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + billingStatementCollectDO.setCreateBy(userId); + billingStatementCollectDO.setUpdateBy(userId); + }else { + billingStatementCollectDO.setCreateBy(new Long("0")); + billingStatementCollectDO.setUpdateBy(new Long("0")); + } + billingStatementCollectDO.setCreateByName(userName); + billingStatementCollectDO.setUpdateByName(userName); + billingStatementCollectDO.setCreateTime(new Date()); + billingStatementCollectDO.setUpdateTime(new Date()); + billingStatementCollectDO.setDelFlag(1); + } + return billingStatementCollectDO; + } + + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/businessDocument/BusinessDocumentAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/businessDocument/BusinessDocumentAssembler.java new file mode 100644 index 000000000..0c7c55617 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/businessDocument/BusinessDocumentAssembler.java @@ -0,0 +1,83 @@ +package com.mhd.bms.interfaces.assembler.businessDocument; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO; +import com.mhd.common.core.domain.dto.BusinessDataPushDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 业务单据Assembler + * + * @author gen + * @date 2024-06-21 + */ +@Component +public class BusinessDocumentAssembler { + + /** + * 转换实体 + */ + public BusinessDocumentDO toDO(BusinessDocumentDTO businessDocumentDTO) { + BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO(); + // 拷贝 + BeanUtils.copyProperties(businessDocumentDTO, businessDocumentDO, IgnoreNullUtil.getNullPropertyNames(businessDocumentDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(businessDocumentDTO.getBusinessDocumentId() != null){ + if(userId != null){ + businessDocumentDO.setUpdateBy(userId); + }else { + businessDocumentDO.setUpdateBy(new Long("0")); + } + businessDocumentDO.setUpdateByName(userName); + businessDocumentDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + businessDocumentDO.setCreateBy(userId); + businessDocumentDO.setUpdateBy(userId); + }else { + businessDocumentDO.setCreateBy(new Long("0")); + businessDocumentDO.setUpdateBy(new Long("0")); + } + businessDocumentDO.setCreateByName(userName); + businessDocumentDO.setUpdateByName(userName); + businessDocumentDO.setCreateTime(new Date()); + businessDocumentDO.setUpdateTime(new Date()); + businessDocumentDO.setDelFlag(1); + } + return businessDocumentDO; + } + + public BusinessDocumentDO syncDataAssemble(BusinessDataPushDTO businessDataPushDTO) { + BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO(); + // 拷贝 + BeanUtils.copyProperties(businessDataPushDTO, businessDocumentDO, IgnoreNullUtil.getNullPropertyNames(businessDataPushDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + businessDocumentDO.setCreateBy(userId); + businessDocumentDO.setCreateByName(userName); + businessDocumentDO.setCreateTime(new Date()); + businessDocumentDO.setDelFlag(1); + return businessDocumentDO; +} +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/conditionalMapping/ConditionalMappingAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/conditionalMapping/ConditionalMappingAssembler.java new file mode 100644 index 000000000..8167c37fe --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/conditionalMapping/ConditionalMappingAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.conditionalMapping; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import com.mhd.bms.interfaces.dto.conditionalMapping.ConditionalMappingDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 条件映射管理Assembler + * + * @author gen + * @date 2024-08-07 + */ +@Component +public class ConditionalMappingAssembler { + + /** + * 转换实体 + */ + public ConditionalMappingDO toDO(ConditionalMappingDTO conditionalMappingDTO) { + ConditionalMappingDO conditionalMappingDO = new ConditionalMappingDO(); + // 拷贝 + BeanUtils.copyProperties(conditionalMappingDTO, conditionalMappingDO, IgnoreNullUtil.getNullPropertyNames(conditionalMappingDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(conditionalMappingDTO.getConditionalMappingId() != null){ + if(userId != null){ + conditionalMappingDO.setUpdateBy(userId); + }else { + conditionalMappingDO.setUpdateBy(new Long("0")); + } + conditionalMappingDO.setUpdateByName(userName); + conditionalMappingDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + conditionalMappingDO.setCreateBy(userId); + conditionalMappingDO.setUpdateBy(userId); + }else { + conditionalMappingDO.setCreateBy(new Long("0")); + conditionalMappingDO.setUpdateBy(new Long("0")); + } + conditionalMappingDO.setCreateByName(userName); + conditionalMappingDO.setUpdateByName(userName); + conditionalMappingDO.setCreateTime(new Date()); + conditionalMappingDO.setUpdateTime(new Date()); + conditionalMappingDO.setDelFlag(1); + } + return conditionalMappingDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/documentType/DocumentTypeAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/documentType/DocumentTypeAssembler.java new file mode 100644 index 000000000..1018c9396 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/documentType/DocumentTypeAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.documentType; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import com.mhd.bms.interfaces.dto.documentType.DocumentTypeDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 单据类型Assembler + * + * @author gen + * @date 2024-06-18 + */ +@Component +public class DocumentTypeAssembler { + + /** + * 转换实体 + */ + public DocumentTypeDO toDO(DocumentTypeDTO documentTypeDTO) { + DocumentTypeDO documentTypeDO = new DocumentTypeDO(); + // 拷贝 + BeanUtils.copyProperties(documentTypeDTO, documentTypeDO, IgnoreNullUtil.getNullPropertyNames(documentTypeDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(documentTypeDTO.getDocumentTypeId() != null){ + if(userId != null){ + documentTypeDO.setUpdateBy(userId); + }else { + documentTypeDO.setUpdateBy(new Long("0")); + } + documentTypeDO.setUpdateByName(userName); + documentTypeDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + documentTypeDO.setCreateBy(userId); + documentTypeDO.setUpdateBy(userId); + }else { + documentTypeDO.setCreateBy(new Long("0")); + documentTypeDO.setUpdateBy(new Long("0")); + } + documentTypeDO.setCreateByName(userName); + documentTypeDO.setUpdateByName(userName); + documentTypeDO.setCreateTime(new Date()); + documentTypeDO.setUpdateTime(new Date()); + documentTypeDO.setDelFlag(1); + } + return documentTypeDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/mappingMethod/MappingMethodAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/mappingMethod/MappingMethodAssembler.java new file mode 100644 index 000000000..fcd04fc3d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/mappingMethod/MappingMethodAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.mappingMethod; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import com.mhd.bms.interfaces.dto.mappingMethod.MappingMethodDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 方法映射Assembler + * + * @author gen + * @date 2024-07-12 + */ +@Component +public class MappingMethodAssembler { + + /** + * 转换实体 + */ + public MappingMethodDO toDO(MappingMethodDTO mappingMethodDTO) { + MappingMethodDO mappingMethodDO = new MappingMethodDO(); + // 拷贝 + BeanUtils.copyProperties(mappingMethodDTO, mappingMethodDO, IgnoreNullUtil.getNullPropertyNames(mappingMethodDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(mappingMethodDTO.getMappingMethodId() != null){ + if(userId != null){ + mappingMethodDO.setUpdateBy(userId); + }else { + mappingMethodDO.setUpdateBy(new Long("0")); + } + mappingMethodDO.setUpdateByName(userName); + mappingMethodDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + mappingMethodDO.setCreateBy(userId); + mappingMethodDO.setUpdateBy(userId); + }else { + mappingMethodDO.setCreateBy(new Long("0")); + mappingMethodDO.setUpdateBy(new Long("0")); + } + mappingMethodDO.setCreateByName(userName); + mappingMethodDO.setUpdateByName(userName); + mappingMethodDO.setCreateTime(new Date()); + mappingMethodDO.setUpdateTime(new Date()); + mappingMethodDO.setDelFlag(1); + } + return mappingMethodDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentManage/PaymentManageAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentManage/PaymentManageAssembler.java new file mode 100644 index 000000000..1f6cdf525 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentManage/PaymentManageAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.paymentManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import com.mhd.bms.interfaces.dto.paymentManage.PaymentManageDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 支付管理Assembler + * + * @author gen + * @date 2024-07-09 + */ +@Component +public class PaymentManageAssembler { + + /** + * 转换实体 + */ + public PaymentManageDO toDO(PaymentManageDTO paymentManageDTO) { + PaymentManageDO paymentManageDO = new PaymentManageDO(); + // 拷贝 + BeanUtils.copyProperties(paymentManageDTO, paymentManageDO, IgnoreNullUtil.getNullPropertyNames(paymentManageDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(paymentManageDTO.getPaymentManageId() != null){ + if(userId != null){ + paymentManageDO.setUpdateBy(userId); + }else { + paymentManageDO.setUpdateBy(new Long("0")); + } + paymentManageDO.setUpdateByName(userName); + paymentManageDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + paymentManageDO.setCreateBy(userId); + paymentManageDO.setUpdateBy(userId); + }else { + paymentManageDO.setCreateBy(new Long("0")); + paymentManageDO.setUpdateBy(new Long("0")); + } + paymentManageDO.setCreateByName(userName); + paymentManageDO.setUpdateByName(userName); + paymentManageDO.setCreateTime(new Date()); + paymentManageDO.setUpdateTime(new Date()); + paymentManageDO.setDelFlag(1); + } + return paymentManageDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderAssembler.java new file mode 100644 index 000000000..9b7634fae --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.paymentOrder; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 付款单Assembler + * + * @author gen + * @date 2024-07-16 + */ +@Component +public class PaymentOrderAssembler { + + /** + * 转换实体 + */ + public PaymentOrderDO toDO(PaymentOrderDTO paymentOrderDTO) { + PaymentOrderDO paymentOrderDO = new PaymentOrderDO(); + // 拷贝 + BeanUtils.copyProperties(paymentOrderDTO, paymentOrderDO, IgnoreNullUtil.getNullPropertyNames(paymentOrderDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(paymentOrderDTO.getPaymentOrderId() != null){ + if(userId != null){ + paymentOrderDO.setUpdateBy(userId); + }else { + paymentOrderDO.setUpdateBy(new Long("0")); + } + paymentOrderDO.setUpdateByName(userName); + paymentOrderDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + paymentOrderDO.setCreateBy(userId); + paymentOrderDO.setUpdateBy(userId); + }else { + paymentOrderDO.setCreateBy(new Long("0")); + paymentOrderDO.setUpdateBy(new Long("0")); + } + paymentOrderDO.setCreateByName(userName); + paymentOrderDO.setUpdateByName(userName); + paymentOrderDO.setCreateTime(new Date()); + paymentOrderDO.setUpdateTime(new Date()); + paymentOrderDO.setDelFlag(1); + } + return paymentOrderDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderDetailsAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderDetailsAssembler.java new file mode 100644 index 000000000..fe2f5f717 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentOrder/PaymentOrderDetailsAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.paymentOrder; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 付款单详情Assembler + * + * @author gen + * @date 2024-07-16 + */ +@Component +public class PaymentOrderDetailsAssembler { + + /** + * 转换实体 + */ + public PaymentOrderDetailsDO toDO(PaymentOrderDetailsDTO paymentOrderDetailsDTO) { + PaymentOrderDetailsDO paymentOrderDetailsDO = new PaymentOrderDetailsDO(); + // 拷贝 + BeanUtils.copyProperties(paymentOrderDetailsDTO, paymentOrderDetailsDO, IgnoreNullUtil.getNullPropertyNames(paymentOrderDetailsDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(paymentOrderDetailsDTO.getPaymentOrderDetailsId() != null){ + if(userId != null){ + paymentOrderDetailsDO.setUpdateBy(userId); + }else { + paymentOrderDetailsDO.setUpdateBy(new Long("0")); + } + paymentOrderDetailsDO.setUpdateByName(userName); + paymentOrderDetailsDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + paymentOrderDetailsDO.setCreateBy(userId); + paymentOrderDetailsDO.setUpdateBy(userId); + }else { + paymentOrderDetailsDO.setCreateBy(new Long("0")); + paymentOrderDetailsDO.setUpdateBy(new Long("0")); + } + paymentOrderDetailsDO.setCreateByName(userName); + paymentOrderDetailsDO.setUpdateByName(userName); + paymentOrderDetailsDO.setCreateTime(new Date()); + paymentOrderDetailsDO.setUpdateTime(new Date()); + paymentOrderDetailsDO.setDelFlag(1); + } + return paymentOrderDetailsDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentWallet/PaymentWalletAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentWallet/PaymentWalletAssembler.java new file mode 100644 index 000000000..a539049b4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/paymentWallet/PaymentWalletAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.paymentWallet; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import com.mhd.bms.interfaces.dto.paymentWallet.PaymentWalletDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 支付钱包管理Assembler + * + * @author gen + * @date 2024-07-09 + */ +@Component +public class PaymentWalletAssembler { + + /** + * 转换实体 + */ + public PaymentWalletDO toDO(PaymentWalletDTO paymentWalletDTO) { + PaymentWalletDO paymentWalletDO = new PaymentWalletDO(); + // 拷贝 + BeanUtils.copyProperties(paymentWalletDTO, paymentWalletDO, IgnoreNullUtil.getNullPropertyNames(paymentWalletDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(paymentWalletDTO.getPaymentWalletId() != null){ + if(userId != null){ + paymentWalletDO.setUpdateBy(userId); + }else { + paymentWalletDO.setUpdateBy(new Long("0")); + } + paymentWalletDO.setUpdateByName(userName); + paymentWalletDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + paymentWalletDO.setCreateBy(userId); + paymentWalletDO.setUpdateBy(userId); + }else { + paymentWalletDO.setCreateBy(new Long("0")); + paymentWalletDO.setUpdateBy(new Long("0")); + } + paymentWalletDO.setCreateByName(userName); + paymentWalletDO.setUpdateByName(userName); + paymentWalletDO.setCreateTime(new Date()); + paymentWalletDO.setUpdateTime(new Date()); + paymentWalletDO.setDelFlag(1); + } + return paymentWalletDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptDetailAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptDetailAssembler.java new file mode 100644 index 000000000..ffd22620a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptDetailAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.receiptManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptDetailDO; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 收款单详情Assembler + * + * @author gen + * @date 2024-07-08 + */ +@Component +public class ReceiptDetailAssembler { + + /** + * 转换实体 + */ + public ReceiptDetailDO toDO(ReceiptDetailDTO receiptDetailDTO) { + ReceiptDetailDO receiptDetailDO = new ReceiptDetailDO(); + // 拷贝 + BeanUtils.copyProperties(receiptDetailDTO, receiptDetailDO, IgnoreNullUtil.getNullPropertyNames(receiptDetailDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(receiptDetailDTO.getReceiptDetailId() != null){ + if(userId != null){ + receiptDetailDO.setUpdateBy(userId); + }else { + receiptDetailDO.setUpdateBy(new Long("0")); + } + receiptDetailDO.setUpdateByName(userName); + receiptDetailDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + receiptDetailDO.setCreateBy(userId); + receiptDetailDO.setUpdateBy(userId); + }else { + receiptDetailDO.setCreateBy(new Long("0")); + receiptDetailDO.setUpdateBy(new Long("0")); + } + receiptDetailDO.setCreateByName(userName); + receiptDetailDO.setUpdateByName(userName); + receiptDetailDO.setCreateTime(new Date()); + receiptDetailDO.setUpdateTime(new Date()); + receiptDetailDO.setDelFlag(1); + } + return receiptDetailDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptManageAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptManageAssembler.java new file mode 100644 index 000000000..2d06ef7b3 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/receiptManage/ReceiptManageAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.receiptManage; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptManageDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 收款单管理Assembler + * + * @author gen + * @date 2024-07-08 + */ +@Component +public class ReceiptManageAssembler { + + /** + * 转换实体 + */ + public ReceiptManageDO toDO(ReceiptManageDTO receiptManageDTO) { + ReceiptManageDO receiptManageDO = new ReceiptManageDO(); + // 拷贝 + BeanUtils.copyProperties(receiptManageDTO, receiptManageDO, IgnoreNullUtil.getNullPropertyNames(receiptManageDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(receiptManageDTO.getReceiptManageId() != null){ + if(userId != null){ + receiptManageDO.setUpdateBy(userId); + }else { + receiptManageDO.setUpdateBy(new Long("0")); + } + receiptManageDO.setUpdateByName(userName); + receiptManageDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + receiptManageDO.setCreateBy(userId); + receiptManageDO.setUpdateBy(userId); + }else { + receiptManageDO.setCreateBy(new Long("0")); + receiptManageDO.setUpdateBy(new Long("0")); + } + receiptManageDO.setCreateByName(userName); + receiptManageDO.setUpdateByName(userName); + receiptManageDO.setCreateTime(new Date()); + receiptManageDO.setUpdateTime(new Date()); + receiptManageDO.setDelFlag(1); + } + return receiptManageDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryManageAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryManageAssembler.java new file mode 100644 index 000000000..e22872f20 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryManageAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.reportForm; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryManageDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 查询条件管理Assembler + * + * @author gen + * @date 2024-07-26 + */ +@Component +public class FormQueryManageAssembler { + + /** + * 转换实体 + */ + public FormQueryManageDO toDO(FormQueryManageDTO formQueryManageDTO) { + FormQueryManageDO formQueryManageDO = new FormQueryManageDO(); + // 拷贝 + BeanUtils.copyProperties(formQueryManageDTO, formQueryManageDO, IgnoreNullUtil.getNullPropertyNames(formQueryManageDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(formQueryManageDTO.getFormQueryManageId() != null){ + if(userId != null){ + formQueryManageDO.setUpdateBy(userId); + }else { + formQueryManageDO.setUpdateBy(new Long("0")); + } + formQueryManageDO.setUpdateByName(userName); + formQueryManageDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + formQueryManageDO.setCreateBy(userId); + formQueryManageDO.setUpdateBy(userId); + }else { + formQueryManageDO.setCreateBy(new Long("0")); + formQueryManageDO.setUpdateBy(new Long("0")); + } + formQueryManageDO.setCreateByName(userName); + formQueryManageDO.setUpdateByName(userName); + formQueryManageDO.setCreateTime(new Date()); + formQueryManageDO.setUpdateTime(new Date()); + formQueryManageDO.setDelFlag(1); + } + return formQueryManageDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryParamsAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryParamsAssembler.java new file mode 100644 index 000000000..5718b7316 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/FormQueryParamsAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.reportForm; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 报查询条件管理Assembler + * + * @author gen + * @date 2024-07-25 + */ +@Component +public class FormQueryParamsAssembler { + + /** + * 转换实体 + */ + public FormQueryParamsDO toDO(FormQueryParamsDTO formQueryParamsDTO) { + FormQueryParamsDO formQueryParamsDO = new FormQueryParamsDO(); + // 拷贝 + BeanUtils.copyProperties(formQueryParamsDTO, formQueryParamsDO, IgnoreNullUtil.getNullPropertyNames(formQueryParamsDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(formQueryParamsDTO.getFormQueryParamsId() != null){ + if(userId != null){ + formQueryParamsDO.setUpdateBy(userId); + }else { + formQueryParamsDO.setUpdateBy(new Long("0")); + } + formQueryParamsDO.setUpdateByName(userName); + formQueryParamsDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + formQueryParamsDO.setCreateBy(userId); + formQueryParamsDO.setUpdateBy(userId); + }else { + formQueryParamsDO.setCreateBy(new Long("0")); + formQueryParamsDO.setUpdateBy(new Long("0")); + } + formQueryParamsDO.setCreateByName(userName); + formQueryParamsDO.setUpdateByName(userName); + formQueryParamsDO.setCreateTime(new Date()); + formQueryParamsDO.setUpdateTime(new Date()); + formQueryParamsDO.setDelFlag(1); + } + return formQueryParamsDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/ReportFormAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/ReportFormAssembler.java new file mode 100644 index 000000000..126e3f1b6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/reportForm/ReportFormAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.reportForm; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import com.mhd.bms.interfaces.dto.reportForm.ReportFormDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 分析报管理Assembler + * + * @author gen + * @date 2024-07-25 + */ +@Component +public class ReportFormAssembler { + + /** + * 转换实体 + */ + public ReportFormDO toDO(ReportFormDTO reportFormDTO) { + ReportFormDO reportFormDO = new ReportFormDO(); + // 拷贝 + BeanUtils.copyProperties(reportFormDTO, reportFormDO, IgnoreNullUtil.getNullPropertyNames(reportFormDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(reportFormDTO.getReportFormId() != null){ + if(userId != null){ + reportFormDO.setUpdateBy(userId); + }else { + reportFormDO.setUpdateBy(new Long("0")); + } + reportFormDO.setUpdateByName(userName); + reportFormDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + reportFormDO.setCreateBy(userId); + reportFormDO.setUpdateBy(userId); + }else { + reportFormDO.setCreateBy(new Long("0")); + reportFormDO.setUpdateBy(new Long("0")); + } + reportFormDO.setCreateByName(userName); + reportFormDO.setUpdateByName(userName); + reportFormDO.setCreateTime(new Date()); + reportFormDO.setUpdateTime(new Date()); + reportFormDO.setDelFlag(1); + } + return reportFormDO; + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/settlementCustomers/SettlementCustomersAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/settlementCustomers/SettlementCustomersAssembler.java new file mode 100644 index 000000000..7078ecf65 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/settlementCustomers/SettlementCustomersAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.settlementCustomers; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import com.mhd.bms.interfaces.dto.settlementCustomers.SettlementCustomersDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 结算对象Assembler + * + * @author gen + * @date 2024-06-17 + */ +@Component +public class SettlementCustomersAssembler { + + /** + * 转换实体 + */ + public SettlementCustomersDO toDO(SettlementCustomersDTO settlementCustomersDTO) { + SettlementCustomersDO settlementCustomersDO = new SettlementCustomersDO(); + // 拷贝 + BeanUtils.copyProperties(settlementCustomersDTO, settlementCustomersDO, IgnoreNullUtil.getNullPropertyNames(settlementCustomersDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(settlementCustomersDTO.getSettlementCustomersId() != null){ + if(userId != null){ + settlementCustomersDO.setUpdateBy(userId); + }else { + settlementCustomersDO.setUpdateBy(new Long("0")); + } + settlementCustomersDO.setUpdateByName(userName); + settlementCustomersDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + settlementCustomersDO.setCreateBy(userId); + settlementCustomersDO.setUpdateBy(userId); + }else { + settlementCustomersDO.setCreateBy(new Long("0")); + settlementCustomersDO.setUpdateBy(new Long("0")); + } + settlementCustomersDO.setCreateByName(userName); + settlementCustomersDO.setUpdateByName(userName); + settlementCustomersDO.setCreateTime(new Date()); + settlementCustomersDO.setUpdateTime(new Date()); + settlementCustomersDO.setDelFlag(1); + } + return settlementCustomersDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/taskFlowRecords/TaskFlowRecordsAssembler.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/taskFlowRecords/TaskFlowRecordsAssembler.java new file mode 100644 index 000000000..2191bf221 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/assembler/taskFlowRecords/TaskFlowRecordsAssembler.java @@ -0,0 +1,65 @@ +package com.mhd.bms.interfaces.assembler.taskFlowRecords; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import com.mhd.bms.interfaces.dto.taskFlowRecords.TaskFlowRecordsDTO; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 任务流水记录Assembler + * + * @author gen + * @date 2024-06-20 + */ +@Component +public class TaskFlowRecordsAssembler { + + /** + * 转换实体 + */ + public TaskFlowRecordsDO toDO(TaskFlowRecordsDTO taskFlowRecordsDTO) { + TaskFlowRecordsDO taskFlowRecordsDO = new TaskFlowRecordsDO(); + // 拷贝 + BeanUtils.copyProperties(taskFlowRecordsDTO, taskFlowRecordsDO, IgnoreNullUtil.getNullPropertyNames(taskFlowRecordsDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(taskFlowRecordsDTO.getTaskFlowRecordsId() != null){ + if(userId != null){ + taskFlowRecordsDO.setUpdateBy(userId); + }else { + taskFlowRecordsDO.setUpdateBy(new Long("0")); + } + taskFlowRecordsDO.setUpdateByName(userName); + taskFlowRecordsDO.setUpdateTime(new Date()); + + }else { + if(userId != null){ + taskFlowRecordsDO.setCreateBy(userId); + taskFlowRecordsDO.setUpdateBy(userId); + }else { + taskFlowRecordsDO.setCreateBy(new Long("0")); + taskFlowRecordsDO.setUpdateBy(new Long("0")); + } + taskFlowRecordsDO.setCreateByName(userName); + taskFlowRecordsDO.setUpdateByName(userName); + taskFlowRecordsDO.setCreateTime(new Date()); + taskFlowRecordsDO.setUpdateTime(new Date()); + taskFlowRecordsDO.setDelFlag(1); + } + return taskFlowRecordsDO; + } + +} \ No newline at end of file diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillDetailDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillDetailDTO.java new file mode 100644 index 000000000..dacf3210c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillDetailDTO.java @@ -0,0 +1,127 @@ +package com.mhd.bms.interfaces.dto.billManage; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 账单流水明细对象 bill_detail + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillDetailDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单流水明细id") + private Long billDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("计费流水id") + @Excel(name = "计费流水id") + private Long billingStatementId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("费用总额") + @Excel(name = "费用总额") + private BigDecimal billingTotalAmount; + + @ApiModelProperty("账单优惠金额") + @Excel(name = "账单优惠金额") + private BigDecimal billingDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billingAmount; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billingExpectedAmount; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillManageDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillManageDTO.java new file mode 100644 index 000000000..7cb79e109 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billManage/BillManageDTO.java @@ -0,0 +1,214 @@ +package com.mhd.bms.interfaces.dto.billManage; + +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; +import java.util.Set; + +/** + * 账单管理对象 bill_manage + * + * @author gen + * @date 2024-07-02 + */ + +@Data +public class BillManageDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单类型(1-应收,2-应付)") + @Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付") + private Integer billType; + + @ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)") + @Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款") + private Integer billState; + + @ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)") + @Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款") + private Integer billStep; + + @ApiModelProperty("系统来源") + @Excel(name = "系统来源") + private String belongModule; + + @ApiModelProperty("系统来源code") + @Excel(name = "系统来源code") + private String belongModuleCode; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("账单总金额") + @Excel(name = "账单总金额") + private BigDecimal billTotalAmount; + + @ApiModelProperty("优惠金额") + @Excel(name = "优惠金额") + private BigDecimal billDiscountAmount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收/付金额") + @Excel(name = "已收/付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收/付金额") + @Excel(name = "未收/付金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("期望金额") + @Excel(name = "期望金额") + private BigDecimal billExpectedAmount; + + @ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)") + @Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误") + private Integer reconciliationStatus; + + @ApiModelProperty("对账意见描述") + @Excel(name = "对账意见描述") + private String reconciliationOpinion; + + @ApiModelProperty("客户凭证地址") + @Excel(name = "客户凭证地址") + private String voucherAddress; + + @ApiModelProperty("财务审核结果(1-同意,2-拒绝)") + @Excel(name = "财务审核结果(1-同意,2-拒绝)") + private Integer financialReviewFlag; + + @ApiModelProperty("审核意见描述") + @Excel(name = "审核意见描述") + private String financialReviewOpinion; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("收款/付款时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date settlementTime; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String billRemark; + + @ApiModelProperty("折扣百分比") + @Excel(name = "折扣百分比") + private BigDecimal billDiscount; + + @ApiModelProperty("折扣上限金额") + @Excel(name = "折扣上限金额") + private BigDecimal billDiscountLimit; + + @ApiModelProperty("费用计算精度code") + @Excel(name = "费用计算精度code") + private String costAccuracyCode; + + @ApiModelProperty("费用计算精度name") + @Excel(name = "费用计算精度name") + private String costAccuracyName; + + @ApiModelProperty("尾数计算code") + @Excel(name = "尾数计算code") + private String tailCalculationCode; + + @ApiModelProperty("尾数计算name") + @Excel(name = "尾数计算name") + private String tailCalculationName; + + @ApiModelProperty("账单金额精度code") + @Excel(name = "账单金额精度code") + private String amountAccuracyCode; + + @ApiModelProperty("账单金额精度name") + @Excel(name = "账单金额精度name") + private String amountAccuracyName; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("查询条件类型(1-未结清,2-已结清,3-已作废)") + private Integer queryParam; + + @ApiModelProperty("账单管理ids") + private String billManageIds; + + @ApiModelProperty(name = "账单管理id集合") + private Set billManageIdSet; + + @ApiModelProperty("账单详情明细列表") + private List billDetailDTOList; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("实收金额") + private BigDecimal actualReceivedAmount; + + @ApiModelProperty("结算单优惠金额") + private BigDecimal settlementDiscountsAmount; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billOperationLog/BillOperationLogDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billOperationLog/BillOperationLogDTO.java new file mode 100644 index 000000000..14d064baf --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billOperationLog/BillOperationLogDTO.java @@ -0,0 +1,56 @@ +package com.mhd.bms.interfaces.dto.billOperationLog; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 账单操作日志对象 bill_operation_log + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class BillOperationLogDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("账单操作日志id") + private Long billOperationLogId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单管理id") + @Excel(name = "账单管理id") + private Long billManageId; + + @ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)") + @Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款") + private Integer operationType; + + @ApiModelProperty("操作信息") + @Excel(name = "操作信息") + private String operationInfo; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingParamsDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingParamsDTO.java new file mode 100644 index 000000000..e7d20ebcb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingParamsDTO.java @@ -0,0 +1,68 @@ +package com.mhd.bms.interfaces.dto.billingRules; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 计费参数对象 billing_params + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingParamsDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费参数id") + private Long billingParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("计费参数表名称") + @Excel(name = "计费参数表名称") + private String billingParamsName; + + @ApiModelProperty("说明") + @Excel(name = "说明") + private String billingIllustrate; + + @ApiModelProperty("计费参数json串") + @Excel(name = "计费参数json串") + private String billingParamsJson; + + @ApiModelProperty("计费参数输出json串") + @Excel(name = "计费参数输出json串") + private String billingOutputJson; + + @ApiModelProperty("预置规则json串") + @Excel(name = "预置规则json串") + private String preSetRules; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingRulesDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingRulesDTO.java new file mode 100644 index 000000000..980f67cf7 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/BillingRulesDTO.java @@ -0,0 +1,108 @@ +package com.mhd.bms.interfaces.dto.billingRules; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 计费规则对象 billing_rules + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class BillingRulesDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费规则id") + private Long billingRulesId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("规则说明") + @Excel(name = "规则说明", readConverterExp = "规则说明") + private String billingRulesIllustrate; + + @ApiModelProperty("状态(1-开启,2-关闭)") + @Excel(name = "状态", readConverterExp = "1=-开启,2-关闭") + private Integer billingRulesState; + + @ApiModelProperty("计费公式") + @Excel(name = "计费公式") + private String billingFormula; + + @ApiModelProperty("计费规则ids") + private String billingRulesIds; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "计费参数集合") + private List billingParamsDTOList; + + @ApiModelProperty("计费规则编码") + @Excel(name = "计费规则编码") + private String billingRulesCode; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称", readConverterExp = "计费规则名称") + private String billingRulesName; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/CostCalculationDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/CostCalculationDTO.java new file mode 100644 index 000000000..5f433301f --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingRules/CostCalculationDTO.java @@ -0,0 +1,42 @@ +package com.mhd.bms.interfaces.dto.billingRules; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotBlank; + + +/** + * 费用计算请求实体 + * + */ + +@Data +public class CostCalculationDTO{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("原始单号") + private String originalBusinessNum; + + @ApiModelProperty("单据类型编码") + @NotBlank(message = "单据类型编码不能为空") + private String documentTypeCode; + + @ApiModelProperty("费用科目(一级或二级)") + @NotBlank(message = "费用科目编码不能为空") + private String subjectCode; + + @ApiModelProperty("合同编号") + @NotBlank(message = "合同编号不能为空") + private String contractNumber; + + @ApiModelProperty("参数json数组") + @NotBlank(message = "计费参数不能为空") + private String formJson; + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementCollectDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementCollectDTO.java new file mode 100644 index 000000000..560fb2414 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementCollectDTO.java @@ -0,0 +1,57 @@ +package com.mhd.bms.interfaces.dto.billingStatement; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +@Data +public class BillingStatementCollectDTO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("结算对象") + private String settlementEntity; + + @ApiModelProperty("结算代码") + private String settlementCustomersCode; + + @ApiModelProperty("费用总额") + private BigDecimal billAmountSum; + + @ApiModelProperty("费用类型") + private Integer accountExpenseType; + + @ApiModelProperty("流水数量") + private Integer countFee; + + @ApiModelProperty("创建时间从") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessStartDate; + + @ApiModelProperty("创建时间至") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date businessEndDate; + + @ApiModelProperty("所属组织") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("出账状态") + private Integer billingState; + + @ApiModelProperty("合同类型") + @Excel(name = "合同类型") + private String contractType; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java new file mode 100644 index 000000000..66b05f85b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/billingStatement/BillingStatementDTO.java @@ -0,0 +1,230 @@ +package com.mhd.bms.interfaces.dto.billingStatement; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 计费流水对象 billing_statement + * + * @author gen + * @date 2024-06-26 + */ + +@Data +public class BillingStatementDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("计费流水id") + private Long billingStatementId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("业务日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date businessDate; + + @ApiModelProperty("周期开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleBeginTime; + + @ApiModelProperty("周期结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date cycleEndTime; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code", readConverterExp = "服=务项") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id", readConverterExp = "服=务项") + private Long serviceItemsManageId; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目(结算项)") + @Excel(name = "一级费用科目", readConverterExp = "结=算项") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目(结算项)") + @Excel(name = "二级费用科目", readConverterExp = "结=算项") + private String secondSubjectName; + + @ApiModelProperty("流水金额") + @Excel(name = "流水金额") + private BigDecimal billingAmount; + + @ApiModelProperty("收支类型(1-应收,2-应付)") + @Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付") + private Integer accountExpenseType; + + @ApiModelProperty("流水备注") + @Excel(name = "流水备注") + private String billingRemark; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String originalBusinessNum; + + @ApiModelProperty("业务流水号") + @Excel(name = "业务流水号") + private String businessFlow; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)") + @Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废") + private Integer billingState; + + @ApiModelProperty("红冲状态(1-未红冲,2-已红冲)") + @Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲") + private Integer redFlushState; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("计费流水号") + @Excel(name = "计费流水号") + private String billingFlow; + + @ApiModelProperty("红冲原因") + @Excel(name = "红冲原因") + private String redFlushRemark; + + @ApiModelProperty("计费流水ids") + private String billingStatementIds; + + @ApiModelProperty("合同类型") + @Excel(name = "合同类型") + private String contractType; + + @ApiModelProperty("查询状态(1-未出账,2-已出账,3-其他)") + private Integer queryState; + + @ApiModelProperty(name = "审核操作(1-通过,2-驳回)") + private Integer auditOperation; + + @ApiModelProperty(name = "计费周期查询条件开始日期") + private String businessDateStart; + @ApiModelProperty(name = "计费周期查询条件结束日期") + private String businessDateEnd; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("账单创建时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + private Date billCreateTime; + + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/businessDocument/BusinessDocumentDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/businessDocument/BusinessDocumentDTO.java new file mode 100644 index 000000000..d2f8ba10c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/businessDocument/BusinessDocumentDTO.java @@ -0,0 +1,199 @@ +package com.mhd.bms.interfaces.dto.businessDocument; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 业务单据对象 business_document + * + * @author gen + * @date 2024-06-21 + */ + +@Data +public class BusinessDocumentDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("业务单据记录id") + private Long businessDocumentId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("业务流水") + @Excel(name = "业务流水") + private String businessFlow; + + @ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + @Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废") + private Integer businessState; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("数据来源(1-系统生成,2-手工录入)") + @Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入") + private Integer dataSources; + + @ApiModelProperty("单据类型id") + @Excel(name = "单据类型id") + private Long documentTypeId; + + @ApiModelProperty("单据类型code") + @Excel(name = "单据类型code") + private String documentTypeCode; + + @ApiModelProperty("单据类型") + @Excel(name = "单据类型") + private String documentType; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("项目编码") + @Excel(name = "项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + @Excel(name = "项目名称") + private String projectName; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("预计费金额") + @Excel(name = "预计费金额") + private BigDecimal estimatedCost; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("计费时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date billingTime; + + @ApiModelProperty("单据表单json数据") + @Excel(name = "单据表单json数据") + private String documentFormJson; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("业务单据记录ids") + private String businessDocumentIds; + + + @ApiModelProperty(name = "审核操作(1-通过,2-驳回)") + private Integer auditOperation; + + @ApiModelProperty("合同管理id") + @Excel(name = "合同管理id", readConverterExp = "合同管理id") + private Long contractManageId; + + @ApiModelProperty("项目管理id") + @Excel(name = "项目管理id", readConverterExp = "项目管理id") + private Long projectManageId; + + @ApiModelProperty("原始流水号") + @Excel(name = "原始流水号") + private String originalSerialNumber; + + @ApiModelProperty("费用类型code(服务项)") + @Excel(name = "费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + @Excel(name = "费用类型") + private String serviceItemsName; + + @ApiModelProperty("费用类型id(服务项)") + @Excel(name = "费用类型id(服务项)") + private Long serviceItemsManageId; + + @ApiModelProperty("单据备注") + @Excel(name = "单据备注") + private String remark; + + @ApiModelProperty("审核备注") + @Excel(name = "审核备注") + private String reviewRemarks; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("新计费金额") + private BigDecimal newBillAmount; + + @ApiModelProperty("重算金额") + private BigDecimal recalculateCost; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/conditionalMapping/ConditionalMappingDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/conditionalMapping/ConditionalMappingDTO.java new file mode 100644 index 000000000..b09b3c65d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/conditionalMapping/ConditionalMappingDTO.java @@ -0,0 +1,64 @@ +package com.mhd.bms.interfaces.dto.conditionalMapping; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 条件映射管理对象 conditional_mapping + * + * @author gen + * @date 2024-08-07 + */ + +@Data +public class ConditionalMappingDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("条件映射表id") + private Long conditionalMappingId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("源内容") + @Excel(name = "源内容") + private String sourceContent; + + @ApiModelProperty("映射后") + @Excel(name = "映射后") + private String afterMapping; + + @ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)") + @Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果") + private Integer mappingType; + + @ApiModelProperty("映射语句") + @Excel(name = "映射语句") + private String mappedStatement; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("条件映射表ids") + private String conditionalMappingIds; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/documentType/DocumentTypeDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/documentType/DocumentTypeDTO.java new file mode 100644 index 000000000..3757e490d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/documentType/DocumentTypeDTO.java @@ -0,0 +1,82 @@ +package com.mhd.bms.interfaces.dto.documentType; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 单据类型对象 document_type + * + * @author gen + * @date 2024-06-18 + */ + +@Data +public class DocumentTypeDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("单据类型id") + private Long documentTypeId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("类型名称") + @Excel(name = "类型名称") + private String documentType; + + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String documentTypeCode; + + @ApiModelProperty("对接系统编码") + @Excel(name = "对接系统编码") + private String belongModuleCode; + + @ApiModelProperty("对接系统") + @Excel(name = "对接系统") + private String belongModule; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("参数json数组") + @Excel(name = "参数json数组") + private String formJson; + + @ApiModelProperty("启用状态(1-启用,2-关闭)") + @Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭") + private Integer enablingStatus; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + @ApiModelProperty("单据类型ids") + private String documentTypeIds; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/mappingMethod/MappingMethodDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/mappingMethod/MappingMethodDTO.java new file mode 100644 index 000000000..dc9ae0aee --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/mappingMethod/MappingMethodDTO.java @@ -0,0 +1,64 @@ +package com.mhd.bms.interfaces.dto.mappingMethod; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 方法映射对象 mapping_method + * + * @author gen + * @date 2024-07-12 + */ + +@Data +public class MappingMethodDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("方法映射表id") + private Long mappingMethodId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("方法名称") + @Excel(name = "方法名称") + private String methodName; + + @ApiModelProperty("映射方法") + @Excel(name = "映射方法") + private String mappingMethod; + + @ApiModelProperty("类型(1-内置方法,2-逻辑语句)") + @Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句") + private Integer mappingType; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("方法映射表ids") + private String mappingMethodIds; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentManage/PaymentManageDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentManage/PaymentManageDTO.java new file mode 100644 index 000000000..b71f33b7d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentManage/PaymentManageDTO.java @@ -0,0 +1,56 @@ +package com.mhd.bms.interfaces.dto.paymentManage; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 支付管理对象 payment_manage + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentManageDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付管理id") + private Long paymentManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("支付管理ids") + private String paymentManageIds; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDTO.java new file mode 100644 index 000000000..f789b028b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDTO.java @@ -0,0 +1,128 @@ +package com.mhd.bms.interfaces.dto.paymentOrder; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 付款单对象 payment_order + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrderDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("支付通道code") + @Excel(name = "支付通道code") + private String paymentChannelCode; + + @ApiModelProperty("支付通道name") + @Excel(name = "支付通道name") + private String paymentChannelName; + + @ApiModelProperty("付款方式code") + @Excel(name = "付款方式code") + private String paymentMethodCode; + + @ApiModelProperty("付款方式") + @Excel(name = "付款方式") + private String paymentMethod; + + @ApiModelProperty("付款卡号id") + @Excel(name = "付款卡号id") + private Long paymentCardId; + + @ApiModelProperty("付款人") + private String paymentBindingName; + + @ApiModelProperty("卡号") + @Excel(name = "卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("付款凭证") + @Excel(name = "付款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String paymentRemark; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("账单管理ids") + private String billManageIds; + + @ApiModelProperty(name = "付款账单明细") + private List paymentOrderDetailsDTOList; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; + + @ApiModelProperty("结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算主体") + private String settlementEntity; + + @ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)") + private Integer paymentState; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + @ApiModelProperty("结算方式(1-现金,2-油卡)") + private Integer settlementWay; + + @ApiModelProperty("付款来源(1-人工付款,2-线上支付)") + private Integer paymentSource; + + @ApiModelProperty("开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty(name = "支付密码") + private String payPassword; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDetailsDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDetailsDTO.java new file mode 100644 index 000000000..4b94afdbe --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentOrder/PaymentOrderDetailsDTO.java @@ -0,0 +1,73 @@ +package com.mhd.bms.interfaces.dto.paymentOrder; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 付款单详情对象 payment_order_details + * + * @author gen + * @date 2024-07-16 + */ + +@Data +public class PaymentOrderDetailsDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("付款单id") + private Long paymentOrderDetailsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已付金额") + @Excel(name = "已付金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("本次付款金额") + @Excel(name = "本次付款金额") + private BigDecimal paymentAmount; + + @ApiModelProperty("剩余未付金额") + @Excel(name = "剩余未付金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("付款单id") + private Long paymentOrderId; + + @ApiModelProperty("账单管理id") + private Long billManageId; + + @ApiModelProperty("付款单号") + private String paymentOrderNum; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentWallet/PaymentWalletDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentWallet/PaymentWalletDTO.java new file mode 100644 index 000000000..048447fb8 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/paymentWallet/PaymentWalletDTO.java @@ -0,0 +1,80 @@ +package com.mhd.bms.interfaces.dto.paymentWallet; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 支付钱包管理对象 payment_wallet + * + * @author gen + * @date 2024-07-09 + */ + +@Data +public class PaymentWalletDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("支付钱包管理id") + private Long paymentWalletId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("主体编码(银行卡号、微信openid、支付宝openid等)") + @Excel(name = "主体编码", readConverterExp = "银=行卡号、微信openid、支付宝openid等") + private String mainNumber; + + @ApiModelProperty("主体名称") + @Excel(name = "主体名称") + private String mainName; + + @ApiModelProperty("银行名称") + @Excel(name = "银行名称") + private String bankName; + + @ApiModelProperty("开户行") + @Excel(name = "开户行") + private String bankDeposi; + + @ApiModelProperty("手机号") + @Excel(name = "手机号") + private String phone; + + @ApiModelProperty("支付方式编码") + @Excel(name = "支付方式编码") + private String paymentMethodCode; + + @ApiModelProperty("支付方式名称") + @Excel(name = "支付方式名称") + private String paymentMethod; + + @ApiModelProperty("支付方式id") + @Excel(name = "支付方式id") + private Long paymentManageId; + + @ApiModelProperty("支付钱包管理ids") + private String paymentWalletIds; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptDetailDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptDetailDTO.java new file mode 100644 index 000000000..a0d85830a --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptDetailDTO.java @@ -0,0 +1,85 @@ +package com.mhd.bms.interfaces.dto.receiptManage; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 收款单详情对象 receipt_detail + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptDetailDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptDetailId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("账单id") + @Excel(name = "账单id") + private Long billManageId; + + @ApiModelProperty("账单编号") + @Excel(name = "账单编号") + private String billNumber; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("剩余未收金额") + @Excel(name = "剩余未收金额") + private BigDecimal billAmountUnsettledResidue; + + @ApiModelProperty("收款单id") + @Excel(name = "收款单id") + private Long receiptManageId; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptManageDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptManageDTO.java new file mode 100644 index 000000000..ddf5bca2c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/receiptManage/ReceiptManageDTO.java @@ -0,0 +1,167 @@ +package com.mhd.bms.interfaces.dto.receiptManage; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.List; + +/** + * 收款单管理对象 receipt_manage + * + * @author gen + * @date 2024-07-08 + */ + +@Data +public class ReceiptManageDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("收款单id") + private Long receiptManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("收款单号") + @Excel(name = "收款单号") + private String collectionNum; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("结算对象code") + @Excel(name = "结算对象code") + private String settlementCustomersCode; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("收款优惠金额") + @Excel(name = "收款优惠金额") + private BigDecimal collectedDiscount; + + @ApiModelProperty("账单金额") + @Excel(name = "账单金额") + private BigDecimal billAmount; + + @ApiModelProperty("已收金额") + @Excel(name = "已收金额") + private BigDecimal billAmountSettlement; + + @ApiModelProperty("未收金额") + @Excel(name = "未收金额") + private BigDecimal billAmountUnsettled; + + @ApiModelProperty("收款金额") + @Excel(name = "收款金额") + private BigDecimal collectedAmount; + + @ApiModelProperty("剩余未收") + @Excel(name = "剩余未收") + private BigDecimal uncollectedAmount; + + @ApiModelProperty("收款方式code") + @Excel(name = "收款方式code") + private String paymentMethodCode; + + @ApiModelProperty("收款方式") + @Excel(name = "收款方式") + private String paymentMethod; + + @ApiModelProperty("收款卡号id") + @Excel(name = "收款卡号id") + private Long paymentCardId; + + @ApiModelProperty("收款卡号") + @Excel(name = "收款卡号") + private String paymentCard; + + @ApiModelProperty("交易流水") + @Excel(name = "交易流水") + private String transactionFlow; + + @ApiModelProperty("收据号") + @Excel(name = "收据号") + private String receiptNumber; + + @ApiModelProperty("收款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date collectionTime; + + @ApiModelProperty("收款凭证") + @Excel(name = "收款凭证") + private String receiptVoucher; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String collectionRemark; + + @ApiModelProperty("收款单ids") + private String receiptManageIds; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("账单管理ids") + private String billManageIds; + + @ApiModelProperty("账单管理ids") + private List receiptDetailDTOList; + + @ApiModelProperty(name = "收款人用户ID") + private Long payeeUserId; + @ApiModelProperty("收款人") + private String payeeName; + + @ApiModelProperty("退款金额") + private BigDecimal refundAmount; + + @ApiModelProperty("退款时间") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date refundTime; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + @ApiModelProperty(name = "收款时间查询条件开始日期") + private String collectionTimeStart; + @ApiModelProperty(name = "收款时间查询条件结束日期") + private String collectionTimeEnd; + + @ApiModelProperty("收款状态(1-正常,2-退款)") + private Integer paymentStatus; + + @ApiModelProperty(name = "支付密码") + private String payPassword; + + @ApiModelProperty("收款来源(1-人工付款,2-线上支付)") + private Integer collectionSource; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryManageDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryManageDTO.java new file mode 100644 index 000000000..9910d6f6c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryManageDTO.java @@ -0,0 +1,61 @@ +package com.mhd.bms.interfaces.dto.reportForm; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 查询条件管理对象 form_query_manage + * + * @author gen + * @date 2024-07-26 + */ + +@Data +public class FormQueryManageDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("查询条件名称") + @Excel(name = "查询条件名称") + private String formQueryName; + + @ApiModelProperty("所属报表类型((1-综合分析报表,2-账单分析报表,3-结算分析报表))") + @Excel(name = "所属报表类型", readConverterExp = "(=1-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "查询条件明细列表") + private List formQueryParamsDTOList; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("默认状态(1-是,2-否)") + private Integer defaultFlag; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryParamsDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryParamsDTO.java new file mode 100644 index 000000000..f89918a1c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/FormQueryParamsDTO.java @@ -0,0 +1,82 @@ +package com.mhd.bms.interfaces.dto.reportForm; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 报查询条件管理对象 form_query_params + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class FormQueryParamsDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询条件id") + private Long formQueryParamsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("字段编码") + @Excel(name = "字段编码") + private String field; + + @ApiModelProperty("字段名称") + @Excel(name = "字段名称") + private String fieldName; + + @ApiModelProperty("过滤方法(1-=,2-!=,3->,4->=,5-<,6-<=,7-包含,8-不包含,9-在列表,10-不在列表)") + private Integer filterMethod; + + @ApiModelProperty("输入框值") + @Excel(name = "输入框值") + private String inputBoxText; + + @ApiModelProperty("输入框查询方法") + @Excel(name = "输入框查询方法") + private String inputBoxMethod; + + @ApiModelProperty("输入框类型(1-文本,2-下拉框,3-日期选择器)") + @Excel(name = "输入框类型", readConverterExp = "1=-文本,2-下拉框,3-日期选择器") + private Integer inputBoxType; + + @ApiModelProperty("关系(1-并且,2-或者)") + @Excel(name = "关系", readConverterExp = "1=-并且,2-或者") + private Integer queryRelation; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("查询条件管理id") + private Long formQueryManageId; + + @ApiModelProperty("查询条件json(前端保存用)") + private String paramsInfoJson; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/ReportFormDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/ReportFormDTO.java new file mode 100644 index 000000000..cdc8418b8 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/reportForm/ReportFormDTO.java @@ -0,0 +1,69 @@ +package com.mhd.bms.interfaces.dto.reportForm; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 分析报管理对象 report_form + * + * @author gen + * @date 2024-07-25 + */ + +@Data +public class ReportFormDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("报表查询id") + private Long reportFormId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("报表名称") + @Excel(name = "报表名称") + private String reportFormName; + + @ApiModelProperty("序号") + @Excel(name = "序号") + private Integer sort; + + @ApiModelProperty("描述") + @Excel(name = "描述") + private String formDescribe; + + @ApiModelProperty("创建人") + @Excel(name = "创建人") + private String createFormName; + + @ApiModelProperty("查询条件json") + @Excel(name = "查询条件json") + private String queryParamJson; + + @ApiModelProperty("报表类型(1-综合分析报表,2-账单分析报表,3-结算分析报表)") + @Excel(name = "报表类型", readConverterExp = "1=-综合分析报表,2-账单分析报表,3-结算分析报表") + private Integer formType; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/settlementCustomers/SettlementCustomersDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/settlementCustomers/SettlementCustomersDTO.java new file mode 100644 index 000000000..4600483d7 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/settlementCustomers/SettlementCustomersDTO.java @@ -0,0 +1,105 @@ +package com.mhd.bms.interfaces.dto.settlementCustomers; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 结算对象对象 settlement_customers + * + * @author gen + * @date 2024-06-17 + */ + +@Data +public class SettlementCustomersDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("结算对象编码") + @Excel(name = "结算对象编码") + private String settlementCustomersCode; + + @ApiModelProperty("结算主体id") + @Excel(name = "结算主体id") + private Long settlementEntityId; + + @ApiModelProperty("结算主体") + @Excel(name = "结算主体") + private String settlementEntity; + + @ApiModelProperty("结算方式") + @Excel(name = "结算方式") + private String settlementMethod; + + @ApiModelProperty("结算方式编码") + @Excel(name = "结算方式编码") + private String settlementMethodCode; + + @ApiModelProperty("开户银行名称") + @Excel(name = "开户银行名称") + private String bankName; + + @ApiModelProperty("银行卡号") + @Excel(name = "银行卡号") + private String bankCardNumber; + + @ApiModelProperty("银行卡预留姓名") + @Excel(name = "银行卡预留姓名") + private String bankBindingName; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + + @ApiModelProperty("结算对象ids") + private String settlementCustomersIds; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色(1-客户,2-供应商)") + private Integer mainRole; + + @ApiModelProperty("客户类型") + private String customerType; + + @ApiModelProperty("客户类型编码") + private String customerTypeCode; + + @ApiModelProperty("项目编码") + private String projectCode; + + @ApiModelProperty("项目名称") + private String projectName; + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/taskFlowRecords/TaskFlowRecordsDTO.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/taskFlowRecords/TaskFlowRecordsDTO.java new file mode 100644 index 000000000..0c4c049f4 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/dto/taskFlowRecords/TaskFlowRecordsDTO.java @@ -0,0 +1,151 @@ +package com.mhd.bms.interfaces.dto.taskFlowRecords; + +import com.mhd.common.core.annotation.Excel; +import lombok.Data; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import io.swagger.annotations.ApiModelProperty; +import com.mhd.common.core.web.domain.BaseVOEntity; + +import java.util.List; + +/** + * 任务流水记录对象 task_flow_records + * + * @author gen + * @date 2024-06-20 + */ + +@Data +public class TaskFlowRecordsDTO extends BaseVOEntity{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty("任务流水记录id") + private Long taskFlowRecordsId; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("任务流水") + @Excel(name = "任务流水") + private String taskFlow; + + @ApiModelProperty("来源模块code") + @Excel(name = "来源模块code") + private String belongModuleCode; + + @ApiModelProperty("来源模块") + @Excel(name = "来源模块") + private String belongModule; + + @ApiModelProperty("单据类别id") + @Excel(name = "单据类别id") + private Long documentTypeId; + + @ApiModelProperty("单据类别code") + @Excel(name = "单据类别code") + private String documentTypeCode; + + @ApiModelProperty("单据类别") + @Excel(name = "单据类别") + private String documentType; + + @ApiModelProperty("一级费用科目code") + @Excel(name = "一级费用科目code") + private String firstSubjectCode; + + @ApiModelProperty("一级费用科目") + @Excel(name = "一级费用科目") + private String firstSubjectName; + + @ApiModelProperty("二级费用科目code") + @Excel(name = "二级费用科目code") + private String secondSubjectCode; + + @ApiModelProperty("二级费用科目") + @Excel(name = "二级费用科目") + private String secondSubjectName; + + @ApiModelProperty("原始业务单号") + @Excel(name = "原始业务单号") + private String originalBusinessNum; + + @ApiModelProperty("结算对象") + @Excel(name = "结算对象") + private String settlementEntity; + + @ApiModelProperty("结算对象id") + @Excel(name = "结算对象id") + private Long settlementCustomersId; + + @ApiModelProperty("主体角色(1-客户,2-供应商)") + @Excel(name = "主体角色", readConverterExp = "1-客户,2-供应商") + private Integer mainRole; + + @ApiModelProperty("合同编号") + @Excel(name = "合同编号") + private String contractNumber; + + @ApiModelProperty("合同名称") + @Excel(name = "合同名称") + private String contractName; + + @ApiModelProperty("计费规则id") + @Excel(name = "计费规则id") + private Long billingRulesId; + + @ApiModelProperty("计费规则名称") + @Excel(name = "计费规则名称") + private String billingRules; + + @ApiModelProperty("计费规则code") + @Excel(name = "计费规则code") + private String billingRulesCode; + + @ApiModelProperty("计费过程") + @Excel(name = "计费过程") + private String billingProcess; + + @ApiModelProperty("计费结果") + @Excel(name = "计费结果") + private String billingResults; + + @ApiModelProperty("原始参数json") + @Excel(name = "原始参数json") + private String requestParams; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty(name = "创建时间查询条件开始日期") + private String createTimeStart; + @ApiModelProperty(name = "创建时间查询条件结束日期") + private String createTimeEnd; + @ApiModelProperty(name = "修改时间查询条件开始日期") + private String updateTimeStart; + @ApiModelProperty(name = "修改时间查询条件结束日期") + private String updateTimeEnd; + + @ApiModelProperty("任务流水记录ids") + private String taskFlowRecordsIds; + + @ApiModelProperty("费用类型code(服务项)") + private String serviceItemsCode; + + @ApiModelProperty("费用类型") + private String serviceItemsName; +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillManageApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillManageApi.java new file mode 100644 index 000000000..5b161eafe --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillManageApi.java @@ -0,0 +1,284 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.mhd.bms.application.server.billManage.BillManageApplicationService; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.infrastructure.utils.UniqueKeyUtil; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.redis.enums.RedisLockTypeEnum; +import com.mhd.common.redis.service.RedisLock; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.redisson.RedissonMultiLock; +import org.redisson.api.RLock; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.billManage.BillManageDTO; +import com.mhd.bms.domain.billManage.repository.todo.BillManageDO; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.interfaces.assembler.billManage.BillManageAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 账单管理Api + * + * @author gen + * @date 2024-07-02 + */ +@Slf4j +@RestController +@RequestMapping("/billManageApi") +public class BillManageApi extends BaseController{ + @Autowired + private BillManageApplicationService billManageApplicationService; + @Autowired + private RedisLock redisLock; + + /** + * 分页查询账单管理列表 + */ + @ApiOperation("查询应收账单管理列表") + @GetMapping("/receivableList") + public TableDataInfo receivableList(BillManageDTO billManageDTO) + { + //转换实体 + BillManageDO billManageDO = new BillManageDO(); + BeanUtils.copyProperties(billManageDTO,billManageDO); + startPage(); + billManageDO.setBillType(1); + List list = billManageApplicationService.queryList(billManageDO); + return getDataTable(list); + } + + + + @ApiOperation("应收账单管理列表统计") + @GetMapping(value = "/receivableListCount") + public AjaxResult receivableListCount(BillManageDTO billManageDTO) + { + //转换实体 + BillManageDO billManageDO = new BillManageDO(); + BeanUtils.copyProperties(billManageDTO,billManageDO); + billManageDO.setBillType(1); + return AjaxResult.success(billManageApplicationService.listCount(billManageDO)); + } + + + @ApiOperation("应付账单管理列表统计") + @GetMapping(value = "/paymentListCount") + public AjaxResult paymentListCount(BillManageDTO billManageDTO) + { + //转换实体 + BillManageDO billManageDO = new BillManageDO(); + BeanUtils.copyProperties(billManageDTO,billManageDO); + billManageDO.setBillType(2); + return AjaxResult.success(billManageApplicationService.listCount(billManageDO)); + } + + + @ApiOperation("查询应付账单管理列表") + @GetMapping("/paymentList") + public TableDataInfo paymentList(BillManageDTO billManageDTO) + { + //转换实体 + BillManageDO billManageDO = new BillManageDO(); + BeanUtils.copyProperties(billManageDTO,billManageDO); + startPage(); + billManageDO.setBillType(2); + List list = billManageApplicationService.queryList(billManageDO); + return getDataTable(list); + } + + + /** + * 批量删除账单管理 + */ + @ApiOperation("批量删除账单管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody BillManageDTO billManageDTO) + { + try { + return toAjax(billManageApplicationService.deleteByIds(billManageDTO)); + }catch (Exception e){ + return AjaxResult.error("删除失败:"+e.getMessage()); + } + } + + @ApiOperation("批量作废") + @PostMapping("/nullifyByIds") + public AjaxResult nullifyByIds(@RequestBody BillManageDTO billManageDTO) + { + try { + return toAjax(billManageApplicationService.nullifyByIds(billManageDTO)); + }catch (Exception e){ + return AjaxResult.error("操作失败:"+e.getMessage()); + } + } + + + @ApiOperation("发起对账") + @PostMapping("/reconciliation") + public AjaxResult reconciliation(@RequestBody BillManageDTO billManageDTO) + { + try { + return toAjax(billManageApplicationService.reconciliation(billManageDTO)); + }catch (Exception e){ + return AjaxResult.error("发起对账失败:"+e.getMessage()); + } + } + + @ApiOperation("确认账单") + @PostMapping("/confirmBilling") + public AjaxResult confirmBilling(@RequestBody BillManageDTO billManageDTO) + { + try { + return toAjax(billManageApplicationService.confirmBilling(billManageDTO)); + }catch (Exception e){ + return AjaxResult.error("确认账单失败:"+e.getMessage()); + } + } + + + + /** + * 获取账单管理详细信息 + */ + @ApiOperation("获取账单管理明细") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(BillManageDTO billManageDTO) + { + return AjaxResult.success(billManageApplicationService.getInfoById(billManageDTO)); + } + + + + @ApiOperation("确认调整账单") + @PostMapping("/confirmChangeBill") + public AjaxResult confirmChangeBill(@RequestBody BillManageDTO billManageDTO) + { + if(billManageDTO.getBillManageId() == null){ + throw new ServiceException("调整账单id不能为空"); + } + //加锁 + RLock lock = null; + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(String.valueOf(billManageDTO.getBillManageId()))); + try { + lock = redisLock.getRLock(key); + //尝试获取锁 不等待 持有锁10分钟 + if (!lock.tryLock(-1, 10, TimeUnit.MINUTES)) { + lock = null; + throw new ServiceException("账单正在调整中,请稍后重试"); + } + log.info("调整账单加锁成功"); + billManageApplicationService.confirmChangeBill(billManageDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("调整账单失败:"+e.getMessage()); + } finally { + if (lock != null && lock.isHeldByCurrentThread()){ + lock.unlock(); + log.info("调整账单释放锁成功"); + } + } + } + + + @ApiOperation("应收账单-客户确认") + @PostMapping("/customerConfirmation") + public AjaxResult customerConfirmation(@RequestBody BillManageDTO billManageDTO) + { + if(billManageDTO.getBillManageId() == null){ + throw new ServiceException("账单id不能为空"); + } + //加锁 + RLock lock = null; + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(String.valueOf(billManageDTO.getBillManageId()))); + try { + lock = redisLock.getRLock(key); + //尝试获取锁 不等待 持有锁10分钟 + if (!lock.tryLock(-1, 10, TimeUnit.MINUTES)) { + lock = null; + throw new ServiceException("账单正在操作中,请稍后重试"); + } + log.info("客户确认账单加锁成功"); + billManageApplicationService.customerConfirmation(billManageDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("客户确认账单失败:"+e.getMessage()); + } finally { + if (lock != null && lock.isHeldByCurrentThread()){ + lock.unlock(); + log.info("客户确认账单释放锁成功"); + } + } + } + + + @ApiOperation("应收账单-财务审核") + @PostMapping("/financialReview") + public AjaxResult financialReview(@RequestBody BillManageDTO billManageDTO) + { + if(billManageDTO.getBillManageId() == null){ + throw new ServiceException("账单id不能为空"); + } + //加锁 + RLock lock = null; + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(String.valueOf(billManageDTO.getBillManageId()))); + try { + lock = redisLock.getRLock(key); + //尝试获取锁 不等待 持有锁10分钟 + if (!lock.tryLock(-1, 10, TimeUnit.MINUTES)) { + lock = null; + throw new ServiceException("账单正在操作中,请稍后重试"); + } + log.info("财务审核账单加锁成功"); + billManageApplicationService.financialReview(billManageDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("财务审核账单失败:"+e.getMessage()); + } finally { + if (lock != null && lock.isHeldByCurrentThread()){ + lock.unlock(); + log.info("财务审核账单释放锁成功"); + } + } + } + + + /** + * 获取账单详情 + */ + @ApiOperation("获取账单详情") + @GetMapping(value = "/getDetailsById") + public AjaxResult getDetailsById(BillManageDTO billManageDTO) + { + return AjaxResult.success(billManageApplicationService.getDetailsById(billManageDTO)); + } + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillOperationLogApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillOperationLogApi.java new file mode 100644 index 000000000..6831eb241 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillOperationLogApi.java @@ -0,0 +1,99 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.billOperationLog.BillOperationLogApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.billOperationLog.BillOperationLogDTO; +import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO; +import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO; +import com.mhd.bms.interfaces.assembler.billOperationLog.BillOperationLogAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 账单操作日志Api + * + * @author gen + * @date 2024-07-09 + */ +@RestController +@RequestMapping("/billOperationLogApi") +public class BillOperationLogApi extends BaseController{ + @Autowired + private BillOperationLogApplicationService billOperationLogApplicationService; + + @Resource + private BillOperationLogAssembler billOperationLogAssembler; + + /** + * 分页查询账单操作日志列表 + */ + @ApiOperation("查询账单操作日志列表") + @GetMapping("/list") + public TableDataInfo list(BillOperationLogDTO billOperationLogDTO) + { + //转换实体 + BillOperationLogDO billOperationLogDO = billOperationLogAssembler.toDO(billOperationLogDTO); + startPage(); + List list = billOperationLogApplicationService.queryList(billOperationLogDO); + return getDataTable(list); + } + + /** + * 保存账单操作日志 + */ + @ApiOperation("保存账单操作日志") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody BillOperationLogDTO billOperationLogDTO) + { + //转换实体 + BillOperationLogDO billOperationLogDO = billOperationLogAssembler.toDO(billOperationLogDTO); + if(billOperationLogDTO.getBillOperationLogId() != null){ + return toAjax(billOperationLogApplicationService.update(billOperationLogDO)); + }else { + return toAjax(billOperationLogApplicationService.insert(billOperationLogDO)); + } + } + + /** + * 批量删除账单操作日志 + */ + @ApiOperation("批量删除账单操作日志") + @DeleteMapping("/deleteByIds/{billOperationLogIds}") + public AjaxResult delete(@PathVariable Long[] billOperationLogIds) + { + return toAjax(billOperationLogApplicationService.delete(billOperationLogIds)); + } + + /** + * 获取账单操作日志详细信息 + */ + @ApiOperation("获取账单操作日志") + @GetMapping(value = "/getInfo/{billOperationLogId}") + public AjaxResult getInfo(@PathVariable("billOperationLogId") Long billOperationLogId) + { + return AjaxResult.success(billOperationLogApplicationService.getInfo(billOperationLogId)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingRulesApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingRulesApi.java new file mode 100644 index 000000000..704bc855b --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingRulesApi.java @@ -0,0 +1,120 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.billingRules.BillingRulesApplicationService; +import com.mhd.bms.domain.billingRules.entity.BillingParams; +import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO; +import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.billingRules.BillingRulesDTO; +import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.interfaces.assembler.billingRules.BillingRulesAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 计费规则Api + * + * @author gen + * @date 2024-07-12 + */ +@RestController +@RequestMapping("/billingRulesApi") +public class BillingRulesApi extends BaseController{ + @Autowired + private BillingRulesApplicationService billingRulesApplicationService; + + @Resource + private BillingRulesAssembler billingRulesAssembler; + + /** + * 分页查询计费规则列表 + */ + @ApiOperation("查询计费规则列表") + @GetMapping("/list") + public TableDataInfo list(BillingRulesDTO billingRulesDTO) + { + //转换实体 + BillingRulesDO billingRulesDO = new BillingRulesDO(); + BeanUtils.copyProperties(billingRulesDTO,billingRulesDO); + startPage(); + List list = billingRulesApplicationService.queryList(billingRulesDO); + return getDataTable(list); + } + + /** + * 保存计费规则 + */ + @ApiOperation("保存计费规则") + @PostMapping("/saveBillingRules") + public AjaxResult saveBillingRules(@RequestBody BillingRulesDTO billingRulesDTO) + { + //转换实体 + BillingRulesDO billingRulesDO = billingRulesAssembler.toDO(billingRulesDTO); + if(billingRulesDTO.getBillingRulesId() != null){ + return toAjax(billingRulesApplicationService.update(billingRulesDO)); + }else { + return toAjax(billingRulesApplicationService.insert(billingRulesDO)); + } + } + + /** + * 批量删除计费规则 + */ + @ApiOperation("批量删除计费规则") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody BillingRulesDTO billingRulesDTO) + { + try { + return toAjax(billingRulesApplicationService.deleteByIds(billingRulesDTO)); + }catch (Exception e){ + return AjaxResult.error("操作失败:" + e.getMessage()); + } + } + + /** + * 获取计费规则详细信息 + */ + @ApiOperation("获取计费规则详情") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(BillingRulesDTO billingRulesDTO) + { + return AjaxResult.success(billingRulesApplicationService.getInfoById(billingRulesDTO)); + } + + + @ApiOperation("修改计费规则状态") + @PostMapping("/changeStates") + public AjaxResult changeStates(@RequestBody BillingRulesDTO billingRulesDTO) + { + try { + return toAjax(billingRulesApplicationService.changeStates(billingRulesDTO)); + }catch (Exception e){ + return AjaxResult.error("操作失败:" + e.getMessage()); + } + } + + + @ApiOperation("获取计费规则详情(不含明细)") + @GetMapping(value = "/getInfoByCode") + public AjaxResult getInfoByCode(@RequestParam("billingRulesCode") String billingRulesCode) + { + BillingRulesPO billingRulesPO = billingRulesApplicationService.getInfoByCode(billingRulesCode); + return AjaxResult.success(billingRulesPO == null ? new BillingRulesPO(): billingRulesPO); + } + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingStatementApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingStatementApi.java new file mode 100644 index 000000000..774f4988d --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BillingStatementApi.java @@ -0,0 +1,330 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.mhd.bms.application.server.billingStatement.BillingStatementApplicationService; +import com.mhd.bms.domain.billManage.repository.po.BillDetailPO; +import com.mhd.bms.domain.billManage.repository.po.BillManagePO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO; +import com.mhd.bms.infrastructure.utils.UniqueKeyUtil; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementCollectDTO; +import com.mhd.common.core.domain.entity.R; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.redis.enums.RedisLockTypeEnum; +import com.mhd.bms.infrastructure.utils.UniqueKeyUtil; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.redis.enums.RedisLockTypeEnum; +import com.mhd.common.redis.service.RedisLock; +import lombok.extern.slf4j.Slf4j; +import org.redisson.RedissonMultiLock; +import org.redisson.api.RLock; +import org.springframework.beans.BeanUtils; +import io.swagger.annotations.ApiOperation; +import org.redisson.RedissonMultiLock; +import org.redisson.api.RLock; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO; +import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO; +import com.mhd.bms.interfaces.assembler.billingStatement.BillingStatementAssembler; + +import javax.annotation.Resource; + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 计费流水Api + * + * @author gen + * @date 2024-06-26 + */ +@Slf4j +@RestController +@RequestMapping("/billingStatementApi") +public class BillingStatementApi extends BaseController { + @Autowired + private BillingStatementApplicationService billingStatementApplicationService; + + @Resource + private BillingStatementAssembler billingStatementAssembler; + @Autowired + private RedisLock redisLock; + /** + * 分页查询计费流水列表 + */ + @ApiOperation("查询计费流水列表") + @GetMapping("/list") + public TableDataInfo list(BillingStatementDTO billingStatementDTO) { + //转换实体 + BillingStatementDO billingStatementDO = new BillingStatementDO(); + BeanUtils.copyProperties(billingStatementDTO, billingStatementDO); + startPage(); + List list = billingStatementApplicationService.queryList(billingStatementDO); + return getDataTable(list); + } + + /** + * 查询出账汇总 + */ + @ApiOperation("查询出账汇总") + @GetMapping("/collectList") + public TableDataInfo collectList(BillingStatementCollectDTO billingStatementCollectDTO) { + BillingStatementCollectDO billingStatementAssemblerDO = new BillingStatementCollectDO(); + BeanUtils.copyProperties(billingStatementCollectDTO, billingStatementAssemblerDO); + startPage(); + List billingStatementCollectDOS = + billingStatementApplicationService.queryCollectList(billingStatementAssemblerDO); + return getDataTable(billingStatementCollectDOS); + + } + + + /** + * 查询出账未出账全部 + */ + @ApiOperation("查询出账未出账全部") + @GetMapping("/collectListSize") + public AjaxResult collectListSize(BillingStatementCollectDO billingStatementCollectDO) { + return AjaxResult.success(billingStatementApplicationService.collectListSize(billingStatementCollectDO)); + } + + /** + * 查询出账详情 + */ + @ApiOperation("查询出账详情") + @GetMapping("/collectDetails") + public AjaxResult collectDetails(BillingStatementCollectDTO dto) { + BillingStatementCollectDO bdo = billingStatementAssembler.toCDO(dto); + if (Objects.isNull(bdo.getSettlementCustomersCode()) || bdo.getSettlementCustomersCode().equals("")) { + return AjaxResult.error("结算对象code不能为空"); + } + return AjaxResult.success(billingStatementApplicationService.queryDetails(bdo)); + } + + /** + * 保存计费流水 + */ + @ApiOperation("保存计费流水") + @PostMapping("/save") + public AjaxResult save(@RequestBody BillingStatementDTO billingStatementDTO) { + try { + //转换实体 + BillingStatementDO billingStatementDO = billingStatementAssembler.toDO(billingStatementDTO); + if (billingStatementDTO.getBillingStatementId() != null) { + return toAjax(billingStatementApplicationService.update(billingStatementDO)); + } else { + return toAjax(billingStatementApplicationService.insert(billingStatementDO)); + } + }catch (Exception e){ + return AjaxResult.error("操作失败"+e.getMessage()); + } + } + + /** + * 批量删除计费流水 + */ + @ApiOperation("批量删除计费流水") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody BillingStatementDTO billingStatementDTO) { + try { + return toAjax(billingStatementApplicationService.deleteByIds(billingStatementDTO)); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 获取计费流水详细信息 + */ + @ApiOperation("获取计费流水") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(BillingStatementDTO billingStatementDTO) { + return AjaxResult.success(billingStatementApplicationService.getInfo(billingStatementDTO.getBillingStatementId())); + } + + + @ApiOperation("批量审核") + @PostMapping("/reviewBilling") + public AjaxResult reviewBilling(@RequestBody BillingStatementDTO billingStatementDTO) + { + try { + billingStatementApplicationService.reviewBilling(billingStatementDTO); + return AjaxResult.success("审核成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + @ApiOperation("批量费用红冲") + @PostMapping("/redFlushBilling") + public AjaxResult redFlushBilling(@RequestBody BillingStatementDTO billingStatementDTO) + { + try { + billingStatementApplicationService.redFlushBilling(billingStatementDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + + @ApiOperation("生成账单") + @PostMapping("/generateBills") + public AjaxResult generateBills(@RequestBody BillingStatementDTO billingStatementDTO) + { + if(!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())){ + throw new ServiceException("所选生成账单对象不能为空"); + } + //加锁 + RedissonMultiLock redissonMultiLock = null; + boolean payInfoDetailLock = false; + try { + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + List locks = new ArrayList<>(); + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + billingSet.forEach(x -> { + //获取唯一key值 + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(x.toString())); + locks.add(redisLock.getRLock(key)); + }); + redissonMultiLock = new RedissonMultiLock(locks.toArray(new RLock[billingSet.size()])); + //尝试获取锁 不等待 持有锁10分钟 + payInfoDetailLock = redissonMultiLock.tryLock(-1, 10, TimeUnit.MINUTES); + if (!payInfoDetailLock) { + redissonMultiLock = null; + return AjaxResult.error("计费流水正在处理,请稍后再试"); + } + log.info("生成账单加锁成功"); + billingStatementApplicationService.generateBills(billingStatementDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } finally { + if (redissonMultiLock != null && payInfoDetailLock) { + redissonMultiLock.unlock(); + log.info("生成账单释放了锁"); + } + } + } + + + @ApiOperation("批量流水作废") + @PostMapping("/nullifyByIds") + public AjaxResult nullifyByIds(@RequestBody BillingStatementDTO billingStatementDTO) + { + try { + billingStatementApplicationService.nullifyByIds(billingStatementDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + + @ApiOperation("查询批量出账列表") + @GetMapping("/queryPaymentOutList") + public TableDataInfo queryPaymentOutList(BillingStatementDTO billingStatementDTO) + { + //转换实体 + BillingStatementDO billingStatementDO = new BillingStatementDO(); + BeanUtils.copyProperties(billingStatementDTO,billingStatementDO); + List list = billingStatementApplicationService.queryPaymentOutList(billingStatementDO); + return getDataTable(list); + } + + + + @ApiOperation("批量生成账单") + @PostMapping("/batchGenerateBills") + public AjaxResult batchGenerateBills(@RequestBody BillingStatementDTO billingStatementDTO) + { + /* + 暂时不做异步处理,后续使用中,数据量较大时,在考虑异步处理或者其他优化 + */ + if(!StringUtils.isNotEmpty(billingStatementDTO.getBillingStatementIds())){ + throw new ServiceException("所选生成账单对象不能为空"); + } + //加锁 + RedissonMultiLock redissonMultiLock = null; + boolean payInfoDetailLock = false; + try { + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + List locks = new ArrayList<>(); + Set billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet()); + billingSet.forEach(x -> { + //获取唯一key值 + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(x.toString())); + locks.add(redisLock.getRLock(key)); + }); + redissonMultiLock = new RedissonMultiLock(locks.toArray(new RLock[billingSet.size()])); + //尝试获取锁 不等待 持有锁10分钟 + payInfoDetailLock = redissonMultiLock.tryLock(-1, 10, TimeUnit.MINUTES); + if (!payInfoDetailLock) { + redissonMultiLock = null; + return AjaxResult.error("计费流水正在处理,请稍后再试"); + } + log.info("生成账单加锁成功"); + //批量生成账单 + billingStatementApplicationService.batchGenerateBills(billingStatementDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } finally { + if (redissonMultiLock != null && payInfoDetailLock) { + redissonMultiLock.unlock(); + log.info("生成账单释放了锁"); + } + } + } + + @ApiOperation("查询计费流水列表统计") + @GetMapping("/queryListCount") + public AjaxResult> queryListCount(BillingStatementDTO billingStatementDTO) + { + //转换实体 + BillingStatementDO billingStatementDO = new BillingStatementDO(); + BeanUtils.copyProperties(billingStatementDTO,billingStatementDO); + Map listCount = billingStatementApplicationService.queryListCount(billingStatementDO); + return AjaxResult.success("查询成功",listCount); + } + + + @ApiOperation("应收账单-添加费用") + @PostMapping("/addCost") + public AjaxResult addCost(@RequestBody BillingStatementDTO billingStatementDTO) { + try { + BillingStatementDO billingStatementDO = billingStatementAssembler.toDO(billingStatementDTO); + BillingStatementPO billingStatementPO = billingStatementApplicationService.addCost(billingStatementDO); + return AjaxResult.success("操作成功",billingStatementPO == null ? new BillingStatementPO():billingStatementPO); + }catch (Exception e){ + return AjaxResult.error("操作失败"+e.getMessage()); + } + } + + + @ApiOperation("应收账单-添加明细") + @GetMapping("/getBillDetailsList") + public TableDataInfo getBillDetailsList(BillingStatementDTO billingStatementDTO) { + BillingStatementDO billingStatementDO = new BillingStatementDO(); + BeanUtils.copyProperties(billingStatementDTO, billingStatementDO); + //转换实体 + List list = billingStatementApplicationService.getBillDetailsList(billingStatementDO); + return getDataTable(list); + } + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BusinessDocumentApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BusinessDocumentApi.java new file mode 100644 index 000000000..09968a3a6 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/BusinessDocumentApi.java @@ -0,0 +1,219 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.businessDocument.BusinessDocumentApplicationService; +import com.mhd.common.core.domain.dto.BusinessDataPushDTO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.interfaces.assembler.businessDocument.BusinessDocumentAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 业务单据Api + * + * @author gen + * @date 2024-06-21 + */ +@RestController +@RequestMapping("/businessDocumentApi") +public class BusinessDocumentApi extends BaseController{ + @Autowired + private BusinessDocumentApplicationService businessDocumentApplicationService; + + @Resource + private BusinessDocumentAssembler businessDocumentAssembler; + + /** + * 分页查询业务单据列表 + */ + @ApiOperation("查询业务单据列表") + @GetMapping("/list") + public TableDataInfo list(BusinessDocumentDTO businessDocumentDTO) + { + //转换实体 + BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO(); + BeanUtils.copyProperties(businessDocumentDTO,businessDocumentDO); + startPage(); + List list = businessDocumentApplicationService.queryList(businessDocumentDO); + return getDataTable(list); + } + + /** + * 保存业务单据 + */ + @ApiOperation("保存业务单据") + @PostMapping("/save") + public AjaxResult save(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + //转换实体 + BusinessDocumentDO businessDocumentDO = businessDocumentAssembler.toDO(businessDocumentDTO); + if(businessDocumentDTO.getBusinessDocumentId() != null){ + return toAjax(businessDocumentApplicationService.update(businessDocumentDO)); + }else { + return toAjax(businessDocumentApplicationService.insert(businessDocumentDO)); + } + }catch (Exception e){ + return AjaxResult.error("保存业务单据失败" +e.getMessage()); + } + + } + + /** + * 批量删除业务单据 + */ + @ApiOperation("批量删除业务单据") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + businessDocumentApplicationService.deleteByIds(businessDocumentDTO); + return AjaxResult.success("删除成功"); + }catch (Exception e){ + return AjaxResult.error("删除失败:" + e.getMessage()); + } + } + + /** + * 获取业务单据详细信息 + */ + @ApiOperation("获取业务单据") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(BusinessDocumentDTO businessDocumentDTO) + { + return AjaxResult.success(businessDocumentApplicationService.getInfo(businessDocumentDTO.getBusinessDocumentId())); + } + + + /** + * 同步业务数据 + */ + @ApiOperation("同步业务单据") + @PostMapping("/syncData") + public AjaxResult syncData(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + //转换实体 + BusinessDocumentDO businessDocumentDO = businessDocumentAssembler.toDO(businessDocumentDTO); + String result = businessDocumentApplicationService.syncData(businessDocumentDO); + return AjaxResult.success("同步成功",result); + }catch (Exception e){ + return AjaxResult.error("同步业务单据失败" + e.getMessage()); + } + } + + + @ApiOperation("费用重算") + @PostMapping("/costRecalculation") + public AjaxResult costRecalculation(@RequestBody List businessDocumentDTOList) + { + try { + businessDocumentApplicationService.costRecalculation(businessDocumentDTOList); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("操作失败" + e.getMessage()); + } + } + + @ApiOperation("费用重算重算列表查询") + @GetMapping("/costRecalculationList") + public AjaxResult costRecalculationList(BusinessDocumentDTO businessDocumentDTO) + { + BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO(); + BeanUtils.copyProperties(businessDocumentDTO,businessDocumentDO); + List list = businessDocumentApplicationService.costRecalculationList(businessDocumentDO); + return AjaxResult.success("操作成功",list); + } + + + @ApiOperation("批量作废业务单据") + @PostMapping("/nullifyByIds") + public AjaxResult nullifyByIds(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + businessDocumentApplicationService.nullifyByIds(businessDocumentDTO); + return AjaxResult.success("作废成功"); + }catch (Exception e){ + return AjaxResult.error("作废失败:" + e.getMessage()); + } + } + + + + @ApiOperation("批量生效业务单据") + @PostMapping("/takeEffectByIds") + public AjaxResult takeEffectByIds(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + businessDocumentApplicationService.takeEffectByIds(businessDocumentDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("操作失败:" + e.getMessage()); + } + } + + + @ApiOperation("批量审核业务单据") + @PostMapping("/auditByIds") + public AjaxResult auditByIds(@RequestBody BusinessDocumentDTO businessDocumentDTO) + { + try { + businessDocumentApplicationService.auditByIds(businessDocumentDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error("操作失败:" + e.getMessage()); + } + } + + + + @ApiOperation("导入业务单据") + @PostMapping("/importDocument") + public AjaxResult importDocument(@RequestBody List businessDocumentDTOList) + { + try { + //转换实体 + return toAjax(businessDocumentApplicationService.importDocument(businessDocumentDTOList)); + }catch (Exception e){ + return AjaxResult.error("导入业务单据失败" +e.getMessage()); + } + + } + + + @ApiOperation("推送同步业务单据") + @PostMapping("/pushSyncData") + public AjaxResult pushSyncData(@RequestBody @Validated BusinessDataPushDTO businessDataPushDTO) + { + try { + //转换实体 + BusinessDocumentDO businessDocumentDO = new BusinessDocumentAssembler().syncDataAssemble(businessDataPushDTO); + return toAjax(businessDocumentApplicationService.pushSyncData(businessDocumentDO)); + }catch (Exception e){ + return AjaxResult.error("结算系统操作失败:" + e.getMessage()); + } + } + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ConditionalMappingApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ConditionalMappingApi.java new file mode 100644 index 000000000..f73d320ca --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ConditionalMappingApi.java @@ -0,0 +1,93 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.conditionalMapping.ConditionalMappingApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.conditionalMapping.ConditionalMappingDTO; +import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO; +import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO; +import com.mhd.bms.interfaces.assembler.conditionalMapping.ConditionalMappingAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 条件映射管理Api + * + * @author gen + * @date 2024-08-07 + */ +@RestController +@RequestMapping("/conditionalMappingApi") +public class ConditionalMappingApi extends BaseController{ + @Autowired + private ConditionalMappingApplicationService conditionalMappingApplicationService; + + @Resource + private ConditionalMappingAssembler conditionalMappingAssembler; + + /** + * 分页查询条件映射管理列表 + */ + @ApiOperation("查询条件映射管理列表") + @GetMapping("/list") + public TableDataInfo list(ConditionalMappingDTO conditionalMappingDTO) + { + //转换实体 + ConditionalMappingDO conditionalMappingDO = conditionalMappingAssembler.toDO(conditionalMappingDTO); + startPage(); + List list = conditionalMappingApplicationService.queryList(conditionalMappingDO); + return getDataTable(list); + } + + /** + * 保存条件映射管理 + */ + @ApiOperation("保存条件映射管理") + @PostMapping("/save") + public AjaxResult save(@RequestBody ConditionalMappingDTO conditionalMappingDTO) + { + //转换实体 + ConditionalMappingDO conditionalMappingDO = conditionalMappingAssembler.toDO(conditionalMappingDTO); + if(conditionalMappingDTO.getConditionalMappingId() != null){ + return toAjax(conditionalMappingApplicationService.update(conditionalMappingDO)); + }else { + return toAjax(conditionalMappingApplicationService.insert(conditionalMappingDO)); + } + } + + /** + * 批量删除条件映射管理 + */ + @ApiOperation("批量删除条件映射管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody ConditionalMappingDTO conditionalMappingDTO) + { + return toAjax(conditionalMappingApplicationService.deleteByIds(conditionalMappingDTO)); + } + + /** + * 获取条件映射管理详细信息 + */ + @ApiOperation("获取条件映射管理") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(@RequestParam("conditionalMappingId") Long conditionalMappingId) + { + return AjaxResult.success(conditionalMappingApplicationService.getInfo(conditionalMappingId)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/CostCalculationApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/CostCalculationApi.java new file mode 100644 index 000000000..a8d97d311 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/CostCalculationApi.java @@ -0,0 +1,45 @@ +package com.mhd.bms.interfaces.facadeApi; + +import com.mhd.bms.application.server.billingRules.CostCalculationApplicationService; +import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO; +import com.mhd.bms.domain.costCalculation.po.BillingCostPo; +import com.mhd.bms.interfaces.dto.billingRules.CostCalculationDTO; +import com.mhd.bms.interfaces.dto.documentType.DocumentTypeDTO; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.annotation.RepeatSubmit; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + + +/** + * 费用计算Api + */ +@RestController +@RequestMapping("/costCalculationApi") +public class CostCalculationApi extends BaseController{ + @Autowired + private CostCalculationApplicationService costCalculationApplicationService; + + + /** + * BMS费用计算 + */ + @RepeatSubmit + @ApiOperation("BMS费用计算") + @PostMapping("/costCalculation") + public AjaxResult costCalculation(@Validated @RequestBody CostCalculationDTO costCalculationDTO) + { + try { + BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO); + return AjaxResult.success("计算成功",billingCostPo == null ? new BillingCostPo():billingCostPo); + }catch (Exception e){ + return AjaxResult.error("费用计算失败:" + e.getMessage()); + } + } + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/DocumentTypeApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/DocumentTypeApi.java new file mode 100644 index 000000000..858952bfb --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/DocumentTypeApi.java @@ -0,0 +1,118 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; +import java.util.Set; + +import com.mhd.bms.application.server.documentType.DocumentTypeApplicationService; +import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO; +import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.documentType.DocumentTypeDTO; +import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO; +import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO; +import com.mhd.bms.interfaces.assembler.documentType.DocumentTypeAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 单据类型Api + * + * @author gen + * @date 2024-06-18 + */ +@RestController +@RequestMapping("/documentTypeApi") +public class DocumentTypeApi extends BaseController{ + @Autowired + private DocumentTypeApplicationService documentTypeApplicationService; + + @Resource + private DocumentTypeAssembler documentTypeAssembler; + + /** + * 分页查询单据类型列表 + */ + @ApiOperation("查询单据类型列表") + @GetMapping("/list") + public TableDataInfo list(DocumentTypeDTO documentTypeDTO) + { + //转换实体 + DocumentTypeDO documentTypeDO = documentTypeAssembler.toDO(documentTypeDTO); + startPage(); + List list = documentTypeApplicationService.queryList(documentTypeDO); + return getDataTable(list); + } + + /** + * 保存单据类型 + */ + @ApiOperation("保存单据类型") + @PostMapping("/save") + public AjaxResult save(@RequestBody DocumentTypeDTO documentTypeDTO) + { + //转换实体 + DocumentTypeDO documentTypeDO = documentTypeAssembler.toDO(documentTypeDTO); + if(documentTypeDTO.getDocumentTypeId() != null){ + return toAjax(documentTypeApplicationService.update(documentTypeDO)); + }else { + return toAjax(documentTypeApplicationService.insert(documentTypeDO)); + } + } + + /** + * 批量删除单据类型 + */ + @ApiOperation("批量删除单据类型") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody DocumentTypeDTO documentTypeDTO) + { + return toAjax(documentTypeApplicationService.deleteByIds(documentTypeDTO)); + } + + /** + * 获取单据类型详细信息 + */ + @ApiOperation("获取单据类型") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(DocumentTypeDTO documentTypeDTO) + { + return AjaxResult.success(documentTypeApplicationService.getInfo(documentTypeDTO.getDocumentTypeId())); + } + + + @ApiOperation("修改单据类型状态") + @PostMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody DocumentTypeDTO documentTypeDTO) + { + DocumentTypeDO documentTypeDO = new DocumentTypeDO(); + BeanUtils.copyProperties(documentTypeDTO,documentTypeDO); + try { + return toAjax(documentTypeApplicationService.changeStatus(documentTypeDO)); + }catch (Exception e){ + return AjaxResult.error("修改单据类型状态失败:"+e.getMessage()); + } + } + + + @ApiOperation("根据单据Code查询单据信息") + @GetMapping("/getDocumentInfoByCodeSet") + public AjaxResult getDocumentInfoByCodeSet(@RequestParam("documentTypeCodeSet") Set documentTypeCodeSet) + { + DocumentTypeDO documentTypeDO = new DocumentTypeDO(); + documentTypeDO.setDocumentTypeCodeSet(documentTypeCodeSet); + List list = documentTypeApplicationService.queryList(documentTypeDO); + return AjaxResult.success("操作成功",list); + } + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryManageApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryManageApi.java new file mode 100644 index 000000000..41c07df83 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryManageApi.java @@ -0,0 +1,96 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.reportForm.FormQueryManageApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryManageDTO; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryManageDO; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryManagePO; +import com.mhd.bms.interfaces.assembler.reportForm.FormQueryManageAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 查询条件管理Api + * + * @author gen + * @date 2024-07-26 + */ +@RestController +@RequestMapping("/formQueryManageApi") +public class FormQueryManageApi extends BaseController{ + @Autowired + private FormQueryManageApplicationService formQueryManageApplicationService; + + @Resource + private FormQueryManageAssembler formQueryManageAssembler; + + /** + * 分页查询查询条件管理列表 + */ + @ApiOperation("查询查询条件管理列表") + @GetMapping("/list") + public AjaxResult list(FormQueryManageDTO formQueryManageDTO) + { + //转换实体 + FormQueryManageDO formQueryManageDO = new FormQueryManageDO(); + BeanUtils.copyProperties(formQueryManageDTO,formQueryManageDO); + List list = formQueryManageApplicationService.queryList(formQueryManageDO); + return AjaxResult.success("操作成功",list); + } + + /** + * 保存查询条件管理 + */ + @ApiOperation("保存查询条件管理") + @PostMapping("/save") + public AjaxResult save(@RequestBody FormQueryManageDTO formQueryManageDTO) + { + //转换实体 + FormQueryManageDO formQueryManageDO = formQueryManageAssembler.toDO(formQueryManageDTO); + if(formQueryManageDTO.getFormQueryManageId() != null){ + return toAjax(formQueryManageApplicationService.update(formQueryManageDO)); + }else { + return toAjax(formQueryManageApplicationService.insert(formQueryManageDO)); + } + } + + /** + * 批量删除查询条件管理 + */ + @ApiOperation("批量删除查询条件管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody FormQueryManageDTO formQueryManageDTO) + { + return toAjax(formQueryManageApplicationService.deleteByIds(formQueryManageDTO)); + } + + + + /** + * 获取查询条件管理详细信息 + */ + @ApiOperation("获取查询条件管理") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfo(@RequestParam(value = "formQueryManageId",required = true) Long formQueryManageId) + { + return AjaxResult.success(formQueryManageApplicationService.getInfo(formQueryManageId)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryParamsApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryParamsApi.java new file mode 100644 index 000000000..702116883 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/FormQueryParamsApi.java @@ -0,0 +1,84 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.reportForm.FormQueryParamsApplicationService; +import com.mhd.bms.interfaces.assembler.reportForm.FormQueryParamsAssembler; +import com.mhd.bms.interfaces.dto.reportForm.FormQueryParamsDTO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.domain.reportForm.repository.todo.FormQueryParamsDO; +import com.mhd.bms.domain.reportForm.repository.po.FormQueryParamsPO; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 报查询条件管理Api + * + * @author gen + * @date 2024-07-25 + */ +@RestController +@RequestMapping("/formQueryParamsApi") +public class FormQueryParamsApi extends BaseController{ + @Autowired + private FormQueryParamsApplicationService formQueryParamsApplicationService; + + @Resource + private FormQueryParamsAssembler formQueryParamsAssembler; + + /** + * 分页查询报查询条件管理列表 + */ + @ApiOperation("查询报查询条件管理列表") + @GetMapping("/list") + public AjaxResult list(FormQueryParamsDTO formQueryParamsDTO) + { + //转换实体 + FormQueryParamsDO formQueryParamsDO = new FormQueryParamsDO(); + BeanUtils.copyProperties(formQueryParamsDTO,formQueryParamsDO); + List list = formQueryParamsApplicationService.queryList(formQueryParamsDO); + return AjaxResult.success("操作成功",list); + } + + /** + * 批量删除报查询条件管理 + */ + @ApiOperation("批量删除报查询条件管理") + @DeleteMapping("/deleteByIds/{formQueryParamsIds}") + public AjaxResult delete(@PathVariable Long[] formQueryParamsIds) + { + return toAjax(formQueryParamsApplicationService.delete(formQueryParamsIds)); + } + + /** + * 获取报查询条件管理详细信息 + */ + @ApiOperation("获取报查询条件管理") + @GetMapping(value = "/getInfo/{formQueryParamsId}") + public AjaxResult getInfo(@PathVariable("formQueryParamsId") Long formQueryParamsId) + { + return AjaxResult.success(formQueryParamsApplicationService.getInfo(formQueryParamsId)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/MappingMethodApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/MappingMethodApi.java new file mode 100644 index 000000000..5b7d902f0 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/MappingMethodApi.java @@ -0,0 +1,102 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.mappingMethod.MappingMethodApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.mappingMethod.MappingMethodDTO; +import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO; +import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO; +import com.mhd.bms.interfaces.assembler.mappingMethod.MappingMethodAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 方法映射Api + * + * @author gen + * @date 2024-07-12 + */ +@RestController +@RequestMapping("/mappingMethodApi") +public class MappingMethodApi extends BaseController{ + @Autowired + private MappingMethodApplicationService mappingMethodApplicationService; + + @Resource + private MappingMethodAssembler mappingMethodAssembler; + + /** + * 分页查询方法映射列表 + */ + @ApiOperation("查询方法映射列表") + @GetMapping("/list") + public TableDataInfo list(MappingMethodDTO mappingMethodDTO) + { + //转换实体 + MappingMethodDO mappingMethodDO = new MappingMethodDO(); + BeanUtils.copyProperties(mappingMethodDTO,mappingMethodDO); + startPage(); + List list = mappingMethodApplicationService.queryList(mappingMethodDO); + return getDataTable(list); + } + + /** + * 保存方法映射 + */ + @ApiOperation("保存方法映射") + @PostMapping("/save") + public AjaxResult save(@RequestBody MappingMethodDTO mappingMethodDTO) + { + //转换实体 + MappingMethodDO mappingMethodDO = mappingMethodAssembler.toDO(mappingMethodDTO); + if(mappingMethodDTO.getMappingMethodId() != null){ + return toAjax(mappingMethodApplicationService.update(mappingMethodDO)); + }else { + return toAjax(mappingMethodApplicationService.insert(mappingMethodDO)); + } + } + + /** + * 批量删除方法映射 + */ + @ApiOperation("批量删除方法映射") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody MappingMethodDTO mappingMethodDTO) + { + return toAjax(mappingMethodApplicationService.deleteByIds(mappingMethodDTO)); + } + + /** + * 获取方法映射详细信息 + */ + @ApiOperation("获取方法映射") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(MappingMethodDTO mappingMethodDTO) + { + return AjaxResult.success(mappingMethodApplicationService.getInfoById(mappingMethodDTO)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentManageApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentManageApi.java new file mode 100644 index 000000000..efff98c44 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentManageApi.java @@ -0,0 +1,115 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.ArrayList; +import java.util.List; + +import com.mhd.bms.application.server.paymentManage.PaymentManageApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.paymentManage.PaymentManageDTO; +import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO; +import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO; +import com.mhd.bms.interfaces.assembler.paymentManage.PaymentManageAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 支付管理Api + * + * @author gen + * @date 2024-07-09 + */ +@RestController +@RequestMapping("/paymentManageApi") +public class PaymentManageApi extends BaseController{ + @Autowired + private PaymentManageApplicationService paymentManageApplicationService; + + @Resource + private PaymentManageAssembler paymentManageAssembler; + + /** + * 分页查询支付管理列表 + */ + @ApiOperation("查询支付管理列表") + @GetMapping("/list") + public TableDataInfo list(PaymentManageDTO paymentManageDTO) + { + //转换实体 + PaymentManageDO paymentManageDO = paymentManageAssembler.toDO(paymentManageDTO); + startPage(); + List list = paymentManageApplicationService.queryList(paymentManageDO); + return getDataTable(list); + } + + + @ApiOperation("查询支付管理列表--不分页") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(PaymentManageDTO paymentManageDTO) + { + //转换实体 + PaymentManageDO paymentManageDO = paymentManageAssembler.toDO(paymentManageDTO); + List list = paymentManageApplicationService.queryList(paymentManageDO); + return AjaxResult.success("操作成功", list == null ? new ArrayList<>():list); + } + + /** + * 保存支付管理 + */ + @ApiOperation("保存支付管理") + @PostMapping("/save") + public AjaxResult save(@RequestBody PaymentManageDTO paymentManageDTO) + { + //转换实体 + PaymentManageDO paymentManageDO = paymentManageAssembler.toDO(paymentManageDTO); + if(paymentManageDTO.getPaymentManageId() != null){ + return toAjax(paymentManageApplicationService.update(paymentManageDO)); + }else { + return toAjax(paymentManageApplicationService.insert(paymentManageDO)); + } + } + + /** + * 批量删除支付管理 + */ + @ApiOperation("批量删除支付管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody PaymentManageDTO paymentManageDTO) + { + try { + return toAjax(paymentManageApplicationService.deleteByIds(paymentManageDTO)); + }catch (Exception e){ + return AjaxResult.error("操作失败:" + e.getMessage()); + } + } + + /** + * 获取支付管理详细信息 + */ + @ApiOperation("获取支付管理") + @GetMapping(value = "/getInfo/{paymentManageId}") + public AjaxResult getInfo(@PathVariable("paymentManageId") Long paymentManageId) + { + return AjaxResult.success(paymentManageApplicationService.getInfo(paymentManageId)); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentOrderApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentOrderApi.java new file mode 100644 index 000000000..3707feb40 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentOrderApi.java @@ -0,0 +1,157 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.mhd.bms.application.server.paymentOrder.PaymentOrderApplicationService; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.infrastructure.utils.UniqueKeyUtil; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptManageDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.redis.enums.RedisLockTypeEnum; +import com.mhd.common.redis.service.RedisLock; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.redisson.RedissonMultiLock; +import org.redisson.api.RLock; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDTO; +import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO; +import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO; +import com.mhd.bms.interfaces.assembler.paymentOrder.PaymentOrderAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 付款单Api + * + * @author gen + * @date 2024-07-16 + */ +@Slf4j +@RestController +@RequestMapping("/paymentOrderApi") +public class PaymentOrderApi extends BaseController{ + @Autowired + private PaymentOrderApplicationService paymentOrderApplicationService; + + @Resource + private PaymentOrderAssembler paymentOrderAssembler; + @Autowired + private RedisLock redisLock; + + /** + * 分页查询付款单列表 + */ + @ApiOperation("查询付款单列表") + @GetMapping("/list") + public TableDataInfo list(PaymentOrderDTO paymentOrderDTO) + { + //转换实体 + PaymentOrderDO paymentOrderDO = new PaymentOrderDO(); + BeanUtils.copyProperties(paymentOrderDTO,paymentOrderDO); + startPage(); + List list = paymentOrderApplicationService.queryList(paymentOrderDO); + return getDataTable(list); + } + + /** + * 编辑付款单 + */ + @ApiOperation("编辑付款单") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody PaymentOrderDTO paymentOrderDTO) + { + //转换实体 + PaymentOrderDO paymentOrderDO = paymentOrderAssembler.toDO(paymentOrderDTO); + if(paymentOrderDTO.getPaymentOrderId() != null){ + return toAjax(paymentOrderApplicationService.update(paymentOrderDO)); + }else { + return toAjax(paymentOrderApplicationService.insert(paymentOrderDO)); + } + } + + /** + * 批量删除付款单 + */ + @ApiOperation("批量删除付款单") + @DeleteMapping("/deleteByIds/{paymentOrderIds}") + public AjaxResult delete(@PathVariable Long[] paymentOrderIds) + { + return toAjax(paymentOrderApplicationService.delete(paymentOrderIds)); + } + + /** + * 获取付款单详细信息 + */ + @ApiOperation("获取付款单") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(PaymentOrderDTO paymentOrderDTO) + { + return AjaxResult.success(paymentOrderApplicationService.getInfoById(paymentOrderDTO)); + } + + @ApiOperation("批量付款") + @PostMapping("/batchPayment") + public AjaxResult batchPayment(@RequestBody PaymentOrderDTO paymentOrderDTO) + { + if(!StringUtils.isNotEmpty(paymentOrderDTO.getBillManageIds())){ + throw new ServiceException("付款账单不能为空"); + } + RedissonMultiLock redissonMultiLock = null; + boolean payInfoDetailLock = false; + try { + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + List locks = new ArrayList<>(); + Set billingSet = Stream.of(paymentOrderDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + billingSet.forEach(x -> { + //获取唯一key值 + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(x.toString())); + locks.add(redisLock.getRLock(key)); + }); + redissonMultiLock = new RedissonMultiLock(locks.toArray(new RLock[billingSet.size()])); + //尝试获取锁 不等待 持有锁10分钟 + payInfoDetailLock = redissonMultiLock.tryLock(-1, 10, TimeUnit.MINUTES); + if (!payInfoDetailLock) { + redissonMultiLock = null; + return AjaxResult.error("账单正在处理,请稍后再试"); + } + log.info("账单付款加锁成功"); + //转换实体 + PaymentOrderDO paymentOrderDO = new PaymentOrderAssembler().toDO(paymentOrderDTO); + BeanUtils.copyProperties(paymentOrderDTO,paymentOrderDO); + return toAjax(paymentOrderApplicationService.batchPayment(paymentOrderDO)); + }catch (Exception e){ + return AjaxResult.error("付款失败" + e.getMessage()); + }finally { + if (redissonMultiLock != null && payInfoDetailLock) { + redissonMultiLock.unlock(); + log.info("账单付款释放了锁"); + } + } + } + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentWalletApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentWalletApi.java new file mode 100644 index 000000000..3b2401d59 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/PaymentWalletApi.java @@ -0,0 +1,114 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.ArrayList; +import java.util.List; + +import com.mhd.bms.application.server.paymentWallet.PaymentWalletApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.paymentWallet.PaymentWalletDTO; +import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO; +import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO; +import com.mhd.bms.interfaces.assembler.paymentWallet.PaymentWalletAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 支付钱包管理Api + * + * @author gen + * @date 2024-07-09 + */ +@RestController +@RequestMapping("/paymentWalletApi") +public class PaymentWalletApi extends BaseController{ + @Autowired + private PaymentWalletApplicationService paymentWalletApplicationService; + + @Resource + private PaymentWalletAssembler paymentWalletAssembler; + + /** + * 分页查询支付钱包管理列表 + */ + @ApiOperation("查询支付钱包管理列表") + @GetMapping("/list") + public TableDataInfo list(PaymentWalletDTO paymentWalletDTO) + { + //转换实体 + PaymentWalletDO paymentWalletDO = paymentWalletAssembler.toDO(paymentWalletDTO); + startPage(); + List list = paymentWalletApplicationService.queryList(paymentWalletDO); + return getDataTable(list); + } + + /** + * 保存支付钱包管理 + */ + @ApiOperation("保存支付钱包管理") + @PostMapping("/save") + public AjaxResult save(@RequestBody PaymentWalletDTO paymentWalletDTO) + { + //转换实体 + PaymentWalletDO paymentWalletDO = paymentWalletAssembler.toDO(paymentWalletDTO); + if(paymentWalletDTO.getPaymentWalletId() != null){ + return toAjax(paymentWalletApplicationService.update(paymentWalletDO)); + }else { + return toAjax(paymentWalletApplicationService.insert(paymentWalletDO)); + } + } + + /** + * 批量删除支付钱包管理 + */ + @ApiOperation("批量删除支付钱包管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody PaymentWalletDTO paymentWalletDTO) + { + return toAjax(paymentWalletApplicationService.deleteByIds(paymentWalletDTO)); + } + + /** + * 获取支付钱包管理详细信息 + */ + @ApiOperation("获取支付钱包管理") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(PaymentWalletDTO paymentWalletDTO) + { + return AjaxResult.success(paymentWalletApplicationService.getInfoById(paymentWalletDTO)); + } + + + + @ApiOperation("查询支付钱包管理列表--不分页") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(PaymentWalletDTO paymentWalletDTO) + { + //转换实体 + PaymentWalletDO paymentWalletDO = new PaymentWalletDO(); + BeanUtils.copyProperties(paymentWalletDTO,paymentWalletDO); + List list = paymentWalletApplicationService.queryList(paymentWalletDO); + return AjaxResult.success("操作成功",list == null ? new ArrayList<>():list); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReceiptManageApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReceiptManageApi.java new file mode 100644 index 000000000..7aa97686c --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReceiptManageApi.java @@ -0,0 +1,185 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.mhd.bms.application.server.receiptManage.ReceiptManageApplicationService; +import com.mhd.bms.infrastructure.utils.UniqueKeyUtil; +import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.redis.enums.RedisLockTypeEnum; +import com.mhd.common.redis.service.RedisLock; +import com.mhd.common.security.annotation.RepeatSubmit; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.redisson.RedissonMultiLock; +import org.redisson.api.RLock; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.receiptManage.ReceiptManageDTO; +import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO; +import com.mhd.bms.domain.receiptManage.repository.po.ReceiptManagePO; +import com.mhd.bms.interfaces.assembler.receiptManage.ReceiptManageAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 收款单管理Api + * + * @author gen + * @date 2024-07-08 + */ +@Slf4j +@RestController +@RequestMapping("/receiptManageApi") +public class ReceiptManageApi extends BaseController{ + @Autowired + private ReceiptManageApplicationService receiptManageApplicationService; + + @Resource + private ReceiptManageAssembler receiptManageAssembler; + @Autowired + private RedisLock redisLock; + + /** + * 分页查询收款单管理列表 + */ + @ApiOperation("查询收款单管理列表") + @GetMapping("/list") + public TableDataInfo list(ReceiptManageDTO receiptManageDTO) + { + //转换实体 + ReceiptManageDO receiptManageDO = new ReceiptManageDO(); + BeanUtils.copyProperties(receiptManageDTO,receiptManageDO); + startPage(); + List list = receiptManageApplicationService.queryList(receiptManageDO); + return getDataTable(list); + } + + /** + * 编辑收款单管理 + */ + @ApiOperation("批量收款") + @RepeatSubmit + @PostMapping("/batchCollection") + public AjaxResult batchCollection(@RequestBody ReceiptManageDTO receiptManageDTO) + { + if(!StringUtils.isNotEmpty(receiptManageDTO.getBillManageIds())){ + throw new ServiceException("收款账单不能为空"); + } + RedissonMultiLock redissonMultiLock = null; + boolean payInfoDetailLock = false; + try { + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + List locks = new ArrayList<>(); + Set billingSet = Stream.of(receiptManageDTO.getBillManageIds().split(",")).collect(Collectors.toSet()); + billingSet.forEach(x -> { + //获取唯一key值 + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(x.toString())); + locks.add(redisLock.getRLock(key)); + }); + redissonMultiLock = new RedissonMultiLock(locks.toArray(new RLock[billingSet.size()])); + //尝试获取锁 不等待 持有锁10分钟 + payInfoDetailLock = redissonMultiLock.tryLock(-1, 10, TimeUnit.MINUTES); + if (!payInfoDetailLock) { + redissonMultiLock = null; + return AjaxResult.error("账单正在处理,请稍后再试"); + } + log.info("生成账单加锁成功"); + //转换实体 + ReceiptManageDO receiptManageDO = new ReceiptManageDO(); + BeanUtils.copyProperties(receiptManageDTO,receiptManageDO); + return toAjax(receiptManageApplicationService.batchCollection(receiptManageDO)); + }catch (Exception e){ + return AjaxResult.error("收款失败" + e.getMessage()); + }finally { + if (redissonMultiLock != null && payInfoDetailLock) { + redissonMultiLock.unlock(); + log.info("生成账单释放了锁"); + } + } + } + + /** + * 批量删除收款单管理 + */ + @ApiOperation("批量删除收款单管理") + @DeleteMapping("/deleteByIds/{receiptManageIds}") + public AjaxResult delete(@PathVariable Long[] receiptManageIds) + { + return toAjax(receiptManageApplicationService.delete(receiptManageIds)); + } + + /** + * 获取收款单管理详细信息 + */ + @ApiOperation("获取收款单详情") + @GetMapping(value = "/getDetailsInfo") + public AjaxResult getDetailsInfo(ReceiptManageDTO receiptManageDTO) + { + ReceiptManagePO receiptManagePO = receiptManageApplicationService.getDetailsInfo(receiptManageDTO); + return AjaxResult.success("操作成功",receiptManagePO==null ? new ReceiptManagePO():receiptManagePO); + } + + + @ApiOperation("退款") + @PostMapping("/refund") + public AjaxResult refund(@RequestBody ReceiptManageDTO receiptManageDTO) { + if(!StringUtils.isNotEmpty(receiptManageDTO.getReceiptManageIds())){ + throw new ServiceException("收款账单不能为空"); + } + RedissonMultiLock redissonMultiLock = null; + boolean payInfoDetailLock = false; + try { + RedisLockTypeEnum redisLockTypeEnum = RedisLockTypeEnum.BMS; + List locks = new ArrayList<>(); + Set billingSet = Stream.of(receiptManageDTO.getReceiptManageIds().split(",")).collect(Collectors.toSet()); + billingSet.forEach(x -> { + //获取唯一key值 + String key = redisLockTypeEnum.getUniqueKey(UniqueKeyUtil.getBillingKey(x.toString())); + locks.add(redisLock.getRLock(key)); + }); + redissonMultiLock = new RedissonMultiLock(locks.toArray(new RLock[billingSet.size()])); + //尝试获取锁 不等待 持有锁10分钟 + payInfoDetailLock = redissonMultiLock.tryLock(-1, 10, TimeUnit.MINUTES); + if (!payInfoDetailLock) { + redissonMultiLock = null; + return AjaxResult.error("结算单正在处理,请稍后再试"); + } + log.info("结算单退款加锁成功"); + //转换实体 + ReceiptManageDO receiptManageDO = new ReceiptManageDO(); + BeanUtils.copyProperties(receiptManageDTO,receiptManageDO); + return toAjax(receiptManageApplicationService.refund(receiptManageDO)); + }catch (Exception e){ + return AjaxResult.error("退款失败:" + e.getMessage()); + }finally { + if (redissonMultiLock != null && payInfoDetailLock) { + redissonMultiLock.unlock(); + log.info("结算单退款释放了锁"); + } + } + } + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReportFormApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReportFormApi.java new file mode 100644 index 000000000..8ca6219ca --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/ReportFormApi.java @@ -0,0 +1,145 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; +import java.util.Map; + +import com.mhd.bms.application.server.reportForm.ReportFormApplicationService; +import com.mhd.common.core.web.page.TableDataInfo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.reportForm.ReportFormDTO; +import com.mhd.bms.domain.reportForm.repository.todo.ReportFormDO; +import com.mhd.bms.domain.reportForm.repository.po.ReportFormPO; +import com.mhd.bms.interfaces.assembler.reportForm.ReportFormAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; + +/** + * 分析报表管理Api + * + * @author gen + * @date 2024-07-25 + */ +@RestController +@RequestMapping("/reportFormApi") +public class ReportFormApi extends BaseController{ + @Autowired + private ReportFormApplicationService reportFormApplicationService; + + @Resource + private ReportFormAssembler reportFormAssembler; + + /** + * 分页查询分析报管理列表 + */ + @ApiOperation("查询分析报管理列表") + @GetMapping("/list") + public AjaxResult list(ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = new ReportFormDO(); + BeanUtils.copyProperties(reportFormDTO,reportFormDO); + List list = reportFormApplicationService.queryList(reportFormDO); + return AjaxResult.success("操作成功",list); + } + + /** + * 保存分析报管理 + */ + @ApiOperation("保存分析报管理") + @PostMapping("/save") + public AjaxResult save(@RequestBody ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = reportFormAssembler.toDO(reportFormDTO); + if(reportFormDTO.getReportFormId() != null){ + return toAjax(reportFormApplicationService.update(reportFormDO)); + }else { + return toAjax(reportFormApplicationService.insert(reportFormDO)); + } + } + + /** + * 批量删除分析报管理 + */ + @ApiOperation("批量删除分析报管理") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody ReportFormDTO reportFormDTO) + { + try { + return toAjax(reportFormApplicationService.deleteByIds(reportFormDTO)); + }catch (Exception e){ + return AjaxResult.error("删除失败"); + } + } + + /** + * 获取分析报管理详细信息 + */ + @ApiOperation("获取分析报管理") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(@RequestParam(required = true, value = "reportFormId") Long reportFormId) + { + return AjaxResult.success(reportFormApplicationService.getInfo(reportFormId)); + } + + + @ApiOperation("综合分析报表查询") + @PostMapping("/comprehensiveList") + public AjaxResult comprehensiveList(@RequestBody ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = new ReportFormDO(); + BeanUtils.copyProperties(reportFormDTO,reportFormDO); + List> list = reportFormApplicationService.comprehensiveList(reportFormDO); + return AjaxResult.success("操作成功",list); + } + + + @ApiOperation("账单分析报表查询") + @PostMapping("/billAnalysisList") + public AjaxResult billAnalysisList(@RequestBody ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = new ReportFormDO(); + BeanUtils.copyProperties(reportFormDTO,reportFormDO); + List> list = reportFormApplicationService.billAnalysisList(reportFormDO); + return AjaxResult.success("操作成功",list); + } + + @ApiOperation("结算分析报表查询(应付)") + @PostMapping("/settlementAnalysisPaymentList") + public AjaxResult settlementAnalysisPaymentList(@RequestBody ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = new ReportFormDO(); + BeanUtils.copyProperties(reportFormDTO,reportFormDO); + reportFormDO.setAccountExpenseType(2); + List> list = reportFormApplicationService.settlementAnalysisList(reportFormDO); + return AjaxResult.success("操作成功",list); + } + + + @ApiOperation("结算分析报表查询(应收)") + @PostMapping("/settlementAnalysisReceiptList") + public AjaxResult settlementAnalysisReceiptList(@RequestBody ReportFormDTO reportFormDTO) + { + //转换实体 + ReportFormDO reportFormDO = new ReportFormDO(); + BeanUtils.copyProperties(reportFormDTO,reportFormDO); + reportFormDO.setAccountExpenseType(1); + List> list = reportFormApplicationService.settlementAnalysisList(reportFormDO); + return AjaxResult.success("操作成功",list); + } + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/SettlementCustomersApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/SettlementCustomersApi.java new file mode 100644 index 000000000..5af14ba96 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/SettlementCustomersApi.java @@ -0,0 +1,134 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.mhd.bms.application.server.settlementCustomers.SettlementCustomersApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.*; +import com.mhd.bms.interfaces.dto.settlementCustomers.SettlementCustomersDTO; +import com.mhd.bms.domain.settlementCustomers.repository.todo.SettlementCustomersDO; +import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO; +import com.mhd.bms.interfaces.assembler.settlementCustomers.SettlementCustomersAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 结算对象Api + * + * @author gen + * @date 2024-06-17 + */ +@RestController +@RequestMapping("/settlementCustomersApi") +public class SettlementCustomersApi extends BaseController{ + @Autowired + private SettlementCustomersApplicationService settlementCustomersApplicationService; + + @Resource + private SettlementCustomersAssembler settlementCustomersAssembler; + + /** + * 分页查询结算对象列表 + */ + @ApiOperation("查询结算对象列表") + @GetMapping("/list") + public TableDataInfo list(SettlementCustomersDTO settlementCustomersDTO) + { + //转换实体 + SettlementCustomersDO settlementCustomersDO = new SettlementCustomersDO(); + BeanUtils.copyProperties(settlementCustomersDTO,settlementCustomersDO); + startPage(); + List list = settlementCustomersApplicationService.queryList(settlementCustomersDO); + return getDataTable(list); + } + + @ApiOperation("查询结算对象") + @GetMapping("/settlementObjects") + public AjaxResult getSettlementObjects(SettlementCustomersDTO settlementCustomersDTO){ + + return AjaxResult.success(settlementCustomersApplicationService.getSettlementObjectList(settlementCustomersAssembler.toDO(settlementCustomersDTO))); + } + + /** + * 保存结算对象 + */ + @ApiOperation("保存结算对象") + @PostMapping("/save") + public AjaxResult save(@RequestBody SettlementCustomersDTO settlementCustomersDTO) + { + try { + //转换实体 + SettlementCustomersDO settlementCustomersDO = settlementCustomersAssembler.toDO(settlementCustomersDTO); + if(settlementCustomersDTO.getSettlementCustomersId() != null){ + return toAjax(settlementCustomersApplicationService.update(settlementCustomersDO)); + }else { + return toAjax(settlementCustomersApplicationService.insert(settlementCustomersDO)); + } + }catch (Exception e){ + return AjaxResult.error("操作失败:"+e.getMessage()); + } + } + + /** + * 批量删除结算对象 + */ + @ApiOperation("批量删除结算对象") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody SettlementCustomersDTO settlementCustomersDTO) + { + try { + settlementCustomersApplicationService.deleteByIds(settlementCustomersDTO); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 获取结算对象详细信息 + */ + @ApiOperation("获取结算对象") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById( SettlementCustomersDTO settlementCustomersDTO) + { + return AjaxResult.success(settlementCustomersApplicationService.getInfo(settlementCustomersDTO.getSettlementCustomersId())); + } + + + + @ApiOperation("同步结算对象") + @PostMapping("/syncSettlementCustomers") + public AjaxResult syncSettlementCustomers() + { + try { + settlementCustomersApplicationService.syncSettlementCustomers(); + return AjaxResult.success("操作成功"); + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + + @ApiOperation("根据获取结算对象获取") + @GetMapping(value = "/getInfoByCode") + public AjaxResult getInfoByCode(@RequestParam("settlementCustomersCode")String settlementCustomersCode) + { + return AjaxResult.success(settlementCustomersApplicationService.getInfoByCode(settlementCustomersCode)); + } + + + + + + + + + +} diff --git a/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/TaskFlowRecordsApi.java b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/TaskFlowRecordsApi.java new file mode 100644 index 000000000..c93264f50 --- /dev/null +++ b/mhd_bms/src/main/java/com/mhd/bms/interfaces/facadeApi/TaskFlowRecordsApi.java @@ -0,0 +1,97 @@ +package com.mhd.bms.interfaces.facadeApi; + +import java.util.List; + +import com.mhd.bms.application.server.taskFlowRecords.TaskFlowRecordsApplicationService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.mhd.bms.interfaces.dto.taskFlowRecords.TaskFlowRecordsDTO; +import com.mhd.bms.domain.taskFlowRecords.repository.todo.TaskFlowRecordsDO; +import com.mhd.bms.domain.taskFlowRecords.repository.po.TaskFlowRecordsPO; +import com.mhd.bms.interfaces.assembler.taskFlowRecords.TaskFlowRecordsAssembler; +import javax.annotation.Resource; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; + +/** + * 任务流水记录Api + * + * @author gen + * @date 2024-06-20 + */ +@RestController +@RequestMapping("/taskFlowRecordsApi") +public class TaskFlowRecordsApi extends BaseController{ + @Autowired + private TaskFlowRecordsApplicationService taskFlowRecordsApplicationService; + + @Resource + private TaskFlowRecordsAssembler taskFlowRecordsAssembler; + + /** + * 分页查询任务流水记录列表 + */ + @ApiOperation("查询任务流水记录列表") + @GetMapping("/list") + public TableDataInfo list(TaskFlowRecordsDTO taskFlowRecordsDTO) + { + //转换实体 + TaskFlowRecordsDO taskFlowRecordsDO = new TaskFlowRecordsDO(); + BeanUtils.copyProperties(taskFlowRecordsDTO,taskFlowRecordsDO); + startPage(); + List list = taskFlowRecordsApplicationService.queryList(taskFlowRecordsDO); + return getDataTable(list); + } + + /** + * 保存任务流水记录 + */ + @ApiOperation("保存任务流水记录") + @PostMapping("/save") + public AjaxResult save(@RequestBody TaskFlowRecordsDTO taskFlowRecordsDTO) + { + //转换实体 + TaskFlowRecordsDO taskFlowRecordsDO = taskFlowRecordsAssembler.toDO(taskFlowRecordsDTO); + return toAjax(taskFlowRecordsApplicationService.insert(taskFlowRecordsDO)); + } + + /** + * 批量删除任务流水记录 + */ + @ApiOperation("批量删除任务流水记录") + @PostMapping("/deleteByIds") + public AjaxResult deleteByIds(@RequestBody TaskFlowRecordsDTO taskFlowRecordsDTO) + { + return toAjax(taskFlowRecordsApplicationService.deleteByIds(taskFlowRecordsDTO)); + } + + /** + * 获取任务流水记录详细信息 + */ + @ApiOperation("获取任务流水记录") + @GetMapping(value = "/getInfoById") + public AjaxResult getInfoById(TaskFlowRecordsDTO taskFlowRecordsDTO) + { + return AjaxResult.success(taskFlowRecordsApplicationService.getInfo(taskFlowRecordsDTO.getTaskFlowRecordsId())); + } + + + + + + + + + + + +} diff --git a/mhd_bms/src/main/resources/bootstrap.yml b/mhd_bms/src/main/resources/bootstrap.yml new file mode 100644 index 000000000..7803d21bb --- /dev/null +++ b/mhd_bms/src/main/resources/bootstrap.yml @@ -0,0 +1,33 @@ +server: + port: 8019 +management: + metrics: + web: + server: + auto-time-requests: false # 关闭自动检测 +spring: + application: + name: mhd-bms-service + profiles: + active: dev + main: + allow-circular-references: true + # nacos配置 + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 锁定server端的配置文件(读取它的配置项) + namespace: # 命名空间id + group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置 + file-extension: yml #默认properties + # 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新 + # 允许nacos服务端向本地同步配置 + enable-remote-sync-config: true + refresh-enabled: true + + + diff --git a/mhd_bms/src/main/resources/mapper/BillDetailMapper.xml b/mhd_bms/src/main/resources/mapper/BillDetailMapper.xml new file mode 100644 index 000000000..e56269307 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillDetailMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/BillManageMapper.xml b/mhd_bms/src/main/resources/mapper/BillManageMapper.xml new file mode 100644 index 000000000..85de3326b --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillManageMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{billManageDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{billManageDO.createTimeEnd} + + + AND create_by_name like concat('%', #{billManageDO.createByName}, '%') + + + AND top_organization_id = #{billManageDO.topOrganizationId} + + + AND date_format(update_time,'%Y-%m-%d') =]]> #{billManageDO.updateTimeStart} + + + AND date_format(update_time,'%Y-%m-%d') #{billManageDO.updateTimeEnd} + + + AND update_by_name like concat('%', #{billManageDO.updateByName}, '%') + + + AND bill_number like concat('%', #{billManageDO.billNumber}, '%') + + + AND belong_module like concat('%', #{billManageDO.belongModule}, '%') + + + AND settlement_entity like concat('%', #{billManageDO.settlementEntity}, '%') + + + AND bill_state = #{billManageDO.billState} + + + AND reconciliation_status = #{billManageDO.reconciliationStatus} + + + AND bill_type = #{billManageDO.billType} + + + AND bill_state 5 + + + AND bill_state = 5 + + + AND bill_state = 6 + + + and bill_manage_id in + + #{id} + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/BillOperationLogMapper.xml b/mhd_bms/src/main/resources/mapper/BillOperationLogMapper.xml new file mode 100644 index 000000000..7098fe232 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillOperationLogMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + select * from bill_operation_log + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and bill_manage_id = #{billManageId} + + + and bill_number = #{billNumber} + + + and operation_type = #{operationType} + + + and operation_info = #{operationInfo} + + + and operator = #{operator} + + + and operation_time = #{operationTime} + + + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/BillingParamsMapper.xml b/mhd_bms/src/main/resources/mapper/BillingParamsMapper.xml new file mode 100644 index 000000000..781a3567f --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillingParamsMapper.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select billing_params_id, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, top_organization_id, organization_id, organization_name, billing_params_name, billing_illustrate, billing_params_json, billing_output_json, pre_set_rules from billing_params + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and billing_params_name like concat('%', #{billingParamsName}, '%') + + + and billing_illustrate = #{billingIllustrate} + + + and billing_params_json = #{billingParamsJson} + + + and billing_output_json = #{billingOutputJson} + + + and pre_set_rules = #{preSetRules} + + + + + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/BillingRulesMapper.xml b/mhd_bms/src/main/resources/mapper/BillingRulesMapper.xml new file mode 100644 index 000000000..49d78e65b --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillingRulesMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and service_items_code = #{serviceItemsCode} + + + and service_items_name like concat('%', #{serviceItemsName}, '%') + + + and first_subject_code = #{firstSubjectCode} + + + and first_subject_name like concat('%', #{firstSubjectName}, '%') + + + and second_subject_code = #{secondSubjectCode} + + + and second_subject_name like concat('%', #{secondSubjectName}, '%') + + + and document_type_code = #{documentTypeCode} + + + and document_type = #{documentType} + + + and billing_rules_illustrate = #{billingRulesIllustrate} + + + and billing_rules_state = #{billingRulesState} + + + and billing_params_id = #{billingParamsId} + + + and billing_formula = #{billingFormula} + + + + + + + + + and top_organization_id = #{billingRulesDO.topOrganizationId} + + + and billing_rules_code like concat('%',#{billingRulesDO.billingRulesCode},'%') + + + and billing_rules_name like concat('%',#{billingRulesDO.billingRulesName},'%') + + + and document_type_code = #{billingRulesDO.documentTypeCode} + + + and service_items_code = #{billingRulesDO.serviceItemsCode} + + + and billing_rules_state = #{billingRulesDO.billingRulesState} + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{billingRulesDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{billingRulesDO.createTimeEnd} + + + AND create_by_name like concat('%', #{billingRulesDO.createByName}, '%') + + + + diff --git a/mhd_bms/src/main/resources/mapper/BillingStatementMapper.xml b/mhd_bms/src/main/resources/mapper/BillingStatementMapper.xml new file mode 100644 index 000000000..80e1e6918 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BillingStatementMapper.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + and settlement_customers_code = #{bdo.settlementCustomersCode} + + + and (billing_state = 1 or billing_state = 2) + + + and billing_state = 3 + + + and billing_state 4 + + + + + + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{billingStatementDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{billingStatementDO.createTimeEnd} + + + AND create_by_name like concat('%', #{billingStatementDO.createByName}, '%') + + + AND top_organization_id = #{billingStatementDO.topOrganizationId} + + + AND date_format(update_time,'%Y-%m-%d') =]]> #{billingStatementDO.updateTimeStart} + + + AND date_format(update_time,'%Y-%m-%d') #{billingStatementDO.updateTimeEnd} + + + AND update_by_name like concat('%', #{billingStatementDO.updateByName}, '%') + + + AND billing_flow like concat('%', #{billingStatementDO.billingFlow}, '%') + + + AND settlement_entity like concat('%', #{billingStatementDO.settlementEntity}, '%') + + + AND( first_subject_name like concat('%', #{billingStatementDO.secondSubjectName}, '%') + OR second_subject_name like concat('%', #{billingStatementDO.secondSubjectName}, '%') ) + + + AND service_items_name like concat('%', #{billingStatementDO.serviceItemsName}, '%') + + + AND account_expense_type = #{billingStatementDO.accountExpenseType} + + + AND settlement_customers_code = #{billingStatementDO.settlementCustomersCode} + + + AND belong_module_code = #{billingStatementDO.belongModuleCode} + + + AND date_format(cycle_end_time,'%Y-%m-%d') #{billingStatementDO.cycleEndTime} + AND date_format(cycle_begin_time,'%Y-%m-%d') =]]> #{billingStatementDO.cycleBeginTime} + + + AND billing_state = #{billingStatementDO.billingState} + + + AND red_flush_state = #{billingStatementDO.redFlushState} + + + AND belong_module like concat('%', #{billingStatementDO.belongModule}, '%') + + + AND document_type like concat('%', #{billingStatementDO.documentType}, '%') + + + AND original_business_num like concat('%', #{billingStatementDO.originalBusinessNum}, '%') + + + AND (billing_state = 1 OR billing_state = 2) + + + AND billing_state = 3 + + + AND (billing_state = 4 OR billing_state = 5) + + + AND billing_statement_id in + + #{id} + + + + + + + AND billing_state = #{billingStatementDO.billingState} + + + AND top_organization_id = #{billingStatementDO.topOrganizationId} + + + AND organization_id = #{billingStatementDO.organizationId} + + + AND settlement_customers_code = #{billingStatementDO.settlementCustomersCode} + + + AND account_expense_type = #{billingStatementDO.accountExpenseType} + + + AND belong_module_code = #{billingStatementDO.belongModuleCode} + + + AND document_type_code = #{billingStatementDO.documentTypeCode} + + + AND service_items_code = #{billingStatementDO.serviceItemsCode} + + + AND (first_subject_code = #{billingStatementDO.secondSubjectCode} OR second_subject_code = #{billingStatementDO.secondSubjectCode}) + + + AND contract_type = #{billingStatementDO.contractType} + + + AND project_code = #{billingStatementDO.projectCode} + + + AND date_format(business_date,'%Y-%m-%d') =]]> #{billingStatementDO.businessDateStart} + + + AND date_format(business_date,'%Y-%m-%d') #{billingStatementDO.businessDateEnd} + + + + + + + and settlement_entity like concat('%',#{billingStatementCollectDO.settlementEntity},'%') + + + and settlement_customers_code like concat('%',#{billingStatementCollectDO.settlementCustomersCode},'%') + + + and account_expense_type = #{billingStatementCollectDO.accountExpenseType} + + + and (billing_state = 1 or billing_state = 2) + + + and billing_state = 3 + + + and billing_state 4 + + + and organization_name = #{billingStatementCollectDO.organizationName} + + + + + + and bill_amount_sum = #{billingStatementCollectDO.billAmountSum} + + + and count_fee = #{billingStatementCollectDO.countFee} + + + and date_format(business_start_date,'%Y-%m-%d %H:%i:%s') =]]> #{billingStatementCollectDO.businessStartDate} + + + and date_format(business_end_date,'%Y-%m-%d %H:%i:%s') #{billingStatementCollectDO.businessEndDate} + + + + diff --git a/mhd_bms/src/main/resources/mapper/BusinessDocumentMapper.xml b/mhd_bms/src/main/resources/mapper/BusinessDocumentMapper.xml new file mode 100644 index 000000000..2b6c544c0 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/BusinessDocumentMapper.xml @@ -0,0 +1,191 @@ + + + + + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and business_flow = #{businessFlow} + + + and business_state = #{businessState} + + + and belong_module = #{belongModule} + + + and belong_module_code = #{belongModuleCode} + + + and data_sources = #{dataSources} + + + and document_type_id = #{documentTypeId} + + + and document_type_code = #{documentTypeCode} + + + and document_type = #{documentType} + + + and original_business_num = #{originalBusinessNum} + + + and project_code = #{projectCode} + + + and project_name like concat('%', #{projectName}, '%') + + + and contract_number = #{contractNumber} + + + and contract_name like concat('%', #{contractName}, '%') + + + and bill_amount = #{billAmount} + + + and estimated_cost = #{estimatedCost} + + + and first_subject_code = #{firstSubjectCode} + + + and first_subject_name like concat('%', #{firstSubjectName}, '%') + + + and second_subject_code = #{secondSubjectCode} + + + and second_subject_name like concat('%', #{secondSubjectName}, '%') + + + and settlement_customers_id = #{settlementCustomersId} + + + and settlement_customers_code = #{settlementCustomersCode} + + + and settlement_entity = #{settlementEntity} + + + and billing_time = #{billingTime} + + + and document_form_json = #{documentFormJson} + + + and revenue_expenses_type = #{revenueExpensesType} + + + + + + + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{businessDocumentDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{businessDocumentDO.createTimeEnd} + + + AND create_by_name like concat('%', #{businessDocumentDO.createByName}, '%') + + + AND top_organization_id = #{businessDocumentDO.topOrganizationId} + + + AND update_by_name like concat('%', #{businessDocumentDO.updateByName}, '%') + + + AND date_format(update_time,'%Y-%m-%d') =]]> #{businessDocumentDO.updateTimeStart} + + + AND date_format(update_time,'%Y-%m-%d') #{businessDocumentDO.updateTimeEnd} + + + AND business_flow like concat('%', #{businessDocumentDO.businessFlow}, '%') + + + AND data_sources = #{businessDocumentDO.dataSources} + + + AND business_state = #{businessDocumentDO.businessState} + + + AND belong_module like concat('%', #{businessDocumentDO.belongModule}, '%') + + + AND organization_name like concat('%', #{businessDocumentDO.organizationName}, '%') + + + AND document_type like concat('%', #{businessDocumentDO.documentType}, '%') + + + AND original_business_num like concat('%', #{businessDocumentDO.originalBusinessNum}, '%') + + + AND project_name like concat('%', #{businessDocumentDO.projectName}, '%') + + + AND contract_number like concat('%', #{businessDocumentDO.contractNumber}, '%') + + + AND contract_name like concat('%', #{businessDocumentDO.contractName}, '%') + + + AND bill_amount like concat('%', #{businessDocumentDO.billAmount}, '%') + + + AND estimated_cost like concat('%', #{businessDocumentDO.estimatedCost}, '%') + + + AND first_subject_name like concat('%', #{businessDocumentDO.firstSubjectName}, '%') + + + AND second_subject_name like concat('%', #{businessDocumentDO.secondSubjectName}, '%') + + + AND settlement_entity like concat('%', #{businessDocumentDO.settlementEntity}, '%') + + + and business_document_id in + + #{id} + + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/ConditionalMappingMapper.xml b/mhd_bms/src/main/resources/mapper/ConditionalMappingMapper.xml new file mode 100644 index 000000000..327e611ea --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/ConditionalMappingMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + AND top_organization_id = #{conditionalMappingDO.topOrganizationId} + + + AND source_content like concat('%', #{conditionalMappingDO.sourceContent}, '%') + + + AND after_mapping like concat('%', #{conditionalMappingDO.afterMapping}, '%') + + + + + diff --git a/mhd_bms/src/main/resources/mapper/DocumentTypeMapper.xml b/mhd_bms/src/main/resources/mapper/DocumentTypeMapper.xml new file mode 100644 index 000000000..a84667ed4 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/DocumentTypeMapper.xml @@ -0,0 +1,94 @@ + + + + + + + select * from document_type + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and document_type = #{documentType} + + + and document_type_code = #{documentTypeCode} + + + and belong_modules_code = #{belongModulesCode} + + + and belong_modules = #{belongModules} + + + and form_json = #{formJson} + + + and enabling_status = #{enablingStatus} + + + + + + + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{documentTypeDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{documentTypeDO.createTimeEnd} + + + AND create_by_name like concat('%', #{documentTypeDO.createByName}, '%') + + + AND top_organization_id = #{documentTypeDO.topOrganizationId} + + + AND document_type like concat('%', #{documentTypeDO.documentType}, '%') + + + AND document_type_code like concat('%', #{documentTypeDO.documentTypeCode}, '%') + + + AND remark like concat('%', #{documentTypeDO.remark}, '%') + + + AND enabling_status = #{documentTypeDO.enablingStatus} + + + and document_type_code in + + #{code} + + + + + diff --git a/mhd_bms/src/main/resources/mapper/FormQueryManageMapper.xml b/mhd_bms/src/main/resources/mapper/FormQueryManageMapper.xml new file mode 100644 index 000000000..457ba470a --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/FormQueryManageMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + AND top_organization_id = #{formQueryManageDO.topOrganizationId} + + + AND create_by = #{formQueryManageDO.createBy} + + + AND report_form_id = #{formQueryManageDO.reportFormId} + + + + + diff --git a/mhd_bms/src/main/resources/mapper/FormQueryParamsMapper.xml b/mhd_bms/src/main/resources/mapper/FormQueryParamsMapper.xml new file mode 100644 index 000000000..8eae30f54 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/FormQueryParamsMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + AND a.top_organization_id = #{formQueryParamsDO.topOrganizationId} + + + AND a.create_by = #{formQueryParamsDO.createBy} + + + AND a.form_type = #{formQueryParamsDO.formType} + + + + diff --git a/mhd_bms/src/main/resources/mapper/MappingMethodMapper.xml b/mhd_bms/src/main/resources/mapper/MappingMethodMapper.xml new file mode 100644 index 000000000..b757f6179 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/MappingMethodMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + AND top_organization_id = #{mappingMethodDO.topOrganizationId} + + + and method_name like concat('%', #{mappingMethodDO.methodName}, '%') + + + and mapping_method like concat('%', #{mappingMethodDO.mappingMethod}, '%') + + + + diff --git a/mhd_bms/src/main/resources/mapper/PaymentManageMapper.xml b/mhd_bms/src/main/resources/mapper/PaymentManageMapper.xml new file mode 100644 index 000000000..3fc207135 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/PaymentManageMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + + + diff --git a/mhd_bms/src/main/resources/mapper/PaymentOrderDetailsMapper.xml b/mhd_bms/src/main/resources/mapper/PaymentOrderDetailsMapper.xml new file mode 100644 index 000000000..0c82e0cf5 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/PaymentOrderDetailsMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/mhd_bms/src/main/resources/mapper/PaymentOrderMapper.xml b/mhd_bms/src/main/resources/mapper/PaymentOrderMapper.xml new file mode 100644 index 000000000..a920c88b1 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/PaymentOrderMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + AND a.top_organization_id = #{paymentOrderDO.topOrganizationId} + + + AND date_format(a.create_time,'%Y-%m-%d') =]]> #{paymentOrderDO.createTimeStart} + + + AND date_format(a.create_time,'%Y-%m-%d') #{paymentOrderDO.createTimeEnd} + + + AND a.payment_order_num like concat('%', #{paymentOrderDO.paymentOrderNum}, '%') + + + AND a.transaction_flow like concat('%', #{paymentOrderDO.transactionFlow}, '%') + + + AND a.settlement_entity like concat('%', #{paymentOrderDO.settlementEntity}, '%') + + + + + diff --git a/mhd_bms/src/main/resources/mapper/PaymentWalletMapper.xml b/mhd_bms/src/main/resources/mapper/PaymentWalletMapper.xml new file mode 100644 index 000000000..d5928260c --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/PaymentWalletMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and main_number = #{mainNumber} + + + and main_name like concat('%', #{mainName}, '%') + + + and bank_name like concat('%', #{bankName}, '%') + + + and bank_deposi = #{bankDeposi} + + + and phone = #{phone} + + + and payment_method_code = #{paymentMethodCode} + + + and payment_method = #{paymentMethod} + + + and payment_manage_id = #{paymentManageId} + + + + + diff --git a/mhd_bms/src/main/resources/mapper/ReceiptDetailMapper.xml b/mhd_bms/src/main/resources/mapper/ReceiptDetailMapper.xml new file mode 100644 index 000000000..6bdf50ee6 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/ReceiptDetailMapper.xml @@ -0,0 +1,64 @@ + + + + + + + select receipt_detail_id, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, top_organization_id, organization_id, organization_name, bill_manage_id, bill_number, collected_discount, bill_amount, bill_amount_settlement, bill_amount_unsettled, collected_amount, receipt_manage_id, collection_num from receipt_detail + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and bill_manage_id = #{billManageId} + + + and bill_number = #{billNumber} + + + and collected_discount = #{collectedDiscount} + + + and bill_amount = #{billAmount} + + + and bill_amount_settlement = #{billAmountSettlement} + + + and bill_amount_unsettled = #{billAmountUnsettled} + + + and collected_amount = #{collectedAmount} + + + and receipt_manage_id = #{receiptManageId} + + + and collection_num = #{collectionNum} + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/ReceiptManageMapper.xml b/mhd_bms/src/main/resources/mapper/ReceiptManageMapper.xml new file mode 100644 index 000000000..d5acc4943 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/ReceiptManageMapper.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + AND date_format(a.create_time,'%Y-%m-%d') =]]> #{receiptManageDO.createTimeStart} + + + AND date_format(a.create_time,'%Y-%m-%d') #{receiptManageDO.createTimeEnd} + + + AND a.create_by_name like concat('%', #{receiptManageDO.createByName}, '%') + + + AND a.top_organization_id = #{receiptManageDO.topOrganizationId} + + + AND date_format(a.update_time,'%Y-%m-%d') =]]> #{receiptManageDO.updateTimeStart} + + + AND date_format(a.update_time,'%Y-%m-%d') #{receiptManageDO.updateTimeEnd} + + + AND a.update_by_name like concat('%', #{receiptManageDO.updateByName}, '%') + + + AND date_format(a.collection_time,'%Y-%m-%d') =]]> #{receiptManageDO.collectionTimeStart} + + + AND date_format(a.collection_time,'%Y-%m-%d') #{receiptManageDO.collectionTimeEnd} + + + AND a.settlement_entity like concat('%', #{receiptManageDO.settlementEntity}, '%') + + + AND a.payment_card like concat('%', #{receiptManageDO.paymentCard}, '%') + + + AND a.transaction_flow like concat('%', #{receiptManageDO.transactionFlow}, '%') + + + AND a.receipt_number like concat('%', #{receiptManageDO.receiptNumber}, '%') + + + AND a.payee_name like concat('%', #{receiptManageDO.payeeName}, '%') + + + + + + + + diff --git a/mhd_bms/src/main/resources/mapper/ReportFormMapper.xml b/mhd_bms/src/main/resources/mapper/ReportFormMapper.xml new file mode 100644 index 000000000..c53be8942 --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/ReportFormMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + AND top_organization_id = #{reportFormDO.topOrganizationId} + + + AND organization_id = #{reportFormDO.organizationId} + + + AND form_type = #{reportFormDO.formType} + + + + + diff --git a/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml new file mode 100644 index 000000000..1777feaab --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml @@ -0,0 +1,112 @@ + + + + + + + select * from settlement_customers + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and settlement_customers_code = #{settlementCustomersCode} + + + and settlement_entity_id = #{settlementEntityId} + + + and settlement_entity = #{settlementEntity} + + + and settlement_method = #{settlementMethod} + + + and settlement_method_code = #{settlementMethodCode} + + + and settlement_direction = #{settlementDirection} + + + and settlement_direction_code = #{settlementDirectionCode} + + + and bank_name like concat('%', #{bankName}, '%') + + + and bank_card_number = #{bankCardNumber} + + + and bank_binding_name like concat('%', #{bankBindingName}, '%') + + + + + + + + + + and settlement_entity like concat('%', #{settlementCustomersDO.settlementEntity}, '%') + + + and settlement_customers_code like concat('%', #{settlementCustomersDO.settlementCustomersCode}, '%') + + + and settlement_customers_code like concat('%', #{settlementCustomersDO.settlementCustomersCode}, '%') + + + and settlement_method like concat('%', #{settlementCustomersDO.settlementMethod}, '%') + + + and remark like concat('%', #{settlementCustomersDO.remark}, '%') + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{settlementCustomersDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{settlementCustomersDO.createTimeEnd} + + + and create_by_name like concat('%', #{settlementCustomersDO.createByName}, '%') + + + and main_role = #{settlementCustomersDO.mainRole} + + + and top_organization_id = #{settlementCustomersDO.topOrganizationId} + + + + diff --git a/mhd_bms/src/main/resources/mapper/TaskFlowRecordsMapper.xml b/mhd_bms/src/main/resources/mapper/TaskFlowRecordsMapper.xml new file mode 100644 index 000000000..2d26e6fee --- /dev/null +++ b/mhd_bms/src/main/resources/mapper/TaskFlowRecordsMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + and create_by_name like concat('%', #{createByName}, '%') + + + and update_by_name like concat('%', #{updateByName}, '%') + + + and top_organization_id = #{topOrganizationId} + + + and organization_id = #{organizationId} + + + and organization_name like concat('%', #{organizationName}, '%') + + + and task_flow = #{taskFlow} + + + and belong_module_code = #{belongModuleCode} + + + and belong_module = #{belongModule} + + + and document_type_id = #{documentTypeId} + + + and document_type_code = #{documentTypeCode} + + + and document_type = #{documentType} + + + and subject_code = #{subjectCode} + + + and subject_name like concat('%', #{subjectName}, '%') + + + and original_business_num = #{originalBusinessNum} + + + and settlement_entity = #{settlementEntity} + + + and settlement_customers_id = #{settlementCustomersId} + + + and main_role = #{mainRole} + + + and contract_number = #{contractNumber} + + + and contract_name like concat('%', #{contractName}, '%') + + + and billing_rules_id = #{billingRulesId} + + + and billing_rules = #{billingRules} + + + and billing_rules_code = #{billingRulesCode} + + + and billing_process = #{billingProcess} + + + and billing_results = #{billingResults} + + + and request_params = #{requestParams} + + + + + + + + + + AND date_format(create_time,'%Y-%m-%d') =]]> #{taskFlowRecordsDO.createTimeStart} + + + AND date_format(create_time,'%Y-%m-%d') #{taskFlowRecordsDO.createTimeEnd} + + + and create_by_name like concat('%', #{taskFlowRecordsDO.createByName}, '%') + + + and top_organization_id = #{taskFlowRecordsDO.topOrganizationId} + + + and update_by_name like concat('%', #{taskFlowRecordsDO.updateByName}, '%') + + + AND date_format(update_time,'%Y-%m-%d') =]]> #{taskFlowRecordsDO.updateTimeStart} + + + AND date_format(update_time,'%Y-%m-%d') #{taskFlowRecordsDO.updateTimeEnd} + + + and task_flow like concat('%', #{taskFlowRecordsDO.taskFlow}, '%') + + + and belong_module_code like concat('%', #{taskFlowRecordsDO.belongModuleCode}, '%') + + + and document_type like concat('%', #{taskFlowRecordsDO.documentType}, '%') + + + AND( first_subject_name like concat('%', #{taskFlowRecordsDO.secondSubjectName}, '%') + OR second_subject_name like concat('%', #{taskFlowRecordsDO.secondSubjectName}, '%') ) + + + and billing_results like concat('%', #{taskFlowRecordsDO.billingResults}, '%') + + + and original_business_num like concat('%', #{taskFlowRecordsDO.originalBusinessNum}, '%') + + + and settlement_entity like concat('%', #{taskFlowRecordsDO.settlementEntity}, '%') + + + and main_role = #{taskFlowRecordsDO.mainRole} + + + and contract_number like concat('%', #{taskFlowRecordsDO.contractNumber}, '%') + + + and contract_name like concat('%', #{taskFlowRecordsDO.contractName}, '%') + + + + + +