From ac2295cac939693d5789a349f5ab25104348fa59 Mon Sep 17 00:00:00 2001 From: FCL Date: Tue, 18 Nov 2025 10:59:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=98=B6=E6=AE=B5=E6=80=A7=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zt/plat/qms/QmsServerApplication.java | 5 + .../src/main/resources/application-dev.yml | 84 ++ .../src/main/resources/application-local.yml | 116 ++ .../module/qms/enums/ErrorCodeConstants.java | 36 +- .../plat/module/qms/enums/QmsBpmConstant.java | 11 + .../module/qms/enums/QmsCommonConstant.java | 54 +- .../qms/enums/QmsPermissionConstant.java | 23 + .../enums/QmsWarehouseLocationConstant.java | 21 + zt-module-qms/zt-module-qms-server/pom.xml | 12 +- .../BusinessAssayParameterDataController.java | 22 +- .../BusinessAssayProjectDataController.java | 18 +- .../BusinessAssayReportDataController.java | 117 ++ .../admin/BusinessAssayTaskController.java | 117 ++ .../BusinessAssayTaskDataController.java | 32 +- .../BusinessAssayTaskDetailController.java | 116 ++ .../admin/BusinessBaseSampleController.java | 18 +- .../BusinessHandoverRecordSubController.java | 19 +- .../BusinessQCCoefficientDataController.java | 114 ++ ...sQCCoefficientParameterDataController.java | 106 ++ .../admin/BusinessQCDataController.java | 113 ++ .../BusinessQCManagementDataController.java | 114 ++ ...ssQCManagementParameterDataController.java | 106 ++ ...nessQCManagementProjectDataController.java | 106 ++ .../BusinessQCParameterDataController.java | 106 ++ .../BusinessQCProjectDataController.java | 106 ++ ...QualityControlSampleProjectController.java | 108 ++ .../BusinessSampleAssayResultController.java | 18 +- .../BusinessSampleDispatchController.java | 166 +++ ...usinessSampleDispatchDetailController.java | 133 ++ ...BusinessSampleEntrustDetailController.java | 33 +- ...usinessSampleEntrustProjectController.java | 18 +- ...ssSampleEntrustRegistrationController.java | 26 +- .../BusinessSampleHandoverController.java | 27 +- ...usinessSampleHandoverDetailController.java | 18 +- .../BusinessStandardSampleController.java | 117 ++ ...sinessStandardSampleProjectController.java | 108 ++ ...ssSubParentSampleAssessmentController.java | 106 ++ .../BusinessSubParentSampleController.java | 18 +- ...inessSubSampleAnalysisGroupController.java | 108 ++ ...BusinessSubSampleAssessmentController.java | 18 +- .../admin/BusinessSubSampleController.java | 75 +- ...inessSubSampleParentRecheckController.java | 106 ++ .../admin/BusinessXRFDataController.java | 105 ++ .../admin/SampleAnalysisAuditController.java | 116 ++ .../admin/SampleAnalysisController.java | 80 ++ .../admin/SampleEntrustController.java | 90 +- .../admin/SampleFlowController.java | 132 ++ .../SampleResultReportingController.java | 86 ++ .../admin/SampleTaskAssignController.java | 108 ++ .../vo/BatchAssessmentDataReportingReqVO.java | 13 + .../vo/BatchResultDataReportingReqVO.java | 13 + .../vo/BatchSampleAnalysisColumnRespVO.java | 81 ++ .../BusinessAssayParameterDataPageReqVO.java | 14 +- .../vo/BusinessAssayParameterDataReqVO.java | 47 + .../vo/BusinessAssayParameterDataRespVO.java | 22 +- .../BusinessAssayParameterDataSaveReqVO.java | 18 +- ...usinessAssayProjectAndParameterRespVO.java | 72 ++ .../BusinessAssayProjectDataExtendRespVO.java | 50 + .../vo/BusinessAssayProjectDataPageReqVO.java | 21 +- .../vo/BusinessAssayProjectDataReqVO.java | 68 + .../vo/BusinessAssayProjectDataRespVO.java | 27 +- .../vo/BusinessAssayProjectDataSaveReqVO.java | 21 +- .../vo/BusinessAssayReportDataPageReqVO.java | 76 ++ .../vo/BusinessAssayReportDataRespVO.java | 84 ++ .../vo/BusinessAssayReportDataSaveReqVO.java | 58 + ...yTaskAnalysisSampleAndQcProjectRespVO.java | 67 + ...sAssayTaskAnalysisSampleProjectRespVO.java | 66 + .../vo/BusinessAssayTaskBackSampleReqVO.java | 20 + .../vo/BusinessAssayTaskDataExtendRespVO.java | 11 + .../vo/BusinessAssayTaskDataGroupRespVO.java | 16 + .../vo/BusinessAssayTaskDataPageReqVO.java | 48 +- .../vo/BusinessAssayTaskDataReqVO.java | 48 +- .../vo/BusinessAssayTaskDataRespVO.java | 70 +- .../vo/BusinessAssayTaskDataSaveReqVO.java | 62 +- .../BusinessAssayTaskDetailExtendRespVO.java | 41 + .../vo/BusinessAssayTaskDetailPageReqVO.java | 18 +- .../vo/BusinessAssayTaskDetailReqVO.java | 54 + .../vo/BusinessAssayTaskDetailRespVO.java | 25 +- .../vo/BusinessAssayTaskDetailSaveReqVO.java | 21 +- .../vo/BusinessAssayTaskExtendRespVO.java | 35 + .../vo/BusinessAssayTaskPageReqVO.java | 87 +- .../controller/vo/BusinessAssayTaskReqVO.java | 109 ++ .../vo/BusinessAssayTaskRespVO.java | 120 +- .../vo/BusinessAssayTaskSaveReqVO.java | 103 +- .../vo/BusinessBaseSamplePageReqVO.java | 31 +- .../vo/BusinessBaseSampleRespVO.java | 42 +- .../vo/BusinessBaseSampleSaveReqVO.java | 42 +- .../BusinessHandoverRecordSubPageReqVO.java | 23 +- .../vo/BusinessHandoverRecordSubRespVO.java | 40 +- .../BusinessHandoverRecordSubSaveReqVO.java | 39 +- .../BusinessQCCoefficientDataPageReqVO.java | 79 ++ .../vo/BusinessQCCoefficientDataReqVO.java | 79 ++ .../vo/BusinessQCCoefficientDataRespVO.java | 99 ++ .../BusinessQCCoefficientDataSaveReqVO.java | 78 ++ ...ssQCCoefficientParameterDataPageReqVO.java | 47 + ...sinessQCCoefficientParameterDataReqVO.java | 47 + ...inessQCCoefficientParameterDataRespVO.java | 59 + ...ssQCCoefficientParameterDataSaveReqVO.java | 47 + .../vo/BusinessQCDataExtendRespVO.java | 8 + .../vo/BusinessQCDataPageReqVO.java | 79 ++ .../controller/vo/BusinessQCDataReqVO.java | 79 ++ .../controller/vo/BusinessQCDataRespVO.java | 96 ++ .../vo/BusinessQCDataSaveReqVO.java | 80 ++ .../vo/BusinessQCManagementDataPageReqVO.java | 79 ++ .../vo/BusinessQCManagementDataReqVO.java | 79 ++ .../vo/BusinessQCManagementDataRespVO.java | 99 ++ .../vo/BusinessQCManagementDataSaveReqVO.java | 79 ++ ...essQCManagementParameterDataPageReqVO.java | 47 + ...usinessQCManagementParameterDataReqVO.java | 47 + ...sinessQCManagementParameterDataRespVO.java | 59 + ...essQCManagementParameterDataSaveReqVO.java | 47 + ...inessQCManagementProjectDataPageReqVO.java | 59 + .../BusinessQCManagementProjectDataReqVO.java | 59 + ...BusinessQCManagementProjectDataRespVO.java | 75 ++ ...inessQCManagementProjectDataSaveReqVO.java | 61 + .../vo/BusinessQCParameterDataPageReqVO.java | 47 + .../vo/BusinessQCParameterDataRespVO.java | 59 + .../vo/BusinessQCParameterDataSaveReqVO.java | 47 + .../vo/BusinessQCProjectDataPageReqVO.java | 59 + .../vo/BusinessQCProjectDataRespVO.java | 75 ++ .../vo/BusinessQCProjectDataSaveReqVO.java | 61 + ...sQualityControlSampleProjectPageReqVO.java | 62 + ...nessQualityControlSampleProjectRespVO.java | 79 ++ ...sQualityControlSampleProjectSaveReqVO.java | 64 + .../BusinessSampleAssayResultPageReqVO.java | 8 +- .../vo/BusinessSampleAssayResultRespVO.java | 12 +- .../BusinessSampleAssayResultSaveReqVO.java | 14 +- ...inessSampleDispatchDetailExtendRespVO.java | 35 + ...BusinessSampleDispatchDetailPageReqVO.java | 74 ++ .../BusinessSampleDispatchDetailRespVO.java | 74 ++ ...BusinessSampleDispatchDetailSaveReqVO.java | 55 + .../vo/BusinessSampleDispatchPageReqVO.java | 71 ++ .../vo/BusinessSampleDispatchRespVO.java | 90 ++ .../vo/BusinessSampleDispatchSaveReqVO.java | 75 ++ ...sinessSampleEntrustDetailExtendRespVO.java | 9 + .../BusinessSampleEntrustDetailPageReqVO.java | 20 +- .../vo/BusinessSampleEntrustDetailReqVO.java | 63 + .../vo/BusinessSampleEntrustDetailRespVO.java | 28 +- .../BusinessSampleEntrustDetailSaveReqVO.java | 30 +- ...BusinessSampleEntrustProjectPageReqVO.java | 10 +- .../BusinessSampleEntrustProjectRespVO.java | 14 +- ...BusinessSampleEntrustProjectSaveReqVO.java | 16 +- ...SampleEntrustRegistrationExtendRespVO.java | 3 - ...essSampleEntrustRegistrationPageReqVO.java | 90 +- ...sinessSampleEntrustRegistrationRespVO.java | 116 +- ...essSampleEntrustRegistrationSaveReqVO.java | 102 +- ...BusinessSampleHandoverDetailPageReqVO.java | 12 +- .../BusinessSampleHandoverDetailRespVO.java | 18 +- ...BusinessSampleHandoverDetailSaveReqVO.java | 15 +- .../vo/BusinessSampleHandoverPageReqVO.java | 21 +- .../vo/BusinessSampleHandoverRespVO.java | 32 +- .../vo/BusinessSampleHandoverSaveReqVO.java | 28 +- .../BusinessStandardSampleExtendRespVO.java | 26 + .../vo/BusinessStandardSamplePageReqVO.java | 44 + ...usinessStandardSampleProjectPageReqVO.java | 53 + .../BusinessStandardSampleProjectRespVO.java | 67 + ...usinessStandardSampleProjectSaveReqVO.java | 52 + .../vo/BusinessStandardSampleReqVO.java | 44 + .../vo/BusinessStandardSampleRespVO.java | 55 + .../vo/BusinessStandardSampleSaveReqVO.java | 43 + ...SubParentSampleAssessmentExtendRespVO.java | 23 + ...sSubParentSampleAssessmentGroupRespVO.java | 13 + ...essSubParentSampleAssessmentPageReqVO.java | 78 ++ ...sinessSubParentSampleAssessmentRespVO.java | 94 ++ ...essSubParentSampleAssessmentSaveReqVO.java | 84 ++ .../vo/BusinessSubParentSamplePageReqVO.java | 18 +- .../vo/BusinessSubParentSampleRespVO.java | 22 +- .../vo/BusinessSubParentSampleSaveReqVO.java | 20 +- ...sinessSubSampleAnalysisGroupPageReqVO.java | 54 + .../BusinessSubSampleAnalysisGroupRespVO.java | 67 + ...sinessSubSampleAnalysisGroupSaveReqVO.java | 55 + ...sinessSubSampleAssessmentExtendRespVO.java | 24 + .../BusinessSubSampleAssessmentPageReqVO.java | 39 +- .../vo/BusinessSubSampleAssessmentRespVO.java | 52 +- .../BusinessSubSampleAssessmentSaveReqVO.java | 51 +- .../vo/BusinessSubSampleExtendRespVO.java | 19 + .../vo/BusinessSubSamplePageReqVO.java | 90 +- ...sinessSubSampleParentRecheckPageReqVO.java | 50 + .../BusinessSubSampleParentRecheckRespVO.java | 63 + ...sinessSubSampleParentRecheckSaveReqVO.java | 52 + .../controller/vo/BusinessSubSampleReqVO.java | 89 +- .../vo/BusinessSubSampleRespVO.java | 109 +- .../vo/BusinessSubSampleSaveReqVO.java | 123 +- .../vo/BusinessXRFDataPageReqVO.java | 82 ++ .../controller/vo/BusinessXRFDataReqVO.java | 85 ++ .../controller/vo/BusinessXRFDataRespVO.java | 102 ++ .../vo/BusinessXRFDataSaveReqVO.java | 84 ++ .../controller/vo/ChangeAssayMethodReqVO.java | 16 + .../controller/vo/CreateQcSampleReqVO.java | 29 + .../controller/vo/DeleteQcSampleReqVO.java | 19 + .../vo/ModifyResultAssessmentReqVO.java | 19 + .../vo/ModifySampleResultReportingReqVO.java | 11 + ...ReportSubParentSampleAssessmentRespVO.java | 25 + .../vo/RecheckSubSampleParentCreateReqVO.java | 26 + .../RecheckSubSampleParentMethodRespVO.java | 31 + .../controller/vo/ReportFieldValueData.java | 39 + .../bus/controller/vo/ReportedDataSource.java | 88 ++ .../vo/SampleAssayResultAssessmentRespVO.java | 37 + .../vo/UnAssignTaskedSubSampleRespVO.java | 50 + .../BusinessAssayParameterDataDO.java | 4 +- .../BusinessAssayProjectDataDO.java | 17 +- .../dataobject/BusinessAssayReportDataDO.java | 112 ++ .../dal/dataobject/BusinessAssayTaskDO.java | 169 +++ .../dataobject/BusinessAssayTaskDataDO.java | 60 +- .../dataobject/BusinessAssayTaskDetailDO.java | 95 ++ .../dal/dataobject/BusinessBaseSampleDO.java | 31 +- .../BusinessHandoverRecordSubDO.java | 29 +- .../BusinessQCCoefficientDataDO.java | 132 ++ .../BusinessQCCoefficientParameterDataDO.java | 80 ++ .../bus/dal/dataobject/BusinessQCDataDO.java | 132 ++ .../BusinessQCManagementDataDO.java | 132 ++ .../BusinessQCManagementParameterDataDO.java | 80 ++ .../BusinessQCManagementProjectDataDO.java | 100 ++ .../dataobject/BusinessQCParameterDataDO.java | 80 ++ .../dataobject/BusinessQCProjectDataDO.java | 100 ++ ...BusinessQualityControlSampleProjectDO.java | 105 ++ .../BusinessSampleAssayResultDO.java | 2 +- .../dataobject/BusinessSampleDispatchDO.java | 122 ++ .../BusinessSampleDispatchDetailDO.java | 99 ++ .../BusinessSampleEntrustDetailDO.java | 16 +- .../BusinessSampleEntrustProjectDO.java | 4 +- .../BusinessSampleEntrustRegistrationDO.java | 114 +- .../dataobject/BusinessSampleHandoverDO.java | 23 +- .../BusinessSampleHandoverDetailDO.java | 3 +- .../dataobject/BusinessStandardSampleDO.java | 75 ++ .../BusinessStandardSampleProjectDO.java | 90 ++ .../BusinessSubParentSampleAssessmentDO.java | 131 ++ .../dataobject/BusinessSubParentSampleDO.java | 2 +- .../BusinessSubSampleAnalysisGroupDO.java | 91 ++ .../BusinessSubSampleAssessmentDO.java | 39 +- .../dal/dataobject/BusinessSubSampleDO.java | 82 +- .../BusinessSubSampleParentRecheckDO.java | 85 ++ .../bus/dal/dataobject/BusinessXRFDataDO.java | 137 ++ .../BusinessAssayParameterDataMapper.java | 52 + .../BusinessAssayProjectDataMapper.java | 95 ++ .../mapper/BusinessAssayReportDataMapper.java | 52 + .../mapper/BusinessAssayTaskDataMapper.java | 270 +++- .../mapper/BusinessAssayTaskDetailMapper.java | 97 ++ .../dal/mapper/BusinessAssayTaskMapper.java | 134 ++ .../dal/mapper/BusinessBaseSampleMapper.java | 11 +- .../BusinessHandoverRecordSubMapper.java | 23 +- .../BusinessQCCoefficientDataMapper.java | 81 ++ ...inessQCCoefficientParameterDataMapper.java | 86 ++ .../bus/dal/mapper/BusinessQCDataMapper.java | 74 ++ .../BusinessQCManagementDataMapper.java | 75 ++ ...sinessQCManagementParameterDataMapper.java | 84 ++ ...BusinessQCManagementProjectDataMapper.java | 91 ++ .../mapper/BusinessQCParameterDataMapper.java | 35 + .../mapper/BusinessQCProjectDataMapper.java | 44 + ...nessQualityControlSampleProjectMapper.java | 39 + .../BusinessSampleAssayResultMapper.java | 3 - .../BusinessSampleDispatchDetailMapper.java | 67 + .../mapper/BusinessSampleDispatchMapper.java | 41 + .../BusinessSampleEntrustDetailMapper.java | 52 +- .../BusinessSampleEntrustProjectMapper.java | 19 +- ...sinessSampleEntrustRegistrationMapper.java | 31 +- .../BusinessSampleHandoverDetailMapper.java | 11 +- .../mapper/BusinessSampleHandoverMapper.java | 10 +- .../mapper/BusinessStandardSampleMapper.java | 61 + .../BusinessStandardSampleProjectMapper.java | 36 + ...sinessSubParentSampleAssessmentMapper.java | 77 ++ .../mapper/BusinessSubParentSampleMapper.java | 2 - .../BusinessSubSampleAnalysisGroupMapper.java | 45 + .../BusinessSubSampleAssessmentMapper.java | 67 +- .../dal/mapper/BusinessSubSampleMapper.java | 102 +- .../BusinessSubSampleParentRecheckMapper.java | 42 + .../bus/dal/mapper/BusinessXRFDataMapper.java | 73 ++ .../liteflow/param/SampleEntrustDetail.java | 2 +- .../liteflow/param/SampleEntrustParam.java | 7 +- .../param/SampleTaskAssignManualParam.java | 20 + .../param/SampleTaskAssignMethodParam.java | 21 + .../param/SampleTaskAssignSampleParam.java | 19 + .../SampleAnalysisProjectAssessmentCmp.java | 35 + .../sample/entrust/SampleEntrustCheckCmp.java | 19 +- .../entrust/SampleEntrustContextInitCmp.java | 22 +- .../entrust/SampleEntrustCreateDataCmp.java | 37 +- .../SampleEntrustGenSampleDataCmp.java | 563 +++++++-- .../entrust/SampleEntrustReceiveDataCmp.java | 16 +- .../entrust/SampleEntrustSendDataCmp.java | 16 +- .../entrust/SampleEntrustUpdateDataCmp.java | 12 + .../flow/SampleDataSaveOrUpdateCmp.java | 24 + .../sample/flow/SampleFlowContextInitCmp.java | 4 +- .../flow/SampleHandoverRecordSubCmp.java | 20 +- .../sample/flow/SampleSimpleEncryptCmp.java | 4 +- .../sample/flow/SampleSubCheckCmp.java | 28 +- .../sample/flow/SampleSubHandoverCmp.java | 33 +- .../flow/SampleSubProcessUpdateCmp.java | 106 +- .../SampleTaskAssignContextInitCmp.java | 58 + .../SampleTaskAssignDataSaveOrUpdateCmp.java | 81 ++ .../taskassign/SampleTaskAssignManualCmp.java | 151 +++ .../taskassign/SampleTaskAssignMethodCmp.java | 160 +++ .../SampleTaskAssignQCSampleCmp.java | 147 +++ .../taskassign/SampleTaskAssignSampleCmp.java | 152 +++ .../liteflow/slot/SampleEntrustContext.java | 14 + .../bus/liteflow/slot/SampleFlowContext.java | 19 + .../slot/SampleTaskAssignContext.java | 93 ++ .../slot/SampleTaskAssignTypeEnum.java | 12 + .../BusinessAssayParameterDataService.java | 4 + ...BusinessAssayParameterDataServiceImpl.java | 4 +- .../BusinessAssayProjectDataService.java | 4 + .../BusinessAssayProjectDataServiceImpl.java | 4 +- .../BusinessAssayReportDataService.java | 74 ++ .../BusinessAssayReportDataServiceImpl.java | 108 ++ .../service/BusinessAssayTaskDataService.java | 12 +- .../BusinessAssayTaskDataServiceImpl.java | 18 +- .../BusinessAssayTaskDetailService.java | 70 ++ .../BusinessAssayTaskDetailServiceImpl.java | 96 ++ .../bus/service/BusinessAssayTaskService.java | 75 ++ .../service/BusinessAssayTaskServiceImpl.java | 115 ++ .../service/BusinessBaseSampleService.java | 4 + .../BusinessBaseSampleServiceImpl.java | 4 +- .../BusinessHandoverRecordSubService.java | 6 + .../BusinessHandoverRecordSubServiceImpl.java | 11 +- .../BusinessQCCoefficientDataService.java | 64 + .../BusinessQCCoefficientDataServiceImpl.java | 96 ++ ...nessQCCoefficientParameterDataService.java | 62 + ...QCCoefficientParameterDataServiceImpl.java | 91 ++ .../bus/service/BusinessQCDataService.java | 69 + .../service/BusinessQCDataServiceImpl.java | 96 ++ .../BusinessQCManagementDataService.java | 64 + .../BusinessQCManagementDataServiceImpl.java | 96 ++ ...inessQCManagementParameterDataService.java | 62 + ...sQCManagementParameterDataServiceImpl.java | 91 ++ ...usinessQCManagementProjectDataService.java | 62 + ...essQCManagementProjectDataServiceImpl.java | 91 ++ .../BusinessQCParameterDataService.java | 62 + .../BusinessQCParameterDataServiceImpl.java | 91 ++ .../service/BusinessQCProjectDataService.java | 62 + .../BusinessQCProjectDataServiceImpl.java | 91 ++ ...essQualityControlSampleProjectService.java | 66 + ...ualityControlSampleProjectServiceImpl.java | 93 ++ .../BusinessSampleAssayResultService.java | 4 + .../BusinessSampleAssayResultServiceImpl.java | 4 +- .../BusinessSampleDispatchDetailService.java | 70 ++ ...sinessSampleDispatchDetailServiceImpl.java | 111 ++ .../BusinessSampleDispatchService.java | 76 ++ .../BusinessSampleDispatchServiceImpl.java | 354 ++++++ .../BusinessSampleEntrustDetailService.java | 17 +- ...usinessSampleEntrustDetailServiceImpl.java | 9 +- .../BusinessSampleEntrustProjectService.java | 4 + ...sinessSampleEntrustProjectServiceImpl.java | 4 +- ...inessSampleEntrustRegistrationService.java | 11 + ...sSampleEntrustRegistrationServiceImpl.java | 17 +- .../BusinessSampleHandoverDetailService.java | 1 + ...sinessSampleHandoverDetailServiceImpl.java | 10 +- .../BusinessSampleHandoverService.java | 13 + .../BusinessSampleHandoverServiceImpl.java | 38 +- .../BusinessStandardSampleProjectService.java | 66 + ...inessStandardSampleProjectServiceImpl.java | 93 ++ .../BusinessStandardSampleService.java | 67 + .../BusinessStandardSampleServiceImpl.java | 101 ++ ...inessSubParentSampleAssessmentService.java | 62 + ...sSubParentSampleAssessmentServiceImpl.java | 86 ++ .../BusinessSubParentSampleService.java | 4 + .../BusinessSubParentSampleServiceImpl.java | 4 +- ...BusinessSubSampleAnalysisGroupService.java | 66 + ...nessSubSampleAnalysisGroupServiceImpl.java | 93 ++ .../BusinessSubSampleAssessmentService.java | 4 + ...usinessSubSampleAssessmentServiceImpl.java | 4 +- ...BusinessSubSampleParentRecheckService.java | 62 + ...nessSubSampleParentRecheckServiceImpl.java | 91 ++ .../bus/service/BusinessSubSampleService.java | 18 +- .../service/BusinessSubSampleServiceImpl.java | 234 +++- .../bus/service/BusinessXRFDataService.java | 61 + .../service/BusinessXRFDataServiceImpl.java | 91 ++ .../service/SampleAnalysisAuditService.java | 38 + .../SampleAnalysisAuditServiceImpl.java | 1044 ++++++++++++++++ .../bus/service/SampleAnalysisService.java | 68 + .../service/SampleAnalysisServiceImpl.java | 938 ++++++++++++++ .../bus/service/SampleEntrustService.java | 4 + .../bus/service/SampleEntrustServiceImpl.java | 77 +- .../bus/service/SampleFlowServiceImpl.java | 2 +- .../service/SampleResultReportingService.java | 28 + .../SampleResultReportingServiceImpl.java | 545 ++++++++ .../bus/service/SampleTaskAssignService.java | 91 ++ .../service/SampleTaskAssignServiceImpl.java | 633 ++++++++++ .../admin/BaseSampleController.java | 14 +- .../admin/ConfigAssayMethodController.java | 18 +- ...ssayMethodProjectAssessmentController.java | 106 ++ ...sayMethodProjectCoefficientController.java | 106 ++ .../ConfigAssayMethodProjectController.java | 18 +- ...AssayMethodProjectParameterController.java | 18 +- ...nfigAssayMethodProjectRangeController.java | 108 ++ .../admin/ConfigBaseSampleController.java | 18 +- .../admin/ConfigEntrustSourceController.java | 21 +- .../admin/ConfigPermissionController.java | 108 ++ .../admin/ConfigProjectController.java | 18 +- .../admin/ConfigQCSampleMethodController.java | 106 ++ ...nfigQCSampleMethodParameterController.java | 106 ++ .../ConfigQCStandardSampleController.java | 106 ++ .../admin/ConfigReportFieldController.java | 18 +- .../admin/ConfigReportTemplateController.java | 401 +++++- .../admin/ConfigReportTypeController.java | 18 +- .../admin/ConfigRuleController.java | 106 ++ .../admin/ConfigSampleFlowController.java | 18 +- .../admin/ConfigSampleHandoverController.java | 18 +- .../admin/ConfigSampleReportController.java | 18 +- .../admin/ConfigSimpleFlowCodeController.java | 15 +- .../admin/ConfigSimpleFlowRuleController.java | 14 +- ...ConfigStandardSampleProjectController.java | 18 +- .../ConfigStandardSampleTypeController.java | 18 +- .../admin/ConfigSubSampleController.java | 18 +- .../ConfigSubSampleMethodController.java | 18 +- .../ConfigSubSampleParentController.java | 18 +- ...ConfigSubSampleParentMethodController.java | 106 ++ .../admin/ConfigUserSignatureController.java | 117 ++ .../ConfigWarehouseLocationController.java | 109 ++ ...WarehouseLocationInfomationController.java | 108 -- .../ConfigXRFConversionRateController.java | 106 ++ .../admin/ConfigXRFLineController.java | 106 ++ .../admin/ConfigXRFProjectController.java | 106 ++ .../MaterialAssayStandardController.java | 14 +- ...MaterialAssayStandardDetailController.java | 14 +- ...ssayStandardForecastProjectController.java | 114 ++ ...MaterialAssayStandardMethodController.java | 14 +- .../controller/vo/BaseSamplePageReqVO.java | 11 +- .../controller/vo/BaseSampleRespVO.java | 18 +- .../controller/vo/BaseSampleSaveReqVO.java | 15 +- .../BusinessAssayTaskAnalysisDataRespVO.java | 33 + .../vo/ConfigAssayMethodExtendRespVO.java | 1 - .../vo/ConfigAssayMethodPageReqVO.java | 31 +- ...AssayMethodProjectAssessmentPageReqVO.java | 65 + ...figAssayMethodProjectAssessmentRespVO.java | 83 ++ ...AssayMethodProjectAssessmentSaveReqVO.java | 66 + ...ssayMethodProjectCoefficientPageReqVO.java | 54 + ...igAssayMethodProjectCoefficientRespVO.java | 68 + ...ssayMethodProjectCoefficientSaveReqVO.java | 54 + .../ConfigAssayMethodProjectExtendRespVO.java | 17 + .../vo/ConfigAssayMethodProjectPageReqVO.java | 21 +- ...gAssayMethodProjectParameterPageReqVO.java | 16 +- ...nfigAssayMethodProjectParameterRespVO.java | 26 +- ...gAssayMethodProjectParameterSaveReqVO.java | 21 +- ...onfigAssayMethodProjectRangePageReqVO.java | 53 + .../ConfigAssayMethodProjectRangeRespVO.java | 67 + ...onfigAssayMethodProjectRangeSaveReqVO.java | 54 + .../vo/ConfigAssayMethodProjectRespVO.java | 31 +- .../vo/ConfigAssayMethodProjectSaveReqVO.java | 26 +- .../controller/vo/ConfigAssayMethodReqVO.java | 31 +- .../vo/ConfigAssayMethodRespVO.java | 41 +- .../vo/ConfigAssayMethodSaveReqVO.java | 36 +- .../vo/ConfigBaseSamplePageReqVO.java | 10 +- .../controller/vo/ConfigBaseSampleRespVO.java | 18 +- .../vo/ConfigBaseSampleSaveReqVO.java | 15 +- .../vo/ConfigDocumentTypeRespVO.java | 63 - .../vo/ConfigDocumentTypeSaveReqVO.java | 54 - .../vo/ConfigEntrustSourcePageReqVO.java | 18 +- .../vo/ConfigEntrustSourceReqVO.java | 19 +- .../vo/ConfigEntrustSourceRespVO.java | 31 +- .../vo/ConfigEntrustSourceSaveReqVO.java | 27 +- .../vo/ConfigPermissionPageReqVO.java | 43 + .../controller/vo/ConfigPermissionRespVO.java | 54 + .../vo/ConfigPermissionSaveReqVO.java | 37 + .../vo/ConfigProjectExtendRespVO.java | 23 + .../controller/vo/ConfigProjectPageReqVO.java | 6 +- .../controller/vo/ConfigProjectRespVO.java | 12 +- .../controller/vo/ConfigProjectSaveReqVO.java | 10 +- .../vo/ConfigQCSampleMethodExtendRespVO.java | 11 + .../vo/ConfigQCSampleMethodPageReqVO.java | 56 + ...igQCSampleMethodParameterExtendRespVO.java | 23 + ...onfigQCSampleMethodParameterPageReqVO.java | 62 + .../ConfigQCSampleMethodParameterRespVO.java | 77 ++ ...onfigQCSampleMethodParameterSaveReqVO.java | 63 + .../vo/ConfigQCSampleMethodRespVO.java | 70 ++ .../vo/ConfigQCSampleMethodSaveReqVO.java | 58 + ...a => ConfigQCStandardSamplePageReqVO.java} | 20 +- .../vo/ConfigQCStandardSampleRespVO.java | 39 + .../vo/ConfigQCStandardSampleSaveReqVO.java | 29 + .../vo/ConfigReportFieldPageReqVO.java | 29 +- .../controller/vo/ConfigReportFieldReqVO.java | 66 + .../vo/ConfigReportFieldRespVO.java | 72 +- .../vo/ConfigReportFieldSaveReqVO.java | 61 +- .../vo/ConfigReportTemplatePageReqVO.java | 14 +- .../vo/ConfigReportTemplateRespVO.java | 19 +- .../vo/ConfigReportTemplateSaveReqVO.java | 15 +- .../vo/ConfigReportTypePageReqVO.java | 4 +- .../controller/vo/ConfigReportTypeRespVO.java | 10 +- .../vo/ConfigReportTypeSaveReqVO.java | 7 +- ...ageReqVO.java => ConfigRulePageReqVO.java} | 39 +- .../controller/vo/ConfigRuleRespVO.java | 59 + .../controller/vo/ConfigRuleSaveReqVO.java | 46 + .../vo/ConfigSampleFlowPageReqVO.java | 12 +- .../controller/vo/ConfigSampleFlowRespVO.java | 20 +- .../vo/ConfigSampleFlowSaveReqVO.java | 13 +- .../vo/ConfigSampleHandoverPageReqVO.java | 8 +- .../vo/ConfigSampleHandoverRespVO.java | 16 +- .../vo/ConfigSampleHandoverSaveReqVO.java | 13 +- .../vo/ConfigSampleReportExtendRespVO.java | 17 + .../vo/ConfigSampleReportPageReqVO.java | 8 +- .../vo/ConfigSampleReportReqVO.java | 39 + .../vo/ConfigSampleReportRespVO.java | 14 +- .../vo/ConfigSampleReportSaveReqVO.java | 11 +- .../vo/ConfigSimpleFlowCodePageReqVO.java | 4 +- .../vo/ConfigSimpleFlowCodeRespVO.java | 14 +- .../vo/ConfigSimpleFlowCodeSaveReqVO.java | 26 +- .../vo/ConfigSimpleFlowRulePageReqVO.java | 14 +- .../vo/ConfigSimpleFlowRuleReqVO.java | 14 +- .../vo/ConfigSimpleFlowRuleRespVO.java | 20 +- .../vo/ConfigSimpleFlowRuleSaveReqVO.java | 19 +- .../ConfigStandardSampleProjectPageReqVO.java | 12 +- .../vo/ConfigStandardSampleProjectRespVO.java | 20 +- .../ConfigStandardSampleProjectSaveReqVO.java | 18 +- .../vo/ConfigStandardSampleTypePageReqVO.java | 15 +- .../vo/ConfigStandardSampleTypeRespVO.java | 22 +- .../vo/ConfigStandardSampleTypeSaveReqVO.java | 21 +- .../vo/ConfigSubSampleMethodExtendRespVO.java | 19 + .../vo/ConfigSubSampleMethodPageReqVO.java | 20 +- .../vo/ConfigSubSampleMethodRespVO.java | 26 +- .../vo/ConfigSubSampleMethodSaveReqVO.java | 23 +- .../vo/ConfigSubSamplePageReqVO.java | 21 +- .../ConfigSubSampleParentMethodPageReqVO.java | 38 + .../vo/ConfigSubSampleParentMethodRespVO.java | 47 + .../ConfigSubSampleParentMethodSaveReqVO.java | 35 + .../vo/ConfigSubSampleParentPageReqVO.java | 11 +- .../vo/ConfigSubSampleParentRespVO.java | 18 +- .../vo/ConfigSubSampleParentSaveReqVO.java | 15 +- .../controller/vo/ConfigSubSampleRespVO.java | 27 +- .../vo/ConfigSubSampleSaveReqVO.java | 26 +- .../vo/ConfigUserSignaturePageReqVO.java | 40 + .../vo/ConfigUserSignatureRespVO.java | 50 + .../vo/ConfigUserSignatureSaveReqVO.java | 34 + ...nfigWarehouseLocationInfomationRespVO.java | 47 - ...gWarehouseLocationInfomationSaveReqVO.java | 37 - .../vo/ConfigWarehouseLocationPageReqVO.java | 53 + .../vo/ConfigWarehouseLocationRespVO.java | 66 + .../vo/ConfigWarehouseLocationSaveReqVO.java | 51 + .../vo/ConfigXRFConversionRatePageReqVO.java | 38 + .../vo/ConfigXRFConversionRateRespVO.java | 47 + .../vo/ConfigXRFConversionRateSaveReqVO.java | 35 + .../controller/vo/ConfigXRFLinePageReqVO.java | 49 + .../controller/vo/ConfigXRFLineRespVO.java | 59 + .../controller/vo/ConfigXRFLineSaveReqVO.java | 46 + .../vo/ConfigXRFProjectPageReqVO.java | 56 + .../controller/vo/ConfigXRFProjectRespVO.java | 70 ++ .../vo/ConfigXRFProjectSaveReqVO.java | 53 + .../MaterialAssayStandardDetailPageReqVO.java | 15 +- .../vo/MaterialAssayStandardDetailRespVO.java | 26 +- .../MaterialAssayStandardDetailSaveReqVO.java | 19 +- ...ayStandardForecastProjectExtendRespVO.java | 17 + ...AssayStandardForecastProjectPageReqVO.java | 50 + ...rialAssayStandardForecastProjectReqVO.java | 52 + ...ialAssayStandardForecastProjectRespVO.java | 63 + ...AssayStandardForecastProjectSaveReqVO.java | 50 + .../MaterialAssayStandardMethodPageReqVO.java | 20 +- .../vo/MaterialAssayStandardMethodRespVO.java | 32 +- .../MaterialAssayStandardMethodSaveReqVO.java | 23 +- .../vo/MaterialAssayStandardRespVO.java | 1 - .../config/dal/dataobject/BaseSampleDO.java | 16 +- .../dal/dataobject/ConfigAssayMethodDO.java | 37 +- .../ConfigAssayMethodProjectAssessmentDO.java | 110 ++ ...ConfigAssayMethodProjectCoefficientDO.java | 91 ++ .../ConfigAssayMethodProjectDO.java | 23 +- .../ConfigAssayMethodProjectParameterDO.java | 18 +- .../ConfigAssayMethodProjectRangeDO.java | 90 ++ .../dal/dataobject/ConfigBaseSampleDO.java | 4 +- .../dal/dataobject/ConfigEntrustSourceDO.java | 23 +- .../dal/dataobject/ConfigPermissionDO.java | 70 ++ .../dataobject/ConfigQCSampleMethodDO.java | 95 ++ .../ConfigQCSampleMethodParameterDO.java | 105 ++ .../dataobject/ConfigQCStandardSampleDO.java | 55 + .../dal/dataobject/ConfigReportFieldDO.java | 37 +- .../dataobject/ConfigReportTemplateDO.java | 20 +- .../config/dal/dataobject/ConfigRuleDO.java | 80 ++ .../dal/dataobject/ConfigSampleFlowDO.java | 12 +- .../dataobject/ConfigSampleHandoverDO.java | 6 +- .../dataobject/ConfigSimpleFlowRuleDO.java | 10 +- .../ConfigStandardSampleProjectDO.java | 4 +- .../ConfigStandardSampleTypeDO.java | 15 +- .../dal/dataobject/ConfigSubSampleDO.java | 19 +- .../dataobject/ConfigSubSampleMethodDO.java | 24 +- .../dataobject/ConfigSubSampleParentDO.java | 5 + .../ConfigSubSampleParentMethodDO.java | 65 + .../dal/dataobject/ConfigUserSignatureDO.java | 67 + .../dataobject/ConfigWarehouseLocationDO.java | 88 ++ .../ConfigWarehouseLocationParDO.java | 10 + ...DO.java => ConfigXRFConversionRateDO.java} | 32 +- .../dal/dataobject/ConfigXRFLineDO.java | 82 ++ .../dal/dataobject/ConfigXRFProjectDO.java | 95 ++ .../MaterialAssayStandardDetailDO.java | 7 +- .../MaterialAssayStandardDetailExtendDO.java | 2 +- .../MaterialAssayStandardExtendDO.java | 1 - ...aterialAssayStandardForecastProjectDO.java | 85 ++ .../MaterialAssayStandardMethodDO.java | 21 +- .../config/dal/mapper/BaseSampleMapper.java | 2 +- .../dal/mapper/ConfigAssayMethodMapper.java | 24 +- ...figAssayMethodProjectAssessmentMapper.java | 41 + ...igAssayMethodProjectCoefficientMapper.java | 37 + .../ConfigAssayMethodProjectMapper.java | 33 +- ...nfigAssayMethodProjectParameterMapper.java | 27 +- .../ConfigAssayMethodProjectRangeMapper.java | 36 + .../dal/mapper/ConfigBaseSampleMapper.java | 3 +- .../dal/mapper/ConfigEntrustSourceMapper.java | 10 +- .../dal/mapper/ConfigPermissionMapper.java | 31 + .../dal/mapper/ConfigProjectMapper.java | 26 +- .../mapper/ConfigQCSampleMethodMapper.java | 70 ++ .../ConfigQCSampleMethodParameterMapper.java | 65 + .../mapper/ConfigQCStandardSampleMapper.java | 30 + .../dal/mapper/ConfigReportFieldMapper.java | 47 +- .../mapper/ConfigReportTemplateMapper.java | 18 +- .../dal/mapper/ConfigReportTypeMapper.java | 3 +- .../config/dal/mapper/ConfigRuleMapper.java | 40 + .../dal/mapper/ConfigSampleFlowMapper.java | 18 +- .../mapper/ConfigSampleHandoverMapper.java | 7 +- .../dal/mapper/ConfigSampleReportMapper.java | 25 +- .../mapper/ConfigSimpleFlowRuleMapper.java | 4 + .../ConfigStandardSampleProjectMapper.java | 5 +- .../ConfigStandardSampleTypeMapper.java | 6 +- .../dal/mapper/ConfigSubSampleMapper.java | 7 +- .../mapper/ConfigSubSampleMethodMapper.java | 29 +- .../mapper/ConfigSubSampleParentMapper.java | 4 +- .../ConfigSubSampleParentMethodMapper.java | 43 + .../dal/mapper/ConfigUserSignatureMapper.java | 31 + ...nfigWarehouseLocationInfomationMapper.java | 32 - .../mapper/ConfigWarehouseLocationMapper.java | 35 + .../mapper/ConfigXRFConversionRateMapper.java | 37 + .../dal/mapper/ConfigXRFLineMapper.java | 49 + .../dal/mapper/ConfigXRFProjectMapper.java | 42 + ...ialAssayStandardForecastProjectMapper.java | 65 + .../mapper/MaterialAssayStandardMapper.java | 3 +- .../MaterialAssayStandardMethodMapper.java | 25 +- ...igAssayMethodProjectAssessmentService.java | 62 + ...sayMethodProjectAssessmentServiceImpl.java | 91 ++ ...gAssayMethodProjectCoefficientService.java | 62 + ...ayMethodProjectCoefficientServiceImpl.java | 91 ++ ...figAssayMethodProjectParameterService.java | 4 + ...ssayMethodProjectParameterServiceImpl.java | 3 + .../ConfigAssayMethodProjectRangeService.java | 66 + ...figAssayMethodProjectRangeServiceImpl.java | 93 ++ .../ConfigAssayMethodProjectService.java | 4 + .../ConfigAssayMethodProjectServiceImpl.java | 3 + .../service/ConfigAssayMethodService.java | 2 + .../service/ConfigAssayMethodServiceImpl.java | 1 + .../service/ConfigBaseSampleService.java | 4 + .../service/ConfigBaseSampleServiceImpl.java | 3 + .../service/ConfigEntrustSourceService.java | 5 + .../ConfigEntrustSourceServiceImpl.java | 4 + .../service/ConfigPermissionService.java | 77 ++ .../service/ConfigPermissionServiceImpl.java | 196 +++ .../config/service/ConfigProjectService.java | 4 + .../service/ConfigProjectServiceImpl.java | 3 + .../ConfigQCSampleMethodParameterService.java | 62 + ...figQCSampleMethodParameterServiceImpl.java | 91 ++ .../service/ConfigQCSampleMethodService.java | 62 + .../ConfigQCSampleMethodServiceImpl.java | 91 ++ .../ConfigQCStandardSampleService.java | 62 + .../ConfigQCStandardSampleServiceImpl.java | 91 ++ .../service/ConfigReportFieldService.java | 4 + .../service/ConfigReportFieldServiceImpl.java | 3 + .../ConfigReportTemplateServiceImpl.java | 8 +- .../service/ConfigReportTypeService.java | 4 + .../service/ConfigReportTypeServiceImpl.java | 3 + .../config/service/ConfigRuleService.java | 62 + .../config/service/ConfigRuleServiceImpl.java | 91 ++ .../service/ConfigSampleFlowService.java | 25 +- .../service/ConfigSampleFlowServiceImpl.java | 20 +- .../service/ConfigSampleHandoverService.java | 4 + .../ConfigSampleHandoverServiceImpl.java | 4 +- .../service/ConfigSampleReportService.java | 4 + .../ConfigSampleReportServiceImpl.java | 3 + .../ConfigSimpleFlowCodeServiceImpl.java | 2 - .../ConfigSimpleFlowRuleServiceImpl.java | 2 - .../ConfigStandardSampleProjectService.java | 4 + ...onfigStandardSampleProjectServiceImpl.java | 3 + .../ConfigStandardSampleTypeService.java | 4 + .../ConfigStandardSampleTypeServiceImpl.java | 3 + .../service/ConfigSubSampleMethodService.java | 4 + .../ConfigSubSampleMethodServiceImpl.java | 3 + .../ConfigSubSampleParentMethodService.java | 62 + ...onfigSubSampleParentMethodServiceImpl.java | 91 ++ .../service/ConfigSubSampleParentService.java | 4 + .../ConfigSubSampleParentServiceImpl.java | 3 + .../service/ConfigSubSampleService.java | 4 + .../service/ConfigSubSampleServiceImpl.java | 3 + .../service/ConfigUserSignatureService.java | 67 + .../ConfigUserSignatureServiceImpl.java | 110 ++ ...figWarehouseLocationInfomationService.java | 62 - ...arehouseLocationInfomationServiceImpl.java | 89 -- .../ConfigWarehouseLocationService.java | 66 + .../ConfigWarehouseLocationServiceImpl.java | 111 ++ .../ConfigXRFConversionRateService.java | 61 + .../ConfigXRFConversionRateServiceImpl.java | 91 ++ .../config/service/ConfigXRFLineService.java | 61 + .../service/ConfigXRFLineServiceImpl.java | 91 ++ .../service/ConfigXRFProjectService.java | 61 + .../service/ConfigXRFProjectServiceImpl.java | 91 ++ .../MaterialAssayStandardDetailService.java | 1 - ...aterialAssayStandardDetailServiceImpl.java | 1 - ...alAssayStandardForecastProjectService.java | 70 ++ ...sayStandardForecastProjectServiceImpl.java | 97 ++ .../admin/DictionaryParameterController.java | 14 +- .../admin/DictionaryProjectController.java | 14 +- .../DictionarySampleFlowNodeController.java | 14 +- .../admin/DictionarySampleTypeController.java | 14 +- .../vo/DictionaryParameterPageReqVO.java | 12 +- .../vo/DictionaryParameterRespVO.java | 20 +- .../vo/DictionaryParameterSaveReqVO.java | 17 +- .../vo/DictionaryProjectPageReqVO.java | 20 +- .../vo/DictionaryProjectRespVO.java | 30 +- .../vo/DictionaryProjectSaveReqVO.java | 21 +- .../vo/DictionarySampleFlowNodePageReqVO.java | 16 +- .../vo/DictionarySampleFlowNodeRespVO.java | 29 +- .../vo/DictionarySampleFlowNodeSaveReqVO.java | 20 +- .../vo/DictionarySampleTypeSaveReqVO.java | 1 - .../dal/dataobject/DictionaryParameterDO.java | 4 +- .../dal/dataobject/DictionaryProjectDO.java | 12 +- .../DictionarySampleFlowNodeDO.java | 17 +- .../dal/mapper/DictionaryParameterMapper.java | 3 +- .../dal/mapper/DictionaryProjectMapper.java | 3 +- .../DictionarySampleFlowNodeMapper.java | 2 + .../admin/ReportDocumentDataController.java | 157 +++ .../admin/ReportDocumentMainController.java | 264 ++++ ...portDocumentMainCorrelationController.java | 109 ++ .../admin/ReportDocumentTypeController.java | 126 ++ .../vo/ReportDocumentDataPageReqVO.java | 46 + .../vo/ReportDocumentDataRespVO.java | 65 + .../vo/ReportDocumentDataSaveReqVO.java | 43 + ...eportDocumentMainCorrelationPageReqVO.java | 34 + .../ReportDocumentMainCorrelationRespVO.java | 42 + ...eportDocumentMainCorrelationSaveReqVO.java | 28 + .../vo/ReportDocumentMainPageReqVO.java | 91 ++ .../vo/ReportDocumentMainRespVO.java | 116 ++ .../vo/ReportDocumentMainSaveReqVO.java | 101 ++ .../vo/ReportDocumentTypePageReqVO.java | 84 ++ .../vo/ReportDocumentTypeRespVO.java | 99 ++ .../vo/ReportDocumentTypeSaveReqVO.java | 83 ++ .../dal/dataobject/ReportDocumentDataDO.java | 85 ++ .../ReportDocumentMainCorrelationDO.java | 57 + .../dal/dataobject/ReportDocumentMainDO.java | 144 +++ .../dal/dataobject/ReportDocumentTypeDO.java | 116 ++ .../dal/mapper/ReportDocumentDataMapper.java | 29 + .../ReportDocumentMainCorrelationMapper.java | 29 + .../dal/mapper/ReportDocumentMainMapper.java | 55 + .../dal/mapper/ReportDocumentTypeMapper.java | 52 + .../service/DynamicReportDataService.java | 7 + .../service/ReportDocumentDataService.java | 81 ++ .../ReportDocumentDataServiceImpl.java | 555 +++++++++ .../ReportDocumentMainCorrelationService.java | 70 ++ ...ortDocumentMainCorrelationServiceImpl.java | 110 ++ .../service/ReportDocumentMainService.java | 85 ++ .../ReportDocumentMainServiceImpl.java | 409 ++++++ .../service/ReportDocumentTypeService.java | 69 + .../ReportDocumentTypeServiceImpl.java | 143 +++ .../admin/DataCollectionFieldController.java | 1 - .../controller/admin/DataFormController.java | 3 + .../admin/DataTemplateController.java | 160 +++ .../vo/DataCollectionFieldRespVO.java | 2 - .../vo/DataCollectionSaveReqVO.java | 1 - .../controller/vo/DataTemplatePageReqVO.java | 64 + .../controller/vo/DataTemplateRespVO.java | 82 ++ .../controller/vo/DataTemplateSaveReqVO.java | 63 + .../data/dal/dataobject/DataTemplateDO.java | 107 ++ .../data/dal/mapper/DataFormMapper.java | 1 + .../data/dal/mapper/DataTemplateMapper.java | 71 ++ .../common/data/service/DataFormService.java | 3 + .../data/service/DataFormServiceImpl.java | 4 +- .../data/service/DataTemplateService.java | 80 ++ .../data/service/DataTemplateServiceImpl.java | 240 ++++ .../vo/DictionaryBusinessPageReqVO.java | 22 +- .../vo/DictionaryBusinessRespVO.java | 34 +- .../vo/DictionaryBusinessSaveReqVO.java | 21 +- .../dal/dataobject/DictionaryBusinessDO.java | 23 +- .../dal/mapper/DictionaryBusinessMapper.java | 2 + .../service/DictionaryBusinessService.java | 1 + .../DictionaryBusinessServiceImpl.java | 11 + .../module/qms/core/code/CodeGenUtil.java | 2 - .../module/qms/core/code/SequenceUtil.java | 4 +- .../liteflow/parser/QmsXmlFlowELParser.java | 2 +- .../cmp/AllowanceCalculatorComponent.java | 136 ++ .../config/QlExpressRuleEngineConfig.java | 19 + .../function/RoundToScaleHalfEven.java | 25 + .../core/qlexpress/function/package-info.java | 4 + .../qms/core/sampleflow/SampleFlowNode.java | 15 +- .../config/DataPermissionConfiguration.java | 18 + .../datapermission/package-info.java | 4 + .../qms/framework/gridreport/GridReport.java | 180 +++ .../qms/framework/gridreport/PdfHelper.java | 134 ++ .../gridreport/config/GridReportConfig.java | 27 + .../exception/GridReportException.java | 27 + .../rpc/config/RpcConfiguration.java | 6 +- .../IotConnectManagerStatsController.java | 339 +++++ .../module/qms/iot/mapper/IotHelloMapper.java | 8 + .../qms/iot/service/IIotHelloService.java | 13 + .../IotConnectManagerStatsService.java | 80 ++ .../iot/service/impl/IotHelloServiceImpl.java | 19 + .../qms/iot/tcpserver/IgnorePacket.java | 33 + .../qms/iot/tcpserver/IotDataUtils.java | 144 +++ .../qms/iot/tcpserver/IotDeviceType.java | 50 + .../module/qms/iot/tcpserver/IotPacket.java | 26 + .../iot/tcpserver/IotServerAioListener.java | 109 ++ .../iot/tcpserver/IotServerMsgHandler.java | 137 ++ .../module/qms/iot/tcpserver/IotUtils.java | 76 ++ .../iot/tcpserver/IotWebSocketMsgHandler.java | 147 +++ .../IotCaaClientControlDeviceHander.java | 167 +++ .../caaclient/IotCaaClientRegisterHander.java | 63 + .../caaclient/bean/ControlDevice.java | 40 + .../tcpserver/cluster/InstanceIdProvider.java | 20 + .../cluster/TioServerMessageConfig.java | 16 + .../cluster/TioServerMessagePublisher.java | 33 + .../cluster/TioServerMessageSubscriber.java | 91 ++ .../tcpserver/cluster/TioServerMessageVo.java | 18 + .../IotConsoleClientCheckControlHander.java | 68 + .../IotConsoleClientRegisterHander.java | 94 ++ .../bean/ControlMeasurePoint.java | 36 + .../consoleclient/bean/MeasureData.java | 63 + .../bean/MeasurePointAutoWork.java | 33 + .../consoleclient/bean/Register.java | 33 + .../qms/iot/tcpserver/core/Balance.java | 33 + .../core/ChannelContextConstant.java | 35 + .../iot/tcpserver/core/ChannelStatInfo.java | 169 +++ .../qms/iot/tcpserver/core/ClientData.java | 28 + .../iot/tcpserver/core/ClientRegister.java | 39 + .../qms/iot/tcpserver/core/ClientType.java | 54 + .../qms/iot/tcpserver/core/Command.java | 58 + .../qms/iot/tcpserver/core/EventConstant.java | 40 + .../qms/iot/tcpserver/core/GroupConstant.java | 5 + .../qms/iot/tcpserver/core/Infrared.java | 37 + .../core/IotClientSessionContext.java | 37 + .../core/IotClientSessionForRedisContext.java | 120 ++ .../core/IotDeviceSessionContext.java | 51 + .../core/IotDeviceSessionForRedisContext.java | 123 ++ .../qms/iot/tcpserver/core/IotProtocol.java | 96 ++ .../qms/iot/tcpserver/core/MeasurePoint.java | 29 + .../qms/iot/tcpserver/core/ReplyResult.java | 113 ++ .../qms/iot/tcpserver/core/TrafficLight.java | 30 + .../iot/tcpserver/core/TrafficLightColor.java | 18 + .../core/VehicleRecognitionCamera.java | 41 + .../iot/tcpserver/core/VehicleWeighing.java | 52 + .../qms/iot/tcpserver/core/Weighbridge.java | 33 + .../qms/iot/tcpserver/core/WeightUnit.java | 57 + .../device/BalanceDataCommandLineRunner.java | 127 ++ .../device/RedisSessionComponent.java | 237 ++++ .../handler/IotDeviceBalanceHandler.java | 254 ++++ .../handler/IotDeviceThermometerHandler.java | 71 ++ .../handler/IotDeviceWeighbridgeHandler.java | 24 + .../iot/tcpserver/event/BalanceDataEvent.java | 23 + .../event/HygrothermographEvent.java | 23 + .../event/IotDeviceRegisterEvent.java | 24 + .../tcpserver/event/MeasurePointEvent.java | 24 + .../event/MeasurePointRunLogsEvent.java | 24 + .../tcpserver/handler/IotClientHandler.java | 108 ++ .../iot/tcpserver/handler/IotDataHander.java | 19 + .../tcpserver/handler/IotDeviceHandler.java | 120 ++ .../qms/iot/tcpserver/handler/IotHander.java | 27 + .../handler/IotHeartbeatHandler.java | 36 + .../iot/tcpserver/inf/DecoderFunction.java | 34 + .../listener/BalanceDataListener.java | 46 + .../listener/HygrothermographListener.java | 46 + .../listener/IotDeviceRegisterListener.java | 76 ++ .../qms/iot/tcpserver/pojo/BalanceData.java | 37 + .../iot/tcpserver/pojo/Hygrothermograph.java | 54 + .../pojo/MeasurePointDeviceData.java | 44 + .../tcpserver/pojo/MeasurePointRunLogs.java | 36 + .../pojo/PinusDbMeasurePointRunLogs.java | 28 + .../tcpserver/proxy/ProxyProtocolDecoder.java | 233 ++++ .../tcpserver/proxy/ProxyProtocolMessage.java | 109 ++ .../publisher/BalanceDataPublisher.java | 42 + .../publisher/HygrothermographPublisher.java | 42 + .../publisher/IotDeviceRegisterPublisher.java | 32 + .../MeasurePointDeviceDataPublisher.java | 15 + .../publisher/MeasurePointPublisher.java | 31 + .../MeasurePointRunLogsPublisher.java | 43 + .../iot/tcpserver/utils/ByteBufferUtil.java | 1107 +++++++++++++++++ .../qms/iot/tcpserver/utils/HexUtils.java | 289 +++++ .../com/zt/plat/module/qms/manage/deleteme | 0 .../com/zt/plat/module/qms/office/deleteme | 0 .../admin/DeviceInfomationController.java | 124 ++ .../admin/DeviceProductController.java | 142 +++ .../vo/DeviceInfomationPageReqVO.java | 138 ++ .../controller/vo/DeviceInfomationRespVO.java | 171 +++ .../vo/DeviceInfomationSaveReqVO.java | 128 ++ .../controller/vo/DeviceProductPageReqVO.java | 82 ++ .../controller/vo/DeviceProductRespVO.java | 106 ++ .../controller/vo/DeviceProductSaveReqVO.java | 75 ++ .../dal/dataobject/DeviceInfomationDO.java | 218 ++++ .../dal/dataobject/DeviceProductDO.java | 136 ++ .../dal/mapper/DeviceInfomationMapper.java | 59 + .../dal/mapper/DeviceProductMapper.java | 45 + .../service/DeviceInfomationService.java | 65 + .../service/DeviceInfomationServiceImpl.java | 95 ++ .../device/service/DeviceProductService.java | 79 ++ .../service/DeviceProductServiceImpl.java | 217 ++++ .../admin/MaterialInfomationController.java | 127 ++ .../admin/MaterialProductController.java | 142 +++ .../vo/MaterialInfomationPageReqVO.java | 82 ++ .../vo/MaterialInfomationRespVO.java | 100 ++ .../vo/MaterialInfomationSaveReqVO.java | 69 + .../vo/MaterialProductPageReqVO.java | 98 ++ .../controller/vo/MaterialProductRespVO.java | 133 ++ .../vo/MaterialProductSaveReqVO.java | 91 ++ .../dal/dataobject/MaterialInfomationDO.java | 124 ++ .../dal/dataobject/MaterialProductDO.java | 162 +++ .../dal/mapper/MaterialInfomationMapper.java | 44 + .../dal/mapper/MaterialProductMapper.java | 51 + .../service/MaterialInfomationService.java | 65 + .../MaterialInfomationServiceImpl.java | 90 ++ .../service/MaterialProductService.java | 79 ++ .../service/MaterialProductServiceImpl.java | 215 ++++ .../controller/admin/XRFDataController.java | 41 + .../vo/ConfigXRFLineCustomRespVO.java | 67 + .../vo/XRFDeviceSampleProjectReqVO.java | 36 + .../controller/vo/XRFDeviceSampleReqVO.java | 75 ++ .../thirdpartyapi/service/XRFDataService.java | 15 + .../service/XRFDataServiceImpl.java | 254 ++++ .../mapper/BusinessAssayReportDataMapper.xml | 85 ++ .../mapper/BusinessAssayTaskDataMapper.xml | 66 +- .../mapper/BusinessAssayTaskDetailMapper.xml | 6 + .../BusinessQCCoefficientDataMapper.xml | 12 + ...sinessQCCoefficientParameterDataMapper.xml | 12 + .../bus/dal/mapper/BusinessQCDataMapper.xml | 12 + .../mapper/BusinessQCManagementDataMapper.xml | 12 + ...usinessQCManagementParameterDataMapper.xml | 12 + .../BusinessQCManagementProjectDataMapper.xml | 12 + .../mapper/BusinessQCParameterDataMapper.xml | 12 + .../mapper/BusinessQCProjectDataMapper.xml | 12 + ...inessQualityControlSampleProjectMapper.xml | 12 + .../BusinessSampleDispatchDetailMapper.xml | 12 + .../mapper/BusinessSampleDispatchMapper.xml | 12 + ...usinessSampleEntrustRegistrationMapper.xml | 77 ++ .../mapper/BusinessStandardSampleMapper.xml | 12 + .../BusinessStandardSampleProjectMapper.xml | 12 + ...usinessSubParentSampleAssessmentMapper.xml | 118 ++ .../BusinessSubSampleAnalysisGroupMapper.xml | 12 + .../BusinessSubSampleParentRecheckMapper.xml | 12 + .../bus/dal/mapper/BusinessXRFDataMapper.xml | 12 + .../config/dal/mapper/BaseSampleMapper.xml | 2 +- ...nfigAssayMethodProjectAssessmentMapper.xml | 12 + ...figAssayMethodProjectCoefficientMapper.xml | 12 + .../ConfigAssayMethodProjectRangeMapper.xml | 12 + .../dal/mapper/ConfigPermissionMapper.xml | 12 + .../dal/mapper/ConfigQCSampleMethodMapper.xml | 12 + .../ConfigQCSampleMethodParameterMapper.xml | 12 + .../mapper/ConfigQCStandardSampleMapper.xml | 12 + .../config/dal/mapper/ConfigRuleMapper.xml | 12 + .../ConfigSubSampleParentMethodMapper.xml | 12 + .../dal/mapper/ConfigUserSignatureMapper.xml | 12 + .../mapper/ConfigWarehouseLocationMapper.xml | 12 + .../mapper/ConfigXRFConversionRateMapper.xml | 12 + .../config/dal/mapper/ConfigXRFLineMapper.xml | 12 + .../dal/mapper/ConfigXRFProjectMapper.xml | 12 + .../MaterialAssayStandardDetailMapper.xml | 5 +- ...rialAssayStandardForecastProjectMapper.xml | 12 + .../mapper/MaterialAssayStandardMapper.xml | 2 +- .../dal/mapper/ReportDocumentDataMapper.xml | 12 + .../ReportDocumentMainCorrelationMapper.xml | 12 + .../dal/mapper/ReportDocumentMainMapper.xml | 12 + .../dal/mapper/ReportDocumentTypeMapper.xml | 80 ++ .../data/dal/mapper/DataTemplateMapper.xml | 12 + .../com/zt/plat/module/qms/manage/deleteme | 0 .../com/zt/plat/module/qms/office/deleteme | 0 .../dal/mapper/DeviceInfomationMapper.xml | 12 + .../data/dal/mapper/DeviceProductMapper.xml | 12 + .../dal/mapper/MaterialInfomationMapper.xml | 12 + .../data/dal/mapper/MaterialProductMapper.xml | 12 + .../resources/{ => 删}/application-dev.yml | 0 .../resources/{ => 删}/application-local.yml | 89 ++ .../main/resources/{ => 删}/application.yml | 0 955 files changed, 51277 insertions(+), 3330 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java create mode 100644 zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsWarehouseLocationConstant.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchAssessmentDataReportingReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchResultDataReportingReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleAndQcProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskBackSampleReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSamplePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifyResultAssessmentReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCParameterDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCProjectDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQualityControlSampleProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDetailDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignManualParam.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignMethodParam.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignSampleParam.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/analysisaudit/SampleAnalysisProjectAssessmentCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignContextInitCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignTypeEnum.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationInfomationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BusinessAssayTaskAnalysisDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeSaveReqVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeRespVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/{ConfigWarehouseLocationInfomationPageReqVO.java => ConfigQCStandardSamplePageReqVO.java} (57%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/{ConfigDocumentTypePageReqVO.java => ConfigRulePageReqVO.java} (50%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignaturePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureSaveReqVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationRespVO.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectRangeDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigPermissionDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCStandardSampleDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigUserSignatureDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationParDO.java rename zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/{ConfigWarehouseLocationInfomationDO.java => ConfigXRFConversionRateDO.java} (62%) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardForecastProjectDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectRangeMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigPermissionMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCStandardSampleMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigUserSignatureMapper.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationInfomationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardForecastProjectMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureServiceImpl.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationService.java delete mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainCorrelationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentTypeDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentDataMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainCorrelationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentTypeMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/DynamicReportDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplatePageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataTemplateDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/package-info.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/GridReport.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/PdfHelper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/config/GridReportConfig.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/exception/GridReportException.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IotConnectManagerStatsService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IgnorePacket.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDataUtils.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDeviceType.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotPacket.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerAioListener.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerMsgHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotWebSocketMsgHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientControlDeviceHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientRegisterHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/bean/ControlDevice.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/InstanceIdProvider.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageConfig.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessagePublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageSubscriber.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageVo.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientCheckControlHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientRegisterHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/ControlMeasurePoint.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasureData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasurePointAutoWork.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/Register.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Balance.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelContextConstant.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelStatInfo.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientRegister.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientType.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Command.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/EventConstant.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/GroupConstant.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Infrared.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionContext.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionForRedisContext.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionContext.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionForRedisContext.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotProtocol.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/MeasurePoint.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ReplyResult.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLight.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLightColor.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleRecognitionCamera.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleWeighing.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Weighbridge.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/WeightUnit.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/BalanceDataCommandLineRunner.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceThermometerHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceWeighbridgeHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/BalanceDataEvent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/HygrothermographEvent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/IotDeviceRegisterEvent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointEvent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointRunLogsEvent.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotClientHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDataHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDeviceHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHander.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHeartbeatHandler.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/inf/DecoderFunction.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/BalanceDataListener.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/HygrothermographListener.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/IotDeviceRegisterListener.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/BalanceData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/Hygrothermograph.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointDeviceData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointRunLogs.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/PinusDbMeasurePointRunLogs.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolDecoder.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolMessage.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/BalanceDataPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/HygrothermographPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/IotDeviceRegisterPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointDeviceDataPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointRunLogsPublisher.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/ByteBufferUtil.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/HexUtils.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/manage/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceProductDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductPageReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductSaveReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialProductDO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/ConfigXRFLineCustomRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleProjectReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataService.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectRangeMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigPermissionMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCStandardSampleMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigUserSignatureMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardForecastProjectMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentDataMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainCorrelationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentTypeMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/manage/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml create mode 100644 zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml rename zt-module-qms/zt-module-qms-server/src/main/resources/{ => 删}/application-dev.yml (100%) rename zt-module-qms/zt-module-qms-server/src/main/resources/{ => 删}/application-local.yml (50%) rename zt-module-qms/zt-module-qms-server/src/main/resources/{ => 删}/application.yml (100%) diff --git a/qms-server/src/main/java/com/zt/plat/qms/QmsServerApplication.java b/qms-server/src/main/java/com/zt/plat/qms/QmsServerApplication.java index e283ad3..d0ea2a0 100644 --- a/qms-server/src/main/java/com/zt/plat/qms/QmsServerApplication.java +++ b/qms-server/src/main/java/com/zt/plat/qms/QmsServerApplication.java @@ -2,6 +2,9 @@ package com.zt.plat.qms; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Import; +import tech.zzjc.tio.starter.TioServerAutoConfiguration; +import tech.zzjc.tio.starter.annotation.EnableTioServerServer; /** * Qms 服务器的启动类 @@ -11,6 +14,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${zt.info.base-package} @SpringBootApplication(scanBasePackages = {"${zt.info.base-package}.qms", "${zt.info.base-package}.module"}, excludeName = {}) +@EnableTioServerServer +@Import(TioServerAutoConfiguration.class) public class QmsServerApplication { public static void main(String[] args) { diff --git a/qms-server/src/main/resources/application-dev.yml b/qms-server/src/main/resources/application-dev.yml index 499327f..f1717d1 100644 --- a/qms-server/src/main/resources/application-dev.yml +++ b/qms-server/src/main/resources/application-dev.yml @@ -105,3 +105,87 @@ justauth: prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 + +--- #################### liteflow相关配置 #################### +liteflow: + #规则文件路径 + rule-source: el_xml:com.zt.plat.module.qms.core.liteflow.parser.QmsXmlFlowELParser + #-----------------以下非必须----------------- + #liteflow是否开启,默认为true + enable: true + #liteflow的banner打印是否开启,默认为true + print-banner: true + #上下文的初始数量槽,默认值为1024,这个值不用刻意配置,这个值会自动扩容 + slot-size: 1024 + #FlowExecutor的execute2Future的线程数,默认为64 + main-executor-works: 64 + #FlowExecutor的execute2Future的自定义线程池Builder,LiteFlow提供了默认的Builder + main-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder + #自定义请求ID的生成类,LiteFlow提供了默认的生成类 + request-id-generator-class: com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator + #全局异步节点线程池大小,默认为64 + global-thread-pool-size: 64 + #全局异步节点线程池队列大小,默认为512 + global-thread-pool-queue-size: 512 + #全局异步节点线程池自定义Builder,LiteFlow提供了默认的线程池Builder + global-thread-pool-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder + #异步线程最长的等待时间(只用于when),默认值为15000 + when-max-wait-time: 15000 + #异步线程最长的等待时间(只用于when),默认值为MILLISECONDS,毫秒 + when-max-wait-time-unit: MILLISECONDS + #每个WHEN是否用单独的线程池 + when-thread-pool-isolate: false + #设置解析模式,一共有三种模式,PARSE_ALL_ON_START | PARSE_ALL_ON_FIRST_EXEC | PARSE_ONE_ON_FIRST_EXEC + parse-mode: PARSE_ONE_ON_FIRST_EXEC + #全局重试次数,默认为0 + retry-count: 0 + #是否支持不同类型的加载方式混用,默认为false + support-multiple-type: false + #全局默认节点执行器 + node-executor-class: com.yomahub.liteflow.flow.executor.DefaultNodeExecutor + #是否打印执行中过程中的日志,默认为true + print-execution-log: true + #是否开启本地文件监听,默认为false + enable-monitor-file: false + #是否开启快速解析模式,默认为false + fast-load: false + #是否开启Node节点实例ID持久化,默认为false + enable-node-instance-id: false + #是否开启虚拟线程(只在JDK21+环境有效),默认为true + enable-virtual-thread: true + #简易监控配置选项 + monitor: + #监控是否开启,默认不开启 + enable-log: false + #监控队列存储大小,默认值为200 + queue-limit: 200 + #监控一开始延迟多少执行,默认值为300000毫秒,也就是5分钟 + delay: 300000 + #监控日志打印每过多少时间执行一次,默认值为300000毫秒,也就是5分钟 + period: 300000 + +zzjc: + druid: + sql-log: true + snowflake: + data-center-id: 30 + tio: + server: + # port + port: 8320 + # 心跳时间 + heartbeat-timeout: 20000 + websocket: + # enable websocket default false + enable: true + # websocket port + port: 8330 + # 集群配置 默认关闭,集群开启需要redis + cluster: + enabled: true + group: true + redis: + mode: single + ip: 172.16.46.63 # 地址 + port: 30379 # 端口 + database: 0 # 数据库索引 \ No newline at end of file diff --git a/qms-server/src/main/resources/application-local.yml b/qms-server/src/main/resources/application-local.yml index 8b1b778..1728ced 100644 --- a/qms-server/src/main/resources/application-local.yml +++ b/qms-server/src/main/resources/application-local.yml @@ -56,6 +56,12 @@ spring: database: 0 # 数据库索引 # password: 123456 # 密码,建议生产环境开启 +--- #################### MQ 消息队列相关配置 #################### + +# rocketmq 配置项,对应 RocketMQProperties 配置类 +rocketmq: + name-server: 172.16.46.63:30876 # RocketMQ Namesrv + xxl: job: admin: @@ -85,6 +91,32 @@ mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl +justauth: + enabled: true + type: + DINGTALK: # 钉钉 + client-id: dingvrnreaje3yqvzhxg + client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI + ignore-check-redirect-uri: true + WECHAT_ENTERPRISE: # 企业微信 + client-id: wwd411c69a39ad2e54 + client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw + agent-id: 1000004 + ignore-check-redirect-uri: true + # noinspection SpringBootApplicationYaml + WECHAT_MINI_PROGRAM: # 微信小程序 + client-id: ${dollar}{wx.miniapp.appid} + client-secret: ${dollar}{wx.miniapp.secret} + ignore-check-redirect-uri: true + ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验 + WECHAT_MP: # 微信公众号 + client-id: ${dollar}{wx.mp.app-id} + client-secret: ${dollar}{wx.mp.secret} + ignore-check-redirect-uri: true + cache: + type: REDIS + prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: + timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 # 芋道配置项,设置当前项目所有自定义的配置 zt: @@ -95,3 +127,87 @@ zt: access-log: # 访问日志的配置项 enable: true + +--- #################### liteflow相关配置 #################### +liteflow: + #规则文件路径 + rule-source: el_xml:com.zt.plat.module.qms.core.liteflow.parser.QmsXmlFlowELParser + #-----------------以下非必须----------------- + #liteflow是否开启,默认为true + enable: true + #liteflow的banner打印是否开启,默认为true + print-banner: true + #上下文的初始数量槽,默认值为1024,这个值不用刻意配置,这个值会自动扩容 + slot-size: 1024 + #FlowExecutor的execute2Future的线程数,默认为64 + main-executor-works: 64 + #FlowExecutor的execute2Future的自定义线程池Builder,LiteFlow提供了默认的Builder + main-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder + #自定义请求ID的生成类,LiteFlow提供了默认的生成类 + request-id-generator-class: com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator + #全局异步节点线程池大小,默认为64 + global-thread-pool-size: 64 + #全局异步节点线程池队列大小,默认为512 + global-thread-pool-queue-size: 512 + #全局异步节点线程池自定义Builder,LiteFlow提供了默认的线程池Builder + global-thread-pool-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder + #异步线程最长的等待时间(只用于when),默认值为15000 + when-max-wait-time: 15000 + #异步线程最长的等待时间(只用于when),默认值为MILLISECONDS,毫秒 + when-max-wait-time-unit: MILLISECONDS + #每个WHEN是否用单独的线程池 + when-thread-pool-isolate: false + #设置解析模式,一共有三种模式,PARSE_ALL_ON_START | PARSE_ALL_ON_FIRST_EXEC | PARSE_ONE_ON_FIRST_EXEC + parse-mode: PARSE_ONE_ON_FIRST_EXEC + #全局重试次数,默认为0 + retry-count: 0 + #是否支持不同类型的加载方式混用,默认为false + support-multiple-type: false + #全局默认节点执行器 + node-executor-class: com.yomahub.liteflow.flow.executor.DefaultNodeExecutor + #是否打印执行中过程中的日志,默认为true + print-execution-log: true + #是否开启本地文件监听,默认为false + enable-monitor-file: false + #是否开启快速解析模式,默认为false + fast-load: false + #是否开启Node节点实例ID持久化,默认为false + enable-node-instance-id: false + #是否开启虚拟线程(只在JDK21+环境有效),默认为true + enable-virtual-thread: true + #简易监控配置选项 + monitor: + #监控是否开启,默认不开启 + enable-log: false + #监控队列存储大小,默认值为200 + queue-limit: 200 + #监控一开始延迟多少执行,默认值为300000毫秒,也就是5分钟 + delay: 300000 + #监控日志打印每过多少时间执行一次,默认值为300000毫秒,也就是5分钟 + period: 300000 + +zzjc: + druid: + sql-log: true + snowflake: + data-center-id: 30 + tio: + server: + # port + port: 8320 + # 心跳时间 + heartbeat-timeout: 20000 + websocket: + # enable websocket default false + enable: true + # websocket port + port: 8330 + # 集群配置 默认关闭,集群开启需要redis + cluster: + enabled: true + group: true + redis: + mode: single + ip: 172.16.46.63 # 地址 + port: 30379 # 端口 + database: 0 # 数据库索引 \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java index 86429d9..0b1af9c 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/ErrorCodeConstants.java @@ -29,6 +29,7 @@ public interface ErrorCodeConstants { ErrorCode DATA_FORM_NOT_EXISTS = new ErrorCode(1_032_001_000, "通用数据不存在"); ErrorCode DATA_FORM_EMPTY_COLLECTION_ID = new ErrorCode(1_032_001_000, "未指定数据集ID"); ErrorCode DICTIONARY_BUSINESS_NOT_EXISTS = new ErrorCode(1_032_001_000, "业务参数字典不存在"); + ErrorCode DATA_TEMPLATE_NOT_EXISTS = new ErrorCode(1_032_001_000, "表单设计器模板不存在"); ErrorCode DICTIONARY_BUSINESS_DATA_MORE_THAN_ONE = new ErrorCode(1_032_001_000, "业务参数字典[数据]key重名,请联系管理员处理!"); ErrorCode DICTIONARY_BUSINESS_CATEGORY_MORE_THAN_ONE = new ErrorCode(1_032_001_000, "业务参数字典[分类]key重名,请联系管理员处理!"); ErrorCode DICTIONARY_BUSINESS_CLASSIFY_DUPLICATE = new ErrorCode(1_032_001_000, "分类名称重复,请重新输入"); @@ -45,6 +46,7 @@ public interface ErrorCodeConstants { ErrorCode CONFIG_STANDARD_SAMPLE_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "标准样检测项目配置不存在"); ErrorCode CONFIG_SUB_SAMPLE_PARENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样配置不存在"); ErrorCode CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与检测方法配置不存在"); + //ErrorCode CONFIG_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与复检配置不存在"); ErrorCode CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样与检测方法配置不存在"); ErrorCode CONFIG_SUB_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样配置不存在"); ErrorCode CONFIG_SAMPLE_REPORT_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品报表关系不存在"); @@ -59,6 +61,10 @@ public interface ErrorCodeConstants { ErrorCode CONFIG_SIMPLE_FLOW_RULE_NOT_EXISTS = new ErrorCode(1_032_050_000, "LiteFlow规则配置不存在"); ErrorCode CONFIG_SIMPLE_FLOW_CODE_NOT_EXISTS = new ErrorCode(1_032_050_000, "LiteFlow脚本配置不存在"); ErrorCode CONFIG_RULE_NOT_EXISTS = new ErrorCode(1_032_050_000, "规则配置不存在"); + + ErrorCode CONFIG_XRF_LINE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光分析线不存在"); + ErrorCode CONFIG_XRF_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光采集检测项目配置不存在"); + ErrorCode CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光数据采集特殊检测项目转换率配置不存在"); ErrorCode BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品大类管理不存在"); ErrorCode MATERIAL_ASSAY_STANDARD_DETAIL_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测标准明细不存在"); @@ -67,6 +73,7 @@ public interface ErrorCodeConstants { ErrorCode MATERIAL_ASSAY_STANDARD_FORECAST_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "物料检测标准来样品位配置不存在"); ErrorCode CONFIG_SAMPLE_HANDOVER_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品交接配置不存在"); + ErrorCode CONFIG_USER_SIGNATURE_NOT_EXISTS = new ErrorCode(1_032_050_000, "手写签名不存在"); //dictionary ErrorCode DICTIONARY_SAMPLE_FLOW_NODE_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品流程节点字典不存在"); @@ -74,6 +81,14 @@ public interface ErrorCodeConstants { ErrorCode DICTIONARY_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目字典不存在"); ErrorCode DICTIONARY_SAMPLE_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品类型字典不存在"); + ErrorCode CONFIG_QC_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "质控样与检测方法配置不存在"); + ErrorCode CONFIG_QC_STANDARD_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "质控与定值样关系不存在"); + ErrorCode CONFIG_QC_SAMPLE_METHOD_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "质控样检测方法参数配置不存在"); + ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在"); + ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误"); + ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在"); + ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查库位数据,或联系管理员处理!"); + /*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/ ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在"); ErrorCode BUSINESS_SAMPLE_ENTRUST_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记样品明细不存在"); @@ -101,11 +116,30 @@ public interface ErrorCodeConstants { ErrorCode BUSINESS_STANDARD_SAMPLE_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "标准样检测项目业务不存在"); ErrorCode BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定数据业务不存在"); + + ErrorCode BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_100_000, "分样复检业务数据不存在"); + + ErrorCode BUSINESS_QC_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样业务不存在"); + ErrorCode BUSINESS_QC_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测项目数据业务不存在"); + ErrorCode BUSINESS_QC_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测参数数据业务不存在"); + + ErrorCode BUSINESS_QC_MANAGEMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控管理样检测任务数据,管理样、标准样不存在"); + ErrorCode BUSINESS_QC_MANAGEMENT_PROJECT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测项目数据业务不存在"); + ErrorCode BUSINESS_QC_MANAGEMENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测参数数据业务不存在"); + ErrorCode BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数任务数据,空白样、标样不存在"); + ErrorCode BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数参数业务不存在"); + + ErrorCode BUSINESS_XRF_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "荧光采集记录不存在"); + //检测报告 ErrorCode REPORT_DOCUMENT_MAIN_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告业务不存在"); ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在"); - ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报告类型配置不存在"); + ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告类型配置不存在"); + ErrorCode REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告主数据关系不存在"); + + ErrorCode BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨不存在"); + ErrorCode BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨明细不存在"); /*=================================resource 资源管理 1_032_150_000 ~ 1_032_199_999 ==================================*/ ErrorCode DEVICE_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备_设备信息不存在"); diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java index 14b7477..16af761 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsBpmConstant.java @@ -7,6 +7,17 @@ public class QmsBpmConstant { * */ public static final String BPM_CALLBACK_BEAN_NAME = "bpmCallbackBean"; + /** + * 流程回调时使用的ActivityId Key + * */ + public static final String BPM_CALLBACK_ACTIVITY_ID = "bpmCallbackActivityId"; + public static final String BPM_FIELD_EXTENSIONS = "bpmFieldExtensions"; + public static final String BPM_FIRST_ACTIVITY_FLAG = "firstActivityFlag"; + public static final String BPM_LAST_ACTIVITY_FLAG = "lastActivityFlag"; + + //驳回标记前缀 + public static final String BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY = "RETURN_FLAG_"; + /** * 流程回调时使用的beanName Key * */ diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java index 3dc7c48..09dc5af 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java @@ -82,7 +82,10 @@ public interface QmsCommonConstant { /** 已完成 **/ String COMPLETED = "completed"; - + + /** 已下架 **/ + String TAKEN_OFF = "taken_off"; + /** 分配任务 **/ String TASK_ASSIGN = "task_assign"; @@ -105,23 +108,56 @@ public interface QmsCommonConstant { String ENTRUST_INSPECTION = "entrust_inspection"; /** 中心收样 **/ - String FLOW_NODE_CENTER_RECEIVE = "flw_zx_receive"; + String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive"; /** 中心送样 **/ - String FLOW_NODE_CENTER_SEND = "flw_zx_send"; + String FLOW_NODE_CENTER_SEND = "flw_center_send"; /** 班组收样 **/ - String FLOW_NODE_TEAM_RECEIVE = "flw_bz_receive"; + String FLOW_NODE_TEAM_RECEIVE = "flw_team_receive"; - /** 样品编密 **/ - String FlOW_NODE_SAMPLE_ENCRYPT = "flw_ypbm"; + /** 样品编密(内部简码) **/ + String FlOW_NODE_SAMPLE_ENCRYPT = "flw_sample_encrypt"; /** 分析收样 **/ - String FLOW_NODE_ANALYSIS_RECEIVE = "flw_fx_receive"; + String FLOW_NODE_ANALYSIS_RECEIVE = "flw_analysis_receive"; /** 分析送样 **/ - String FLOW_NODE_ANALYSIS_SEND = "flw_fx_send"; + String FLOW_NODE_ANALYSIS_SEND = "flw_analysis_send"; /** 班组送样 **/ - String FLOW_NODE_TEAM_SEND = "flw_bz_send"; + String FLOW_NODE_TEAM_SEND = "flw_team_send"; + + /** 样品归库 **/ + String FLOW_SAMPLE_STORAGE = "flw_sample_storage"; + + /** 结束 **/ + String FLOW_NODE_END = "flw_end"; + + /** 单杯 **/ + String ASSAY_TYPE_SINGLE_CUP = "single_cup"; + + /** 双杯 **/ + String ASSAY_TYPE_DOUBLE_CUP = "double_cup"; + + /** 平行 **/ + String ASSAY_TYPE_SINGLE_PARALLEL = "single_parallel"; + + /** 配料 **/ + String ASSAY_PROJECT_USAGE_INGREDIENT = "ingredient"; + + /** 报出 **/ + String ASSAY_PROJECT_USAGE_REPORT = "report"; + + /** 配料和报出 **/ + String ASSAY_PROJECT_USAGE_INGREDIENT_REPORT = "ingredient_report"; + + /** 品质控制 **/ + String ASSAY_PROJECT_USAGE_QUALITY_CONTROL = "quality_control"; + + /** 检验完成状态-完成 **/ + String CHECKED = "checked"; + + /** 检验完成状态-未完成 **/ + String UNCHECKED = "unchecked"; } diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java new file mode 100644 index 0000000..8ea6100 --- /dev/null +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsPermissionConstant.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.enums; + +/** + * 权限模块常量 + */ +public interface QmsPermissionConstant { + //目标权限类型-角色 + String TARGET_TYPE_ROLE = "role"; + + //目标权限类型-用户 + String TARGET_TYPE_USER = "user"; + + //目标权限类型-部门 + String TARGET_TYPE_DEPT = "dept"; + + //目标权限类型-自定义 + String TARGET_TYPE_CUSTOM = "custom"; + + //======================各业务模块权限常量============================= + //报告发起权限 + String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; + +} diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsWarehouseLocationConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsWarehouseLocationConstant.java new file mode 100644 index 0000000..5a16074 --- /dev/null +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsWarehouseLocationConstant.java @@ -0,0 +1,21 @@ +package com.zt.plat.module.qms.enums; + +/** + * 权限模块常量 + */ +public interface QmsWarehouseLocationConstant { + //数据类型 + String DATA_TYPE_LOCATION = "库位"; + + String DATA_TYPE_WAREHOUSE = "仓库"; + + + //仓库分类 + String WAREHOUSE_TYPE_SAMPLE = "样品库"; + String WAREHOUSE_TYPE_MATERIAL = "物料试剂"; + + //样品下架操作方式 + String SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE = "sample"; + String SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION = "warehouseLocation"; + +} diff --git a/zt-module-qms/zt-module-qms-server/pom.xml b/zt-module-qms/zt-module-qms-server/pom.xml index ffde40c..798ba07 100644 --- a/zt-module-qms/zt-module-qms-server/pom.xml +++ b/zt-module-qms/zt-module-qms-server/pom.xml @@ -17,7 +17,7 @@ QMS模块。 - 3.8.3.v20230112-RELEASE + 3.9.1.v20251013-RELEASE @@ -189,11 +189,11 @@ - - - - - + + tech.zzjc.tio + zzjc-tio-spring-boot-starter + ${zzjc.tio.version} + diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java index f96d29a..20e30e1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayParameterDataController.java @@ -1,5 +1,9 @@ package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +14,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -20,9 +23,8 @@ import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; import static com.zt.plat.framework.common.pojo.CommonResult.success; - +import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; @@ -42,14 +44,14 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @PostMapping("/create") @Operation(summary = "创建检测参数数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:create')") public CommonResult createBusinessAssayParameterData(@Valid @RequestBody BusinessAssayParameterDataSaveReqVO createReqVO) { return success(businessAssayParameterDataService.createBusinessAssayParameterData(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测参数数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:update')") public CommonResult updateBusinessAssayParameterData(@Valid @RequestBody BusinessAssayParameterDataSaveReqVO updateReqVO) { businessAssayParameterDataService.updateBusinessAssayParameterData(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @DeleteMapping("/delete") @Operation(summary = "删除检测参数数据业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:delete')") public CommonResult deleteBusinessAssayParameterData(@RequestParam("id") Long id) { businessAssayParameterDataService.deleteBusinessAssayParameterData(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测参数数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:delete')") public CommonResult deleteBusinessAssayParameterDataList(@RequestBody BatchDeleteReqVO req) { businessAssayParameterDataService.deleteBusinessAssayParameterDataListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @GetMapping("/get") @Operation(summary = "获得检测参数数据业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:query')") public CommonResult getBusinessAssayParameterData(@RequestParam("id") Long id) { BusinessAssayParameterDataDO businessAssayParameterData = businessAssayParameterDataService.getBusinessAssayParameterData(id); return success(BeanUtils.toBean(businessAssayParameterData, BusinessAssayParameterDataRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @GetMapping("/page") @Operation(summary = "获得检测参数数据业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:query')") public CommonResult> getBusinessAssayParameterDataPage(@Valid BusinessAssayParameterDataPageReqVO pageReqVO) { PageResult pageResult = businessAssayParameterDataService.getBusinessAssayParameterDataPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessAssayParameterDataRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessAssayParameterDataController implements BusinessControllerM @GetMapping("/export-excel") @Operation(summary = "导出检测参数数据业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-parameter-data:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessAssayParameterDataExcel(@Valid BusinessAssayParameterDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java index 49b0b90..6cb3769 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayProjectDataController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -43,14 +45,14 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @PostMapping("/create") @Operation(summary = "创建检测项目数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:create')") public CommonResult createBusinessAssayProjectData(@Valid @RequestBody BusinessAssayProjectDataSaveReqVO createReqVO) { return success(businessAssayProjectDataService.createBusinessAssayProjectData(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测项目数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:update')") public CommonResult updateBusinessAssayProjectData(@Valid @RequestBody BusinessAssayProjectDataSaveReqVO updateReqVO) { businessAssayProjectDataService.updateBusinessAssayProjectData(updateReqVO); return success(true); @@ -59,7 +61,7 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @DeleteMapping("/delete") @Operation(summary = "删除检测项目数据业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:delete')") public CommonResult deleteBusinessAssayProjectData(@RequestParam("id") Long id) { businessAssayProjectDataService.deleteBusinessAssayProjectData(id); return success(true); @@ -68,7 +70,7 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测项目数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:delete')") public CommonResult deleteBusinessAssayProjectDataList(@RequestBody BatchDeleteReqVO req) { businessAssayProjectDataService.deleteBusinessAssayProjectDataListByIds(req.getIds()); return success(true); @@ -77,7 +79,7 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @GetMapping("/get") @Operation(summary = "获得检测项目数据业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:query')") public CommonResult getBusinessAssayProjectData(@RequestParam("id") Long id) { BusinessAssayProjectDataDO businessAssayProjectData = businessAssayProjectDataService.getBusinessAssayProjectData(id); return success(BeanUtils.toBean(businessAssayProjectData, BusinessAssayProjectDataRespVO.class)); @@ -85,7 +87,7 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得检测项目数据业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:query')") public CommonResult> getBusinessAssayProjectDataPage(@Valid BusinessAssayProjectDataPageReqVO pageReqVO) { PageResult pageResult = businessAssayProjectDataService.getBusinessAssayProjectDataPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessAssayProjectDataRespVO.class)); @@ -93,7 +95,7 @@ public class BusinessAssayProjectDataController implements BusinessControllerMar @GetMapping("/export-excel") @Operation(summary = "导出检测项目数据业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-project-data:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessAssayProjectDataExcel(@Valid BusinessAssayProjectDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java new file mode 100644 index 0000000..3c9a0a2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayReportDataController.java @@ -0,0 +1,117 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测报表数据业务") +@RestController +@RequestMapping("/qms/business-assay-report-data") +@Validated +public class BusinessAssayReportDataController implements BusinessControllerMarker { + + + @Resource + private BusinessAssayReportDataService businessAssayReportDataService; + + @PostMapping("/create") + @Operation(summary = "创建检测报表数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:create')") + public CommonResult createBusinessAssayReportData(@Valid @RequestBody BusinessAssayReportDataSaveReqVO createReqVO) { + return success(businessAssayReportDataService.createBusinessAssayReportData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测报表数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:update')") + public CommonResult updateBusinessAssayReportData(@Valid @RequestBody BusinessAssayReportDataSaveReqVO updateReqVO) { + businessAssayReportDataService.updateBusinessAssayReportData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测报表数据业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:delete')") + public CommonResult deleteBusinessAssayReportData(@RequestParam("id") Long id) { + businessAssayReportDataService.deleteBusinessAssayReportData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测报表数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:delete')") + public CommonResult deleteBusinessAssayReportDataList(@RequestBody BatchDeleteReqVO req) { + businessAssayReportDataService.deleteBusinessAssayReportDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测报表数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:query')") + public CommonResult getBusinessAssayReportData(@RequestParam("id") Long id) { + BusinessAssayReportDataDO businessAssayReportData = businessAssayReportDataService.getBusinessAssayReportData(id); + return success(BeanUtils.toBean(businessAssayReportData, BusinessAssayReportDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测报表数据业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:query')") + public CommonResult> getBusinessAssayReportDataPage(@Valid BusinessAssayReportDataPageReqVO pageReqVO) { + PageResult pageResult = businessAssayReportDataService.getBusinessAssayReportDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessAssayReportDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测报表数据业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-report-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessAssayReportDataExcel(@Valid BusinessAssayReportDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessAssayReportDataService.getBusinessAssayReportDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测报表数据业务.xls", "数据", BusinessAssayReportDataRespVO.class, + BeanUtils.toBean(list, BusinessAssayReportDataRespVO.class)); + } + + @GetMapping("/queryWaitingToAddData") + @Operation(summary = "待编制报表数据查询") + @Parameter(name = "mainId", description = "报告id", required = true, example = "1024") + public CommonResult> queryWaitingToAddData(BusinessAssayReportDataPageReqVO pageReqVO) { + PageResult page = businessAssayReportDataService.queryWaitingDataForReport(pageReqVO); + + return success(BeanUtils.toBean(page, BusinessAssayReportDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java new file mode 100644 index 0000000..17c1b91 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskController.java @@ -0,0 +1,117 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测任务分配业务") +@RestController +@RequestMapping("/qms/business-assay-task") +@Validated +public class BusinessAssayTaskController implements BusinessControllerMarker { + + + @Resource + private BusinessAssayTaskService businessAssayTaskService; + + @PostMapping("/create") + @Operation(summary = "创建检测任务分配业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:create')") + public CommonResult createBusinessAssayTask(@Valid @RequestBody BusinessAssayTaskSaveReqVO createReqVO) { + return success(businessAssayTaskService.createBusinessAssayTask(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测任务分配业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:update')") + public CommonResult updateBusinessAssayTask(@Valid @RequestBody BusinessAssayTaskSaveReqVO updateReqVO) { + businessAssayTaskService.updateBusinessAssayTask(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测任务分配业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:delete')") + public CommonResult deleteBusinessAssayTask(@RequestParam("id") Long id) { + businessAssayTaskService.deleteBusinessAssayTask(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测任务分配业务") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:delete')") + public CommonResult deleteBusinessAssayTaskList(@RequestBody BatchDeleteReqVO req) { + businessAssayTaskService.deleteBusinessAssayTaskListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测任务分配业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:query')") + public CommonResult getBusinessAssayTask(@RequestParam("id") Long id) { + BusinessAssayTaskExtendRespVO businessAssayTask = businessAssayTaskService.getBusinessAssayTask(id); + return success(businessAssayTask); + } + + @GetMapping("/page") + @Operation(summary = "获得检测任务分配业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:query')") + public CommonResult> getBusinessAssayTaskPage(@Valid BusinessAssayTaskPageReqVO pageReqVO) { + PageResult pageResult = businessAssayTaskService.getBusinessAssayTaskPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/list") + @Operation(summary = "获得检测任务分配业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:query')") + public CommonResult> getBusinessAssayTaskList(@Valid BusinessAssayTaskPageReqVO reqVO) { + List listResult = businessAssayTaskService.getBusinessAssayTaskList(reqVO); + return success(listResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测任务分配业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessAssayTaskExcel(@Valid BusinessAssayTaskPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessAssayTaskService.getBusinessAssayTaskPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测任务分配业务.xls", "数据", BusinessAssayTaskRespVO.class, + BeanUtils.toBean(list, BusinessAssayTaskRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java index 50c1237..a14ce69 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDataController.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +42,14 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建子样检测任务业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:create')") public CommonResult createBusinessAssayTaskData(@Valid @RequestBody BusinessAssayTaskDataSaveReqVO createReqVO) { return success(businessAssayTaskDataService.createBusinessAssayTaskData(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样检测任务业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:update')") public CommonResult updateBusinessAssayTaskData(@Valid @RequestBody BusinessAssayTaskDataSaveReqVO updateReqVO) { businessAssayTaskDataService.updateBusinessAssayTaskData(updateReqVO); return success(true); @@ -58,7 +58,7 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除子样检测任务业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:delete')") public CommonResult deleteBusinessAssayTaskData(@RequestParam("id") Long id) { businessAssayTaskDataService.deleteBusinessAssayTaskData(id); return success(true); @@ -67,7 +67,7 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样检测任务业务") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:delete')") public CommonResult deleteBusinessAssayTaskDataList(@RequestBody BatchDeleteReqVO req) { businessAssayTaskDataService.deleteBusinessAssayTaskDataListByIds(req.getIds()); return success(true); @@ -76,7 +76,7 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得子样检测任务业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") public CommonResult getBusinessAssayTaskData(@RequestParam("id") Long id) { BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataService.getBusinessAssayTaskData(id); return success(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataRespVO.class)); @@ -84,15 +84,23 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @GetMapping("/getUnAssayTaskGroupList") @Operation(summary = "获得未指派的子样检测任务业务分组列表") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") - public CommonResult getUnAssayTaskGroupList() { - List> list = businessAssayTaskDataService.getUnAssayTaskGroupList(); + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") + public CommonResult getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + List list = businessAssayTaskDataService.getUnAssayTaskGroupList(reqVO); return success(list); } + @GetMapping("/getUnAuditTaskGroupList") + @Operation(summary = "获得未审核的子样检测任务业务分组列表") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") + public CommonResult getUnAuditTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + List list = businessAssayTaskDataService.getUnAuditTaskGroupList(reqVO); + return success(list); + } + @GetMapping("/list") @Operation(summary = "获得子样检测任务业务列表") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") public CommonResult> getBusinessAssayTaskDataPage(@Valid BusinessAssayTaskDataReqVO reqVO) { List listResult = businessAssayTaskDataService.getBusinessAssayTaskDataList(reqVO); return success(listResult); @@ -100,7 +108,7 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得子样检测任务业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:query')") public CommonResult> getBusinessAssayTaskDataPage(@Valid BusinessAssayTaskDataPageReqVO pageReqVO) { PageResult pageResult = businessAssayTaskDataService.getBusinessAssayTaskDataPage(pageReqVO); return success(pageResult); @@ -108,7 +116,7 @@ public class BusinessAssayTaskDataController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出子样检测任务业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-data:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessAssayTaskDataExcel(@Valid BusinessAssayTaskDataPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java new file mode 100644 index 0000000..7cc9a4f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessAssayTaskDetailController.java @@ -0,0 +1,116 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDetailRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDetailSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskDetailService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测任务分配明细") +@RestController +@RequestMapping("/qms/business-assay-task-detail") +@Validated +public class BusinessAssayTaskDetailController implements BusinessControllerMarker { + + + @Resource + private BusinessAssayTaskDetailService businessAssayTaskDetailService; + + @PostMapping("/create") + @Operation(summary = "创建检测任务分配明细") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:create')") + public CommonResult createBusinessAssayTaskDetail(@Valid @RequestBody BusinessAssayTaskDetailSaveReqVO createReqVO) { + return success(businessAssayTaskDetailService.createBusinessAssayTaskDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测任务分配明细") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:update')") + public CommonResult updateBusinessAssayTaskDetail(@Valid @RequestBody BusinessAssayTaskDetailSaveReqVO updateReqVO) { + businessAssayTaskDetailService.updateBusinessAssayTaskDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测任务分配明细") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:delete')") + public CommonResult deleteBusinessAssayTaskDetail(@RequestParam("id") Long id) { + businessAssayTaskDetailService.deleteBusinessAssayTaskDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测任务分配明细") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:delete')") + public CommonResult deleteBusinessAssayTaskDetailList(@RequestBody BatchDeleteReqVO req) { + businessAssayTaskDetailService.deleteBusinessAssayTaskDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测任务分配明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:query')") + public CommonResult getBusinessAssayTaskDetail(@RequestParam("id") Long id) { + BusinessAssayTaskDetailDO businessAssayTaskDetail = businessAssayTaskDetailService.getBusinessAssayTaskDetail(id); + return success(BeanUtils.toBean(businessAssayTaskDetail, BusinessAssayTaskDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测任务分配明细分页") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:query')") + public CommonResult> getBusinessAssayTaskDetailPage(@Valid BusinessAssayTaskDetailPageReqVO pageReqVO) { + PageResult pageResult = businessAssayTaskDetailService.getBusinessAssayTaskDetailPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/list") + @Operation(summary = "获得检测任务分配明细分页") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:query')") + public CommonResult> getBusinessAssayTaskDetailList(@Valid BusinessAssayTaskDetailReqVO reqVO) { + List resultList = businessAssayTaskDetailService.getBusinessAssayTaskDetailList(reqVO); + return success(resultList); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测任务分配明细 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-assay-task-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessAssayTaskDetailExcel(@Valid BusinessAssayTaskDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessAssayTaskDetailService.getBusinessAssayTaskDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测任务分配明细.xls", "数据", BusinessAssayTaskDetailRespVO.class, + BeanUtils.toBean(list, BusinessAssayTaskDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java index cdd96cd..42afdc8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessBaseSampleController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建主样业务") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:create')") public CommonResult createBusinessBaseSample(@Valid @RequestBody BusinessBaseSampleSaveReqVO createReqVO) { return success(businessBaseSampleService.createBusinessBaseSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新主样业务") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:update')") public CommonResult updateBusinessBaseSample(@Valid @RequestBody BusinessBaseSampleSaveReqVO updateReqVO) { businessBaseSampleService.updateBusinessBaseSample(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除主样业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:delete')") public CommonResult deleteBusinessBaseSample(@RequestParam("id") Long id) { businessBaseSampleService.deleteBusinessBaseSample(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除主样业务") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:delete')") public CommonResult deleteBusinessBaseSampleList(@RequestBody BatchDeleteReqVO req) { businessBaseSampleService.deleteBusinessBaseSampleListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得主样业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:query')") public CommonResult getBusinessBaseSample(@RequestParam("id") Long id) { BusinessBaseSampleDO businessBaseSample = businessBaseSampleService.getBusinessBaseSample(id); return success(BeanUtils.toBean(businessBaseSample, BusinessBaseSampleRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得主样业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:query')") public CommonResult> getBusinessBaseSamplePage(@Valid BusinessBaseSamplePageReqVO pageReqVO) { PageResult pageResult = businessBaseSampleService.getBusinessBaseSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessBaseSampleRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessBaseSampleController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出主样业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-base-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-base-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessBaseSampleExcel(@Valid BusinessBaseSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java index 0ce1d85..28908e0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessHandoverRecordSubController.java @@ -1,5 +1,9 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +14,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +45,14 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @PostMapping("/create") @Operation(summary = "创建子样交接记录业务") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:create')") public CommonResult createBusinessHandoverRecordSub(@Valid @RequestBody BusinessHandoverRecordSubSaveReqVO createReqVO) { return success(businessHandoverRecordSubService.createBusinessHandoverRecordSub(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样交接记录业务") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:update')") public CommonResult updateBusinessHandoverRecordSub(@Valid @RequestBody BusinessHandoverRecordSubSaveReqVO updateReqVO) { businessHandoverRecordSubService.updateBusinessHandoverRecordSub(updateReqVO); return success(true); @@ -58,7 +61,7 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @DeleteMapping("/delete") @Operation(summary = "删除子样交接记录业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:delete')") public CommonResult deleteBusinessHandoverRecordSub(@RequestParam("id") Long id) { businessHandoverRecordSubService.deleteBusinessHandoverRecordSub(id); return success(true); @@ -67,7 +70,7 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样交接记录业务") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:delete')") public CommonResult deleteBusinessHandoverRecordSubList(@RequestBody BatchDeleteReqVO req) { businessHandoverRecordSubService.deleteBusinessHandoverRecordSubListByIds(req.getIds()); return success(true); @@ -76,7 +79,7 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @GetMapping("/get") @Operation(summary = "获得子样交接记录业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:query')") public CommonResult getBusinessHandoverRecordSub(@RequestParam("id") Long id) { BusinessHandoverRecordSubDO businessHandoverRecordSub = businessHandoverRecordSubService.getBusinessHandoverRecordSub(id); return success(BeanUtils.toBean(businessHandoverRecordSub, BusinessHandoverRecordSubRespVO.class)); @@ -84,7 +87,7 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @GetMapping("/page") @Operation(summary = "获得子样交接记录业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:query')") public CommonResult> getBusinessHandoverRecordSubPage(@Valid BusinessHandoverRecordSubPageReqVO pageReqVO) { PageResult pageResult = businessHandoverRecordSubService.getBusinessHandoverRecordSubPage(pageReqVO); return success(pageResult); @@ -92,7 +95,7 @@ public class BusinessHandoverRecordSubController implements BusinessControllerMa @GetMapping("/export-excel") @Operation(summary = "导出子样交接记录业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-handover-record-sub:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessHandoverRecordSubExcel(@Valid BusinessHandoverRecordSubPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java new file mode 100644 index 0000000..59b1305 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientDataController.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCCoefficientDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测系数任务数据,空白样、标样") +@RestController +@RequestMapping("/qms/business-qc-coefficient-data") +@Validated +public class BusinessQCCoefficientDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCCoefficientDataService businessQCCoefficientDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测系数任务数据,空白样、标样") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:create')") + public CommonResult createBusinessQCCoefficientData(@Valid @RequestBody BusinessQCCoefficientDataSaveReqVO createReqVO) { + return success(businessQCCoefficientDataService.createBusinessQCCoefficientData(createReqVO)); + } + + @PostMapping("/update") + @Operation(summary = "更新质控样检测系数任务数据,空白样、标样") +// @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:update')") + public CommonResult updateBusinessQCCoefficientData(@Valid @RequestBody BusinessQCCoefficientDataSaveReqVO updateReqVO) { + businessQCCoefficientDataService.updateBusinessQCCoefficientData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测系数任务数据,空白样、标样") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:delete')") + public CommonResult deleteBusinessQCCoefficientData(@RequestParam("id") Long id) { + businessQCCoefficientDataService.deleteBusinessQCCoefficientData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测系数任务数据,空白样、标样") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:delete')") + public CommonResult deleteBusinessQCCoefficientDataList(@RequestBody BatchDeleteReqVO req) { + businessQCCoefficientDataService.deleteBusinessQCCoefficientDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测系数任务数据,空白样、标样") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") + public CommonResult getBusinessQCCoefficientData(@RequestParam("id") Long id) { + BusinessQCCoefficientDataDO businessQCCoefficientData = businessQCCoefficientDataService.getBusinessQCCoefficientData(id); + return success(BeanUtils.toBean(businessQCCoefficientData, BusinessQCCoefficientDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); + } + + @GetMapping("/list") + @Operation(summary = "获得质控样检测系数任务数据,空白样、标样分页") +// @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:query')") + public CommonResult> getBusinessQCCoefficientDataPage(@Valid BusinessQCCoefficientDataReqVO reqVO) { + List pageResult = businessQCCoefficientDataService.getBusinessQCCoefficientDataList(reqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测系数任务数据,空白样、标样 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCCoefficientDataExcel(@Valid BusinessQCCoefficientDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCCoefficientDataService.getBusinessQCCoefficientDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测系数任务数据,空白样、标样.xls", "数据", BusinessQCCoefficientDataRespVO.class, + BeanUtils.toBean(list, BusinessQCCoefficientDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java new file mode 100644 index 0000000..6356dd4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCCoefficientParameterDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCCoefficientParameterDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测系数参数业务") +@RestController +@RequestMapping("/qms/business-qc-coefficient-parameter-data") +@Validated +public class BusinessQCCoefficientParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCCoefficientParameterDataService businessQCCoefficientParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测系数参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:create')") + public CommonResult createBusinessQCCoefficientParameterData(@Valid @RequestBody BusinessQCCoefficientParameterDataSaveReqVO createReqVO) { + return success(businessQCCoefficientParameterDataService.createBusinessQCCoefficientParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测系数参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:update')") + public CommonResult updateBusinessQCCoefficientParameterData(@Valid @RequestBody BusinessQCCoefficientParameterDataSaveReqVO updateReqVO) { + businessQCCoefficientParameterDataService.updateBusinessQCCoefficientParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测系数参数业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:delete')") + public CommonResult deleteBusinessQCCoefficientParameterData(@RequestParam("id") Long id) { + businessQCCoefficientParameterDataService.deleteBusinessQCCoefficientParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测系数参数业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:delete')") + public CommonResult deleteBusinessQCCoefficientParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessQCCoefficientParameterDataService.deleteBusinessQCCoefficientParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测系数参数业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:query')") + public CommonResult getBusinessQCCoefficientParameterData(@RequestParam("id") Long id) { + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterData = businessQCCoefficientParameterDataService.getBusinessQCCoefficientParameterData(id); + return success(BeanUtils.toBean(businessQCCoefficientParameterData, BusinessQCCoefficientParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测系数参数业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:query')") + public CommonResult> getBusinessQCCoefficientParameterDataPage(@Valid BusinessQCCoefficientParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCCoefficientParameterDataService.getBusinessQCCoefficientParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCCoefficientParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测系数参数业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-coefficient-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCCoefficientParameterDataExcel(@Valid BusinessQCCoefficientParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCCoefficientParameterDataService.getBusinessQCCoefficientParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测系数参数业务.xls", "数据", BusinessQCCoefficientParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessQCCoefficientParameterDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java new file mode 100644 index 0000000..1829704 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCDataController.java @@ -0,0 +1,113 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样业务") +@RestController +@RequestMapping("/qms/business-qc-data") +@Validated +public class BusinessQCDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCDataService businessQCDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:create')") + public CommonResult createBusinessQCData(@Valid @RequestBody BusinessQCDataSaveReqVO createReqVO) { + return success(businessQCDataService.createBusinessQCData(createReqVO)); + } + + @PostMapping("/update") + @Operation(summary = "更新质控样业务") + //@PreAuthorize("@ss.hasPermission('qms:business-QC-data:update')") + public CommonResult updateBusinessQCData(@Valid @RequestBody BusinessQCDataSaveReqVO updateReqVO) { + businessQCDataService.updateBusinessQCData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:delete')") + public CommonResult deleteBusinessQCData(@RequestParam("id") Long id) { + businessQCDataService.deleteBusinessQCData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:delete')") + public CommonResult deleteBusinessQCDataList(@RequestBody BatchDeleteReqVO req) { + businessQCDataService.deleteBusinessQCDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:query')") + public CommonResult getBusinessQCData(@RequestParam("id") Long id) { + BusinessQCDataDO businessQCData = businessQCDataService.getBusinessQCData(id); + return success(BeanUtils.toBean(businessQCData, BusinessQCDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:query')") + public CommonResult> getBusinessQCDataPage(@Valid BusinessQCDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCDataService.getBusinessQCDataPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/list") + @Operation(summary = "获得质控样业务列表") + public CommonResult> getBusinessQCDataList(BusinessQCDataReqVO reqVO) { + List list = businessQCDataService.getBusinessQCDataList(reqVO); + return success(list); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCDataExcel(@Valid BusinessQCDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCDataService.getBusinessQCDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样业务.xls", "数据", BusinessQCDataRespVO.class, + BeanUtils.toBean(list, BusinessQCDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java new file mode 100644 index 0000000..f3e667e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementDataController.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCManagementDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控管理样检测任务数据,管理样、标准样") +@RestController +@RequestMapping("/qms/business-qc-management-data") +@Validated +public class BusinessQCManagementDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCManagementDataService businessQCManagementDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控管理样检测任务数据,管理样、标准样") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:create')") + public CommonResult createBusinessQCManagementData(@Valid @RequestBody BusinessQCManagementDataSaveReqVO createReqVO) { + return success(businessQCManagementDataService.createBusinessQCManagementData(createReqVO)); + } + + @PostMapping("/update") + @Operation(summary = "更新质控管理样检测任务数据,管理样、标准样") +// @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:update')") + public CommonResult updateBusinessQCManagementData(@Valid @RequestBody BusinessQCManagementDataSaveReqVO updateReqVO) { + businessQCManagementDataService.updateBusinessQCManagementData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控管理样检测任务数据,管理样、标准样") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:delete')") + public CommonResult deleteBusinessQCManagementData(@RequestParam("id") Long id) { + businessQCManagementDataService.deleteBusinessQCManagementData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控管理样检测任务数据,管理样、标准样") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:delete')") + public CommonResult deleteBusinessQCManagementDataList(@RequestBody BatchDeleteReqVO req) { + businessQCManagementDataService.deleteBusinessQCManagementDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") + public CommonResult getBusinessQCManagementData(@RequestParam("id") Long id) { + BusinessQCManagementDataDO businessQCManagementData = businessQCManagementDataService.getBusinessQCManagementData(id); + return success(BeanUtils.toBean(businessQCManagementData, BusinessQCManagementDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") + public CommonResult> getBusinessQCManagementDataPage(@Valid BusinessQCManagementDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + } + + @GetMapping("/list") + @Operation(summary = "获得质控管理样检测任务数据,管理样、标准样列表") +// @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:query')") + public CommonResult> getBusinessQCManagementDataList(@Valid BusinessQCManagementDataReqVO reqVO) { + List pageResult = businessQCManagementDataService.getBusinessQCManagementDataList(reqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCManagementDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控管理样检测任务数据,管理样、标准样 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCManagementDataExcel(@Valid BusinessQCManagementDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCManagementDataService.getBusinessQCManagementDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控管理样检测任务数据,管理样、标准样.xls", "数据", BusinessQCManagementDataRespVO.class, + BeanUtils.toBean(list, BusinessQCManagementDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java new file mode 100644 index 0000000..4eeaf63 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementParameterDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCManagementParameterDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测参数数据业务") +@RestController +@RequestMapping("/qms/business-qc-management-parameter-data") +@Validated +public class BusinessQCManagementParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCManagementParameterDataService businessQCManagementParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:create')") + public CommonResult createBusinessQCManagementParameterData(@Valid @RequestBody BusinessQCManagementParameterDataSaveReqVO createReqVO) { + return success(businessQCManagementParameterDataService.createBusinessQCManagementParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:update')") + public CommonResult updateBusinessQCManagementParameterData(@Valid @RequestBody BusinessQCManagementParameterDataSaveReqVO updateReqVO) { + businessQCManagementParameterDataService.updateBusinessQCManagementParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测参数数据业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:delete')") + public CommonResult deleteBusinessQCManagementParameterData(@RequestParam("id") Long id) { + businessQCManagementParameterDataService.deleteBusinessQCManagementParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:delete')") + public CommonResult deleteBusinessQCManagementParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessQCManagementParameterDataService.deleteBusinessQCManagementParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测参数数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:query')") + public CommonResult getBusinessQCManagementParameterData(@RequestParam("id") Long id) { + BusinessQCManagementParameterDataDO businessQCManagementParameterData = businessQCManagementParameterDataService.getBusinessQCManagementParameterData(id); + return success(BeanUtils.toBean(businessQCManagementParameterData, BusinessQCManagementParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测参数数据业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:query')") + public CommonResult> getBusinessQCManagementParameterDataPage(@Valid BusinessQCManagementParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementParameterDataService.getBusinessQCManagementParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCManagementParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测参数数据业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCManagementParameterDataExcel(@Valid BusinessQCManagementParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCManagementParameterDataService.getBusinessQCManagementParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测参数数据业务.xls", "数据", BusinessQCManagementParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessQCManagementParameterDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java new file mode 100644 index 0000000..cf3ee27 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCManagementProjectDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCManagementProjectDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测项目数据业务") +@RestController +@RequestMapping("/qms/business-qc-management-project-data") +@Validated +public class BusinessQCManagementProjectDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCManagementProjectDataService businessQCManagementProjectDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:create')") + public CommonResult createBusinessQCManagementProjectData(@Valid @RequestBody BusinessQCManagementProjectDataSaveReqVO createReqVO) { + return success(businessQCManagementProjectDataService.createBusinessQCManagementProjectData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:update')") + public CommonResult updateBusinessQCManagementProjectData(@Valid @RequestBody BusinessQCManagementProjectDataSaveReqVO updateReqVO) { + businessQCManagementProjectDataService.updateBusinessQCManagementProjectData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:delete')") + public CommonResult deleteBusinessQCManagementProjectData(@RequestParam("id") Long id) { + businessQCManagementProjectDataService.deleteBusinessQCManagementProjectData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:delete')") + public CommonResult deleteBusinessQCManagementProjectDataList(@RequestBody BatchDeleteReqVO req) { + businessQCManagementProjectDataService.deleteBusinessQCManagementProjectDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:query')") + public CommonResult getBusinessQCManagementProjectData(@RequestParam("id") Long id) { + BusinessQCManagementProjectDataDO businessQCManagementProjectData = businessQCManagementProjectDataService.getBusinessQCManagementProjectData(id); + return success(BeanUtils.toBean(businessQCManagementProjectData, BusinessQCManagementProjectDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测项目数据业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:query')") + public CommonResult> getBusinessQCManagementProjectDataPage(@Valid BusinessQCManagementProjectDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCManagementProjectDataService.getBusinessQCManagementProjectDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCManagementProjectDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测项目数据业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-management-project-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCManagementProjectDataExcel(@Valid BusinessQCManagementProjectDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCManagementProjectDataService.getBusinessQCManagementProjectDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测项目数据业务.xls", "数据", BusinessQCManagementProjectDataRespVO.class, + BeanUtils.toBean(list, BusinessQCManagementProjectDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java new file mode 100644 index 0000000..567dc30 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCParameterDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCParameterDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测参数数据业务") +@RestController +@RequestMapping("/qms/business-qc-parameter-data") +@Validated +public class BusinessQCParameterDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCParameterDataService businessQCParameterDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:create')") + public CommonResult createBusinessQCParameterData(@Valid @RequestBody BusinessQCParameterDataSaveReqVO createReqVO) { + return success(businessQCParameterDataService.createBusinessQCParameterData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:update')") + public CommonResult updateBusinessQCParameterData(@Valid @RequestBody BusinessQCParameterDataSaveReqVO updateReqVO) { + businessQCParameterDataService.updateBusinessQCParameterData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测参数数据业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:delete')") + public CommonResult deleteBusinessQCParameterData(@RequestParam("id") Long id) { + businessQCParameterDataService.deleteBusinessQCParameterData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测参数数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:delete')") + public CommonResult deleteBusinessQCParameterDataList(@RequestBody BatchDeleteReqVO req) { + businessQCParameterDataService.deleteBusinessQCParameterDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测参数数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:query')") + public CommonResult getBusinessQCParameterData(@RequestParam("id") Long id) { + BusinessQCParameterDataDO businessQCParameterData = businessQCParameterDataService.getBusinessQCParameterData(id); + return success(BeanUtils.toBean(businessQCParameterData, BusinessQCParameterDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测参数数据业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:query')") + public CommonResult> getBusinessQCParameterDataPage(@Valid BusinessQCParameterDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCParameterDataService.getBusinessQCParameterDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCParameterDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测参数数据业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-parameter-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCParameterDataExcel(@Valid BusinessQCParameterDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCParameterDataService.getBusinessQCParameterDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测参数数据业务.xls", "数据", BusinessQCParameterDataRespVO.class, + BeanUtils.toBean(list, BusinessQCParameterDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java new file mode 100644 index 0000000..e3e4db3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQCProjectDataController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQCProjectDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测项目数据业务") +@RestController +@RequestMapping("/qms/business-qc-project-data") +@Validated +public class BusinessQCProjectDataController implements BusinessControllerMarker { + + + @Resource + private BusinessQCProjectDataService businessQCProjectDataService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:create')") + public CommonResult createBusinessQCProjectData(@Valid @RequestBody BusinessQCProjectDataSaveReqVO createReqVO) { + return success(businessQCProjectDataService.createBusinessQCProjectData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:update')") + public CommonResult updateBusinessQCProjectData(@Valid @RequestBody BusinessQCProjectDataSaveReqVO updateReqVO) { + businessQCProjectDataService.updateBusinessQCProjectData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:delete')") + public CommonResult deleteBusinessQCProjectData(@RequestParam("id") Long id) { + businessQCProjectDataService.deleteBusinessQCProjectData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测项目数据业务") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:delete')") + public CommonResult deleteBusinessQCProjectDataList(@RequestBody BatchDeleteReqVO req) { + businessQCProjectDataService.deleteBusinessQCProjectDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测项目数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:query')") + public CommonResult getBusinessQCProjectData(@RequestParam("id") Long id) { + BusinessQCProjectDataDO businessQCProjectData = businessQCProjectDataService.getBusinessQCProjectData(id); + return success(BeanUtils.toBean(businessQCProjectData, BusinessQCProjectDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测项目数据业务分页") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:query')") + public CommonResult> getBusinessQCProjectDataPage(@Valid BusinessQCProjectDataPageReqVO pageReqVO) { + PageResult pageResult = businessQCProjectDataService.getBusinessQCProjectDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQCProjectDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测项目数据业务 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-QC-project-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQCProjectDataExcel(@Valid BusinessQCProjectDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQCProjectDataService.getBusinessQCProjectDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测项目数据业务.xls", "数据", BusinessQCProjectDataRespVO.class, + BeanUtils.toBean(list, BusinessQCProjectDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java new file mode 100644 index 0000000..254c548 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessQualityControlSampleProjectController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQualityControlSampleProjectDO; +import com.zt.plat.module.qms.business.bus.service.BusinessQualityControlSampleProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测项目业务") +@RestController +@RequestMapping("/qms/business-quality-control-sample-project") +@Validated +public class BusinessQualityControlSampleProjectController implements BusinessControllerMarker { + + + @Resource + private BusinessQualityControlSampleProjectService businessQualityControlSampleProjectService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:create')") + public CommonResult createBusinessQualityControlSampleProject(@Valid @RequestBody BusinessQualityControlSampleProjectSaveReqVO createReqVO) { + return success(businessQualityControlSampleProjectService.createBusinessQualityControlSampleProject(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:update')") + public CommonResult updateBusinessQualityControlSampleProject(@Valid @RequestBody BusinessQualityControlSampleProjectSaveReqVO updateReqVO) { + businessQualityControlSampleProjectService.updateBusinessQualityControlSampleProject(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测项目业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:delete')") + public CommonResult deleteBusinessQualityControlSampleProject(@RequestParam("id") Long id) { + businessQualityControlSampleProjectService.deleteBusinessQualityControlSampleProject(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:delete')") + public CommonResult deleteBusinessQualityControlSampleProjectList(@RequestBody BatchDeleteReqVO req) { + businessQualityControlSampleProjectService.deleteBusinessQualityControlSampleProjectListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测项目业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:query')") + public CommonResult getBusinessQualityControlSampleProject(@RequestParam("id") Long id) { + BusinessQualityControlSampleProjectDO businessQualityControlSampleProject = businessQualityControlSampleProjectService.getBusinessQualityControlSampleProject(id); + return success(BeanUtils.toBean(businessQualityControlSampleProject, BusinessQualityControlSampleProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测项目业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:query')") + public CommonResult> getBusinessQualityControlSampleProjectPage(@Valid BusinessQualityControlSampleProjectPageReqVO pageReqVO) { + PageResult pageResult = businessQualityControlSampleProjectService.getBusinessQualityControlSampleProjectPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessQualityControlSampleProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测项目业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-quality-control-sample-project:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessQualityControlSampleProjectExcel(@Valid BusinessQualityControlSampleProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessQualityControlSampleProjectService.getBusinessQualityControlSampleProjectPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测项目业务.xls", "数据", BusinessQualityControlSampleProjectRespVO.class, + BeanUtils.toBean(list, BusinessQualityControlSampleProjectRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java index 8917611..5c4c7d0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleAssayResultController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @PostMapping("/create") @Operation(summary = "创建委检登记来样品位") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:create')") public CommonResult createBusinessSampleAssayResult(@Valid @RequestBody BusinessSampleAssayResultSaveReqVO createReqVO) { return success(businessSampleAssayResultService.createBusinessSampleAssayResult(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新委检登记来样品位") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:update')") public CommonResult updateBusinessSampleAssayResult(@Valid @RequestBody BusinessSampleAssayResultSaveReqVO updateReqVO) { businessSampleAssayResultService.updateBusinessSampleAssayResult(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @DeleteMapping("/delete") @Operation(summary = "删除委检登记来样品位") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:delete')") public CommonResult deleteBusinessSampleAssayResult(@RequestParam("id") Long id) { businessSampleAssayResultService.deleteBusinessSampleAssayResult(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除委检登记来样品位") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:delete')") public CommonResult deleteBusinessSampleAssayResultList(@RequestBody BatchDeleteReqVO req) { businessSampleAssayResultService.deleteBusinessSampleAssayResultListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @GetMapping("/get") @Operation(summary = "获得委检登记来样品位") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:query')") public CommonResult getBusinessSampleAssayResult(@RequestParam("id") Long id) { BusinessSampleAssayResultDO businessSampleAssayResult = businessSampleAssayResultService.getBusinessSampleAssayResult(id); return success(BeanUtils.toBean(businessSampleAssayResult, BusinessSampleAssayResultRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @GetMapping("/page") @Operation(summary = "获得委检登记来样品位分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:query')") public CommonResult> getBusinessSampleAssayResultPage(@Valid BusinessSampleAssayResultPageReqVO pageReqVO) { PageResult pageResult = businessSampleAssayResultService.getBusinessSampleAssayResultPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSampleAssayResultRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessSampleAssayResultController implements BusinessControllerMa @GetMapping("/export-excel") @Operation(summary = "导出委检登记来样品位 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-assay-result:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleAssayResultExcel(@Valid BusinessSampleAssayResultPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java new file mode 100644 index 0000000..4625cc5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchController.java @@ -0,0 +1,166 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SUB_SAMPLE_NOT_EXISTS; + +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchService; + +@Tag(name = "管理后台 - 样品调拨") +@RestController +@RequestMapping("/qms/business-sample-dispatch") +@Validated +public class BusinessSampleDispatchController implements BusinessControllerMarker { + + + @Resource private BusinessSampleDispatchService businessSampleDispatchService; + @Resource private BusinessSubSampleService businessSubSampleService; + + @PostMapping("/createTempData") + @Operation(summary = "创建临时数据") + public CommonResult createTempData() { + BusinessSampleDispatchSaveReqVO vo = new BusinessSampleDispatchSaveReqVO(); + vo.setCancelStatus("-1"); + return success(businessSampleDispatchService.createBusinessSampleDispatch(vo)); + } + + @PutMapping("/update") + @Operation(summary = "更新样品调拨") + public CommonResult updateBusinessSampleDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { + updateReqVO.setCancelStatus("0"); + businessSampleDispatchService.updateBusinessSampleDispatch(updateReqVO); + return success(true); + } + + @PutMapping("/addOrRemoveSample") + @Operation(summary = "增加或移除样品") + public CommonResult addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { + businessSampleDispatchService.addOrRemoveSample(updateReqVO); + return success(true); + } + + @PutMapping("/addBySampleCode") + @Operation(summary = "增加或移除样品") + public CommonResult addBySampleCode(HttpServletRequest request) { + String id = request.getParameter("id"); + String sampleCode = request.getParameter("sampleCode"); + BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode); + if(businessSubSampleDO == null) + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!"); + //判断样品状态 + String returnStatus = businessSubSampleDO.getReturnStatus(); + if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!"); + } + String dispatchStatus = businessSubSampleDO.getDispatchStatus(); + if("1".equals(dispatchStatus)){ + return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!"); + } + List sampleIds = new ArrayList<>(); + sampleIds.add(businessSubSampleDO.getId()); + BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO(); + updateReqVO.setId(Long.valueOf(id)); + updateReqVO.setAddSubSampleIds(sampleIds); + businessSampleDispatchService.addOrRemoveSample(updateReqVO); + return success(true); + } + + @PostMapping("/createProcessInstance") + @Operation(summary = "发起流程") + public CommonResult createProcessInstance(@Valid @RequestBody BusinessSampleDispatchSaveReqVO vo) { + return businessSampleDispatchService.createProcessInstance(vo); + } + + @PostMapping("/execDispatch") + @Operation(summary = "执行调拨") + public CommonResult execDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO vo) { + return businessSampleDispatchService.execDispatch(vo); + } + + @PostMapping("/execGiveback") + @Operation(summary = "调拨归还") + public CommonResult execGiveback(@RequestBody JSONObject vo) { + return businessSampleDispatchService.execGiveback(vo); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除样品调拨") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:delete')") + public CommonResult deleteBusinessSampleDispatch(@RequestParam("id") Long id) { + businessSampleDispatchService.deleteBusinessSampleDispatch(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除样品调拨") + @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:delete')") + public CommonResult deleteBusinessSampleDispatchList(@RequestBody BatchDeleteReqVO req) { + businessSampleDispatchService.deleteBusinessSampleDispatchListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得样品调拨") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:query')") + public CommonResult getBusinessSampleDispatch(@RequestParam("id") Long id) { + BusinessSampleDispatchDO businessSampleDispatch = businessSampleDispatchService.getBusinessSampleDispatch(id); + return success(BeanUtils.toBean(businessSampleDispatch, BusinessSampleDispatchRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得样品调拨分页") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:query')") + public CommonResult> getBusinessSampleDispatchPage(@Valid BusinessSampleDispatchPageReqVO pageReqVO) { + PageResult pageResult = businessSampleDispatchService.getBusinessSampleDispatchPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSampleDispatchRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出样品调拨 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSampleDispatchExcel(@Valid BusinessSampleDispatchPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSampleDispatchService.getBusinessSampleDispatchPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "样品调拨.xls", "数据", BusinessSampleDispatchRespVO.class, + BeanUtils.toBean(list, BusinessSampleDispatchRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java new file mode 100644 index 0000000..d70ec9f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleDispatchDetailController.java @@ -0,0 +1,133 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SUB_SAMPLE_NOT_EXISTS; + +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailService; + +@Tag(name = "管理后台 - 样品调拨明细") +@RestController +@RequestMapping("/qms/business-sample-dispatch-detail") +@Validated +public class BusinessSampleDispatchDetailController implements BusinessControllerMarker { + + + @Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService; + @Resource private BusinessSubSampleService businessSubSampleService; + + @GetMapping("/searchBySampleCode") + @Operation(summary = "扫码查询待归还样品") + public CommonResult searchBySampleCode(HttpServletRequest request) { + String sampleCode = request.getParameter("sampleCode"); + if(ObjectUtils.isEmpty(sampleCode)) + return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "请输入样品编号!"); + BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO(); + reqVO.setSampleCode(sampleCode); + reqVO.setBorrowStatus("1"); + reqVO.setGivebackStatus("0"); + + PageResult pageResult = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(reqVO); + if(pageResult.getTotal() == 0) + return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "未查询到此样品!"); + if(pageResult.getList().size() > 1) + return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "样品编号重复,请联系管理员检查数据!"); + BusinessSampleDispatchDetailExtendRespVO businessSampleDispatchDetailExtendRespVO = pageResult.getList().get(0); + return success(businessSampleDispatchDetailExtendRespVO); + } + + @PostMapping("/create") + @Operation(summary = "创建样品调拨明细") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:create')") + public CommonResult createBusinessSampleDispatchDetail(@Valid @RequestBody BusinessSampleDispatchDetailSaveReqVO createReqVO) { + return success(businessSampleDispatchDetailService.createBusinessSampleDispatchDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新样品调拨明细") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:update')") + public CommonResult updateBusinessSampleDispatchDetail(@Valid @RequestBody BusinessSampleDispatchDetailSaveReqVO updateReqVO) { + businessSampleDispatchDetailService.updateBusinessSampleDispatchDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除样品调拨明细") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:delete')") + public CommonResult deleteBusinessSampleDispatchDetail(@RequestParam("id") Long id) { + businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetail(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除样品调拨明细") + @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:delete')") + public CommonResult deleteBusinessSampleDispatchDetailList(@RequestBody BatchDeleteReqVO req) { + businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得样品调拨明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:query')") + public CommonResult getBusinessSampleDispatchDetail(@RequestParam("id") Long id) { + BusinessSampleDispatchDetailDO businessSampleDispatchDetail = businessSampleDispatchDetailService.getBusinessSampleDispatchDetail(id); + return success(BeanUtils.toBean(businessSampleDispatchDetail, BusinessSampleDispatchDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得样品调拨明细分页") +// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:query')") + public CommonResult> getBusinessSampleDispatchDetailPage(@Valid BusinessSampleDispatchDetailPageReqVO pageReqVO) { + PageResult pageResult = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出样品调拨明细 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSampleDispatchDetailExcel(@Valid BusinessSampleDispatchDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "样品调拨明细.xls", "数据", BusinessSampleDispatchDetailRespVO.class, + BeanUtils.toBean(list, BusinessSampleDispatchDetailRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java index 881c5bf..a6d46fd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustDetailController.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +42,14 @@ public class BusinessSampleEntrustDetailController implements BusinessController @PostMapping("/create") @Operation(summary = "创建委检登记样品明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:create')") public CommonResult createBusinessSampleEntrustDetail(@Valid @RequestBody BusinessSampleEntrustDetailSaveReqVO createReqVO) { return success(businessSampleEntrustDetailService.createBusinessSampleEntrustDetail(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新委检登记样品明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:update')") public CommonResult updateBusinessSampleEntrustDetail(@Valid @RequestBody BusinessSampleEntrustDetailSaveReqVO updateReqVO) { businessSampleEntrustDetailService.updateBusinessSampleEntrustDetail(updateReqVO); return success(true); @@ -58,7 +58,7 @@ public class BusinessSampleEntrustDetailController implements BusinessController @DeleteMapping("/delete") @Operation(summary = "删除委检登记样品明细") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:delete')") public CommonResult deleteBusinessSampleEntrustDetail(@RequestParam("id") Long id) { businessSampleEntrustDetailService.deleteBusinessSampleEntrustDetail(id); return success(true); @@ -67,7 +67,7 @@ public class BusinessSampleEntrustDetailController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除委检登记样品明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:delete')") public CommonResult deleteBusinessSampleEntrustDetailList(@RequestBody BatchDeleteReqVO req) { businessSampleEntrustDetailService.deleteBusinessSampleEntrustDetailListByIds(req.getIds()); return success(true); @@ -76,30 +76,37 @@ public class BusinessSampleEntrustDetailController implements BusinessController @GetMapping("/get") @Operation(summary = "获得委检登记样品明细") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:query')") public CommonResult getBusinessSampleEntrustDetail(@RequestParam("id") Long id) { BusinessSampleEntrustDetailDO businessSampleEntrustDetail = businessSampleEntrustDetailService.getBusinessSampleEntrustDetail(id); return success(BeanUtils.toBean(businessSampleEntrustDetail, BusinessSampleEntrustDetailRespVO.class)); } - + + @GetMapping("/list") + @Operation(summary = "获得委检登记样品明细列表") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:query')") + public CommonResult> getBusinessSampleEntrustDetailList(@Valid BusinessSampleEntrustDetailReqVO reqVO) { + List listResult = businessSampleEntrustDetailService.getBusinessSampleEntrustDetailList(reqVO); + return success(listResult); + } @GetMapping("/page") @Operation(summary = "获得委检登记样品明细分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:query')") - public CommonResult> getBusinessSampleEntrustDetailPage(@Valid BusinessSampleEntrustDetailPageReqVO pageReqVO) { - PageResult pageResult = businessSampleEntrustDetailService.getBusinessSampleEntrustDetailPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessSampleEntrustDetailRespVO.class)); + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:query')") + public CommonResult> getBusinessSampleEntrustDetailPage(@Valid BusinessSampleEntrustDetailPageReqVO pageReqVO) { + PageResult pageResult = businessSampleEntrustDetailService.getBusinessSampleEntrustDetailPage(pageReqVO); + return success(pageResult); } @GetMapping("/export-excel") @Operation(summary = "导出委检登记样品明细 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-detail:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleEntrustDetailExcel(@Valid BusinessSampleEntrustDetailPageReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessSampleEntrustDetailService.getBusinessSampleEntrustDetailPage(pageReqVO).getList(); + List list = businessSampleEntrustDetailService.getBusinessSampleEntrustDetailPage(pageReqVO).getList(); // 导出 Excel ExcelUtils.write(response, "委检登记样品明细.xls", "数据", BusinessSampleEntrustDetailRespVO.class, BeanUtils.toBean(list, BusinessSampleEntrustDetailRespVO.class)); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java index 83e3d4a..03c5ef2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustProjectController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @PostMapping("/create") @Operation(summary = "创建委检样品检测项目业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:create')") public CommonResult createBusinessSampleEntrustProject(@Valid @RequestBody BusinessSampleEntrustProjectSaveReqVO createReqVO) { return success(businessSampleEntrustProjectService.createBusinessSampleEntrustProject(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新委检样品检测项目业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:update')") public CommonResult updateBusinessSampleEntrustProject(@Valid @RequestBody BusinessSampleEntrustProjectSaveReqVO updateReqVO) { businessSampleEntrustProjectService.updateBusinessSampleEntrustProject(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @DeleteMapping("/delete") @Operation(summary = "删除委检样品检测项目业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:delete')") public CommonResult deleteBusinessSampleEntrustProject(@RequestParam("id") Long id) { businessSampleEntrustProjectService.deleteBusinessSampleEntrustProject(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除委检样品检测项目业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:delete')") public CommonResult deleteBusinessSampleEntrustProjectList(@RequestBody BatchDeleteReqVO req) { businessSampleEntrustProjectService.deleteBusinessSampleEntrustProjectListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @GetMapping("/get") @Operation(summary = "获得委检样品检测项目业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:query')") public CommonResult getBusinessSampleEntrustProject(@RequestParam("id") Long id) { BusinessSampleEntrustProjectDO businessSampleEntrustProject = businessSampleEntrustProjectService.getBusinessSampleEntrustProject(id); return success(BeanUtils.toBean(businessSampleEntrustProject, BusinessSampleEntrustProjectRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @GetMapping("/page") @Operation(summary = "获得委检样品检测项目业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:query')") public CommonResult> getBusinessSampleEntrustProjectPage(@Valid BusinessSampleEntrustProjectPageReqVO pageReqVO) { PageResult pageResult = businessSampleEntrustProjectService.getBusinessSampleEntrustProjectPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSampleEntrustProjectRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessSampleEntrustProjectController implements BusinessControlle @GetMapping("/export-excel") @Operation(summary = "导出委检样品检测项目业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-project:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleEntrustProjectExcel(@Valid BusinessSampleEntrustProjectPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java index 4a47beb..bfde1bc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleEntrustRegistrationController.java @@ -1,5 +1,9 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +14,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -43,14 +46,14 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @PostMapping("/create") @Operation(summary = "创建委检登记业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:create')") public CommonResult createBusinessSampleEntrustRegistration(@Valid @RequestBody BusinessSampleEntrustRegistrationSaveReqVO createReqVO) { return success(businessSampleEntrustRegistrationService.createBusinessSampleEntrustRegistration(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新委检登记业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:update')") public CommonResult updateBusinessSampleEntrustRegistration(@Valid @RequestBody BusinessSampleEntrustRegistrationSaveReqVO updateReqVO) { businessSampleEntrustRegistrationService.updateBusinessSampleEntrustRegistration(updateReqVO); return success(true); @@ -59,7 +62,7 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @DeleteMapping("/delete") @Operation(summary = "删除委检登记业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:delete')") public CommonResult deleteBusinessSampleEntrustRegistration(@RequestParam("id") Long id) { businessSampleEntrustRegistrationService.deleteBusinessSampleEntrustRegistration(id); return success(true); @@ -68,7 +71,7 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除委检登记业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:delete')") public CommonResult deleteBusinessSampleEntrustRegistrationList(@RequestBody BatchDeleteReqVO req) { businessSampleEntrustRegistrationService.deleteBusinessSampleEntrustRegistrationListByIds(req.getIds()); return success(true); @@ -77,7 +80,7 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @GetMapping("/get") @Operation(summary = "获得委检登记业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:query')") public CommonResult getBusinessSampleEntrustRegistration(@RequestParam("id") Long id) { BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistration = businessSampleEntrustRegistrationService.getBusinessSampleEntrustRegistration(id); return success(BeanUtils.toBean(businessSampleEntrustRegistration, BusinessSampleEntrustRegistrationRespVO.class)); @@ -85,7 +88,7 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @GetMapping("/page") @Operation(summary = "获得委检登记业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:query')") public CommonResult> getBusinessSampleEntrustRegistrationPage(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO) { PageResult pageResult = businessSampleEntrustRegistrationService.getBusinessSampleEntrustRegistrationPage(pageReqVO); return success(pageResult); @@ -93,7 +96,7 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont @GetMapping("/export-excel") @Operation(summary = "导出委检登记业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-entrust-registration:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleEntrustRegistrationExcel(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO, HttpServletResponse response) throws IOException { @@ -104,4 +107,11 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont BeanUtils.toBean(list, BusinessSampleEntrustRegistrationRespVO.class)); } + @GetMapping("/queryWaitingDataForReport") + @Operation(summary = "查询待编制数据") + public CommonResult> queryWaitingDataForReport(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO) { + PageResult result = businessSampleEntrustRegistrationService.queryWaitingDataForReport(pageReqVO); + return success(result); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java index 50bb50c..34e432f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -27,6 +29,7 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.service.BusinessSampleHandoverService; +import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @@ -42,14 +45,14 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke @PostMapping("/create") @Operation(summary = "创建样品交接单业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:create')") public CommonResult createBusinessSampleHandover(@Valid @RequestBody BusinessSampleHandoverSaveReqVO createReqVO) { return success(businessSampleHandoverService.createBusinessSampleHandover(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品交接单业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:update')") public CommonResult updateBusinessSampleHandover(@Valid @RequestBody BusinessSampleHandoverSaveReqVO updateReqVO) { businessSampleHandoverService.updateBusinessSampleHandover(updateReqVO); return success(true); @@ -58,7 +61,7 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke @DeleteMapping("/delete") @Operation(summary = "删除样品交接单业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:delete')") public CommonResult deleteBusinessSampleHandover(@RequestParam("id") Long id) { businessSampleHandoverService.deleteBusinessSampleHandover(id); return success(true); @@ -67,7 +70,7 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品交接单业务") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:delete')") public CommonResult deleteBusinessSampleHandoverList(@RequestBody BatchDeleteReqVO req) { businessSampleHandoverService.deleteBusinessSampleHandoverListByIds(req.getIds()); return success(true); @@ -76,15 +79,23 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke @GetMapping("/get") @Operation(summary = "获得样品交接单业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')") public CommonResult getBusinessSampleHandover(@RequestParam("id") Long id) { BusinessSampleHandoverDO businessSampleHandover = businessSampleHandoverService.getBusinessSampleHandover(id); return success(BeanUtils.toBean(businessSampleHandover, BusinessSampleHandoverRespVO.class)); } + @GetMapping("/reportDetail") + @Operation(summary = "除样品交接详情数据") + public CommonResult reportDetail(@RequestParam("id") Long id) { + JSONObject jsonObject = businessSampleHandoverService.reportDetail(id); + return success(jsonObject); + + } + @GetMapping("/page") @Operation(summary = "获得样品交接单业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')") public CommonResult> getBusinessSampleHandoverPage(@Valid BusinessSampleHandoverPageReqVO pageReqVO) { PageResult pageResult = businessSampleHandoverService.getBusinessSampleHandoverPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSampleHandoverRespVO.class)); @@ -92,7 +103,7 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke @GetMapping("/export-excel") @Operation(summary = "导出样品交接单业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleHandoverExcel(@Valid BusinessSampleHandoverPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java index 69edad6..d95a382 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSampleHandoverDetailController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @PostMapping("/create") @Operation(summary = "创建样品交接明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:create')") public CommonResult createBusinessSampleHandoverDetail(@Valid @RequestBody BusinessSampleHandoverDetailSaveReqVO createReqVO) { return success(businessSampleHandoverDetailService.createBusinessSampleHandoverDetail(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品交接明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:update')") public CommonResult updateBusinessSampleHandoverDetail(@Valid @RequestBody BusinessSampleHandoverDetailSaveReqVO updateReqVO) { businessSampleHandoverDetailService.updateBusinessSampleHandoverDetail(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @DeleteMapping("/delete") @Operation(summary = "删除样品交接明细") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:delete')") public CommonResult deleteBusinessSampleHandoverDetail(@RequestParam("id") Long id) { businessSampleHandoverDetailService.deleteBusinessSampleHandoverDetail(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品交接明细") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:delete')") public CommonResult deleteBusinessSampleHandoverDetailList(@RequestBody BatchDeleteReqVO req) { businessSampleHandoverDetailService.deleteBusinessSampleHandoverDetailListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @GetMapping("/get") @Operation(summary = "获得样品交接明细") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:query')") public CommonResult getBusinessSampleHandoverDetail(@RequestParam("id") Long id) { BusinessSampleHandoverDetailDO businessSampleHandoverDetail = businessSampleHandoverDetailService.getBusinessSampleHandoverDetail(id); return success(BeanUtils.toBean(businessSampleHandoverDetail, BusinessSampleHandoverDetailRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @GetMapping("/page") @Operation(summary = "获得样品交接明细分页") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:query')") public CommonResult> getBusinessSampleHandoverDetailPage(@Valid BusinessSampleHandoverDetailPageReqVO pageReqVO) { PageResult pageResult = businessSampleHandoverDetailService.getBusinessSampleHandoverDetailPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSampleHandoverDetailRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessSampleHandoverDetailController implements BusinessControlle @GetMapping("/export-excel") @Operation(summary = "导出样品交接明细 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sample-handover-detail:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSampleHandoverDetailExcel(@Valid BusinessSampleHandoverDetailPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java new file mode 100644 index 0000000..e0fea37 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleController.java @@ -0,0 +1,117 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleDO; +import com.zt.plat.module.qms.business.bus.service.BusinessStandardSampleService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 标准样业务") +@RestController +@RequestMapping("/qms/business-standard-sample") +@Validated +public class BusinessStandardSampleController implements BusinessControllerMarker { + + + @Resource + private BusinessStandardSampleService businessStandardSampleService; + + @PostMapping("/create") + @Operation(summary = "创建标准样业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:create')") + public CommonResult createBusinessStandardSample(@Valid @RequestBody BusinessStandardSampleSaveReqVO createReqVO) { + return success(businessStandardSampleService.createBusinessStandardSample(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新标准样业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:update')") + public CommonResult updateBusinessStandardSample(@Valid @RequestBody BusinessStandardSampleSaveReqVO updateReqVO) { + businessStandardSampleService.updateBusinessStandardSample(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除标准样业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:delete')") + public CommonResult deleteBusinessStandardSample(@RequestParam("id") Long id) { + businessStandardSampleService.deleteBusinessStandardSample(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除标准样业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:delete')") + public CommonResult deleteBusinessStandardSampleList(@RequestBody BatchDeleteReqVO req) { + businessStandardSampleService.deleteBusinessStandardSampleListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得标准样业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:query')") + public CommonResult getBusinessStandardSample(@RequestParam("id") Long id) { + BusinessStandardSampleDO businessStandardSample = businessStandardSampleService.getBusinessStandardSample(id); + return success(BeanUtils.toBean(businessStandardSample, BusinessStandardSampleRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得标准样业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:query')") + public CommonResult> getBusinessStandardSamplePage(@Valid BusinessStandardSamplePageReqVO pageReqVO) { + PageResult pageResult = businessStandardSampleService.getBusinessStandardSamplePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessStandardSampleRespVO.class)); + } + +// @GetMapping("/getBusinessStandardSampleByConfigQCSampleMethodId") +// public CommonResult getBusinessStandardSampleByConfigQCSampleMethodId(@RequestParam("configQCSampleMethodId") Long configQCSampleMethodId) { +// List list = businessStandardSampleService.getBusinessStandardSampleByConfigQCSampleMethodId(configQCSampleMethodId); +// return success(list); +// } + + @GetMapping("/getBusinessStandardSampleLeafList") + public CommonResult getBusinessStandardSampleLeafList() { + List list = businessStandardSampleService.getBusinessStandardSampleLeafList(); + return success(list); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出标准样业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessStandardSampleExcel(@Valid BusinessStandardSamplePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessStandardSampleService.getBusinessStandardSamplePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "标准样业务.xls", "数据", BusinessStandardSampleRespVO.class, + BeanUtils.toBean(list, BusinessStandardSampleRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java new file mode 100644 index 0000000..2ab8fc3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessStandardSampleProjectController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; +import com.zt.plat.module.qms.business.bus.service.BusinessStandardSampleProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 标准样检测项目业务") +@RestController +@RequestMapping("/qms/business-standard-sample-project") +@Validated +public class BusinessStandardSampleProjectController implements BusinessControllerMarker { + + + @Resource + private BusinessStandardSampleProjectService businessStandardSampleProjectService; + + @PostMapping("/create") + @Operation(summary = "创建标准样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:create')") + public CommonResult createBusinessStandardSampleProject(@Valid @RequestBody BusinessStandardSampleProjectSaveReqVO createReqVO) { + return success(businessStandardSampleProjectService.createBusinessStandardSampleProject(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新标准样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:update')") + public CommonResult updateBusinessStandardSampleProject(@Valid @RequestBody BusinessStandardSampleProjectSaveReqVO updateReqVO) { + businessStandardSampleProjectService.updateBusinessStandardSampleProject(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除标准样检测项目业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:delete')") + public CommonResult deleteBusinessStandardSampleProject(@RequestParam("id") Long id) { + businessStandardSampleProjectService.deleteBusinessStandardSampleProject(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除标准样检测项目业务") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:delete')") + public CommonResult deleteBusinessStandardSampleProjectList(@RequestBody BatchDeleteReqVO req) { + businessStandardSampleProjectService.deleteBusinessStandardSampleProjectListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得标准样检测项目业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:query')") + public CommonResult getBusinessStandardSampleProject(@RequestParam("id") Long id) { + BusinessStandardSampleProjectDO businessStandardSampleProject = businessStandardSampleProjectService.getBusinessStandardSampleProject(id); + return success(BeanUtils.toBean(businessStandardSampleProject, BusinessStandardSampleProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得标准样检测项目业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:query')") + public CommonResult> getBusinessStandardSampleProjectPage(@Valid BusinessStandardSampleProjectPageReqVO pageReqVO) { + PageResult pageResult = businessStandardSampleProjectService.getBusinessStandardSampleProjectPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessStandardSampleProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出标准样检测项目业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-standard-sample-project:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessStandardSampleProjectExcel(@Valid BusinessStandardSampleProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessStandardSampleProjectService.getBusinessStandardSampleProjectPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "标准样检测项目业务.xls", "数据", BusinessStandardSampleProjectRespVO.class, + BeanUtils.toBean(list, BusinessStandardSampleProjectRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java new file mode 100644 index 0000000..3772c1e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleAssessmentController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubParentSampleAssessmentService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 班组判定数据业务") +@RestController +@RequestMapping("/qms/business-sub-parent-sample-assessment") +@Validated +public class BusinessSubParentSampleAssessmentController implements BusinessControllerMarker { + + + @Resource + private BusinessSubParentSampleAssessmentService businessSubParentSampleAssessmentService; + + @PostMapping("/create") + @Operation(summary = "创建班组判定数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:create')") + public CommonResult createBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO createReqVO) { + return success(businessSubParentSampleAssessmentService.createBusinessSubParentSampleAssessment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新班组判定数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:update')") + public CommonResult updateBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO updateReqVO) { + businessSubParentSampleAssessmentService.updateBusinessSubParentSampleAssessment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除班组判定数据业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + public CommonResult deleteBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { + businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessment(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除班组判定数据业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')") + public CommonResult deleteBusinessSubParentSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { + businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessmentListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得班组判定数据业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + public CommonResult getBusinessSubParentSampleAssessment(@RequestParam("id") Long id) { + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessment = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessment(id); + return success(BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得班组判定数据业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')") + public CommonResult> getBusinessSubParentSampleAssessmentPage(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO) { + PageResult pageResult = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessmentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubParentSampleAssessmentRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出班组判定数据业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSubParentSampleAssessmentExcel(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessmentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "班组判定数据业务.xls", "数据", BusinessSubParentSampleAssessmentRespVO.class, + BeanUtils.toBean(list, BusinessSubParentSampleAssessmentRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java index c5a0df9..ebd83b9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubParentSampleController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @PostMapping("/create") @Operation(summary = "创建分样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:create')") public CommonResult createBusinessSubParentSample(@Valid @RequestBody BusinessSubParentSampleSaveReqVO createReqVO) { return success(businessSubParentSampleService.createBusinessSubParentSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新分样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:update')") public CommonResult updateBusinessSubParentSample(@Valid @RequestBody BusinessSubParentSampleSaveReqVO updateReqVO) { businessSubParentSampleService.updateBusinessSubParentSample(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @DeleteMapping("/delete") @Operation(summary = "删除分样业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:delete')") public CommonResult deleteBusinessSubParentSample(@RequestParam("id") Long id) { businessSubParentSampleService.deleteBusinessSubParentSample(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除分样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:delete')") public CommonResult deleteBusinessSubParentSampleList(@RequestBody BatchDeleteReqVO req) { businessSubParentSampleService.deleteBusinessSubParentSampleListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @GetMapping("/get") @Operation(summary = "获得分样业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:query')") public CommonResult getBusinessSubParentSample(@RequestParam("id") Long id) { BusinessSubParentSampleDO businessSubParentSample = businessSubParentSampleService.getBusinessSubParentSample(id); return success(BeanUtils.toBean(businessSubParentSample, BusinessSubParentSampleRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @GetMapping("/page") @Operation(summary = "获得分样业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:query')") public CommonResult> getBusinessSubParentSamplePage(@Valid BusinessSubParentSamplePageReqVO pageReqVO) { PageResult pageResult = businessSubParentSampleService.getBusinessSubParentSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSubParentSampleRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessSubParentSampleController implements BusinessControllerMark @GetMapping("/export-excel") @Operation(summary = "导出分样业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSubParentSampleExcel(@Valid BusinessSubParentSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java new file mode 100644 index 0000000..cb00de5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAnalysisGroupController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleAnalysisGroupService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 子样分析班组业务") +@RestController +@RequestMapping("/qms/business-sub-sample-analysis-group") +@Validated +public class BusinessSubSampleAnalysisGroupController implements BusinessControllerMarker { + + + @Resource + private BusinessSubSampleAnalysisGroupService businessSubSampleAnalysisGroupService; + + @PostMapping("/create") + @Operation(summary = "创建子样分析班组业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:create')") + public CommonResult createBusinessSubSampleAnalysisGroup(@Valid @RequestBody BusinessSubSampleAnalysisGroupSaveReqVO createReqVO) { + return success(businessSubSampleAnalysisGroupService.createBusinessSubSampleAnalysisGroup(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新子样分析班组业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:update')") + public CommonResult updateBusinessSubSampleAnalysisGroup(@Valid @RequestBody BusinessSubSampleAnalysisGroupSaveReqVO updateReqVO) { + businessSubSampleAnalysisGroupService.updateBusinessSubSampleAnalysisGroup(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除子样分析班组业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:delete')") + public CommonResult deleteBusinessSubSampleAnalysisGroup(@RequestParam("id") Long id) { + businessSubSampleAnalysisGroupService.deleteBusinessSubSampleAnalysisGroup(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除子样分析班组业务") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:delete')") + public CommonResult deleteBusinessSubSampleAnalysisGroupList(@RequestBody BatchDeleteReqVO req) { + businessSubSampleAnalysisGroupService.deleteBusinessSubSampleAnalysisGroupListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得子样分析班组业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:query')") + public CommonResult getBusinessSubSampleAnalysisGroup(@RequestParam("id") Long id) { + BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroup = businessSubSampleAnalysisGroupService.getBusinessSubSampleAnalysisGroup(id); + return success(BeanUtils.toBean(businessSubSampleAnalysisGroup, BusinessSubSampleAnalysisGroupRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得子样分析班组业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:query')") + public CommonResult> getBusinessSubSampleAnalysisGroupPage(@Valid BusinessSubSampleAnalysisGroupPageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleAnalysisGroupService.getBusinessSubSampleAnalysisGroupPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubSampleAnalysisGroupRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出子样分析班组业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-analysis-group:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSubSampleAnalysisGroupExcel(@Valid BusinessSubSampleAnalysisGroupPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSubSampleAnalysisGroupService.getBusinessSubSampleAnalysisGroupPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "子样分析班组业务.xls", "数据", BusinessSubSampleAnalysisGroupRespVO.class, + BeanUtils.toBean(list, BusinessSubSampleAnalysisGroupRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java index ade6c6d..78e9696 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleAssessmentController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class BusinessSubSampleAssessmentController implements BusinessController @PostMapping("/create") @Operation(summary = "创建子样判定数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:create')") public CommonResult createBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentSaveReqVO createReqVO) { return success(businessSubSampleAssessmentService.createBusinessSubSampleAssessment(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样判定数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:update')") public CommonResult updateBusinessSubSampleAssessment(@Valid @RequestBody BusinessSubSampleAssessmentSaveReqVO updateReqVO) { businessSubSampleAssessmentService.updateBusinessSubSampleAssessment(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class BusinessSubSampleAssessmentController implements BusinessController @DeleteMapping("/delete") @Operation(summary = "删除子样判定数据业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") public CommonResult deleteBusinessSubSampleAssessment(@RequestParam("id") Long id) { businessSubSampleAssessmentService.deleteBusinessSubSampleAssessment(id); return success(true); @@ -67,7 +69,7 @@ public class BusinessSubSampleAssessmentController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样判定数据业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:delete')") public CommonResult deleteBusinessSubSampleAssessmentList(@RequestBody BatchDeleteReqVO req) { businessSubSampleAssessmentService.deleteBusinessSubSampleAssessmentListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class BusinessSubSampleAssessmentController implements BusinessController @GetMapping("/get") @Operation(summary = "获得子样判定数据业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") public CommonResult getBusinessSubSampleAssessment(@RequestParam("id") Long id) { BusinessSubSampleAssessmentDO businessSubSampleAssessment = businessSubSampleAssessmentService.getBusinessSubSampleAssessment(id); return success(BeanUtils.toBean(businessSubSampleAssessment, BusinessSubSampleAssessmentRespVO.class)); @@ -84,7 +86,7 @@ public class BusinessSubSampleAssessmentController implements BusinessController @GetMapping("/page") @Operation(summary = "获得子样判定数据业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:query')") public CommonResult> getBusinessSubSampleAssessmentPage(@Valid BusinessSubSampleAssessmentPageReqVO pageReqVO) { PageResult pageResult = businessSubSampleAssessmentService.getBusinessSubSampleAssessmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, BusinessSubSampleAssessmentRespVO.class)); @@ -92,7 +94,7 @@ public class BusinessSubSampleAssessmentController implements BusinessController @GetMapping("/export-excel") @Operation(summary = "导出子样判定数据业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-assessment:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSubSampleAssessmentExcel(@Valid BusinessSubSampleAssessmentPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java index 74e0084..2681015 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleController.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.business.bus.controller.admin; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +12,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -26,7 +27,9 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayTaskDataService; import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; @@ -39,17 +42,20 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @Resource private BusinessSubSampleService businessSubSampleService; + + @Resource + private BusinessAssayTaskDataService businessAssayTaskDataService; @PostMapping("/create") @Operation(summary = "创建子样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:create')") public CommonResult createBusinessSubSample(@Valid @RequestBody BusinessSubSampleSaveReqVO createReqVO) { return success(businessSubSampleService.createBusinessSubSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:update')") public CommonResult updateBusinessSubSample(@Valid @RequestBody BusinessSubSampleSaveReqVO updateReqVO) { businessSubSampleService.updateBusinessSubSample(updateReqVO); return success(true); @@ -58,7 +64,7 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除子样业务") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:delete')") public CommonResult deleteBusinessSubSample(@RequestParam("id") Long id) { businessSubSampleService.deleteBusinessSubSample(id); return success(true); @@ -67,7 +73,7 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样业务") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:delete')") public CommonResult deleteBusinessSubSampleList(@RequestBody BatchDeleteReqVO req) { businessSubSampleService.deleteBusinessSubSampleListByIds(req.getIds()); return success(true); @@ -76,15 +82,17 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得子样业务") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") - public CommonResult getBusinessSubSample(@RequestParam("id") Long id) { - BusinessSubSampleDO businessSubSample = businessSubSampleService.getBusinessSubSample(id); - return success(BeanUtils.toBean(businessSubSample, BusinessSubSampleRespVO.class)); + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") + public CommonResult getBusinessSubSample(@RequestParam("id") Long id) { +// BusinessSubSampleDO businessSubSample = businessSubSampleService.getBusinessSubSample(id); +// return success(BeanUtils.toBean(businessSubSample, BusinessSubSampleRespVO.class)); + BusinessSubSampleExtendRespVO result = businessSubSampleService.getBusinessSubSample(id); + return success(result); } @GetMapping("/list") @Operation(summary = "获得子样业务列表") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") public CommonResult getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO) { List listResult = businessSubSampleService.getBusinessSubSampleList(reqVO); return success(listResult); @@ -92,11 +100,34 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得子样业务分页") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") public CommonResult> getBusinessSubSamplePage(@Valid BusinessSubSamplePageReqVO pageReqVO) { PageResult pageResult = businessSubSampleService.getBusinessSubSamplePage(pageReqVO); return success(pageResult); } + + @GetMapping("/page-stock") + @Operation(summary = "查询样品库分页数据") + public CommonResult> pageStock(@Valid BusinessSubSamplePageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleService.getBusinessSubSamplePage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/page-task") + @Operation(summary = "获得子样业务分页") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')") + public CommonResult> getBusinessSubSampleAndTaskPage(@Valid BusinessSubSamplePageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleService.getBusinessSubSamplePage(pageReqVO); + List list = pageResult.getList(); + for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) { + BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); + search.setBusinessSubSampleId(businessSubSampleExtendRespVO.getId()); + search.setIsAssignTasked(QmsCommonConstant.NO); + List businessAssayTaskDataList = businessAssayTaskDataService.getBusinessAssayTaskDataList(search); + businessSubSampleExtendRespVO.setBusinessAssayTaskDataList(businessAssayTaskDataList); + } + return success(pageResult); + } @GetMapping("/getBySampleCodeAndFlowKey") @Operation(summary = "根据样品编号及样品流程节点key获取样品信息") @@ -107,7 +138,7 @@ public class BusinessSubSampleController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出子样业务 Excel") - @PreAuthorize("@ss.hasPermission('qms:business-sub-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportBusinessSubSampleExcel(@Valid BusinessSubSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { @@ -118,4 +149,24 @@ public class BusinessSubSampleController implements BusinessControllerMarker { BeanUtils.toBean(list, BusinessSubSampleRespVO.class)); } + @PostMapping("/execReturnToStock") + @Operation(summary = "样品归库") + public CommonResult execReturnToStock(@Valid @RequestBody BusinessSubSampleSaveReqVO reqVO) { + return success(businessSubSampleService.execReturnToStock(reqVO)); + } + + @PostMapping("/execTakeOff") + @Operation(summary = "样品下架") + public CommonResult execTakeOff(@RequestBody JSONObject reqVO) { + Integer count = businessSubSampleService.execTakeOff(reqVO); + return success(count); + } + + @PostMapping("/execChangeLocation") + @Operation(summary = "库位变更") + public CommonResult execChangeLocation(@RequestBody JSONObject reqVO) { + Integer count = businessSubSampleService.execChangeLocation(reqVO); + return success(count); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java new file mode 100644 index 0000000..a2cd20d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessSubSampleParentRecheckController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleParentRecheckService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 分样复检业务数据") +@RestController +@RequestMapping("/qms/business-sub-sample-parent-recheck") +@Validated +public class BusinessSubSampleParentRecheckController implements BusinessControllerMarker { + + + @Resource + private BusinessSubSampleParentRecheckService businessSubSampleParentRecheckService; + + @PostMapping("/create") + @Operation(summary = "创建分样复检业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:create')") + public CommonResult createBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO createReqVO) { + return success(businessSubSampleParentRecheckService.createBusinessSubSampleParentRecheck(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新分样复检业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:update')") + public CommonResult updateBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO updateReqVO) { + businessSubSampleParentRecheckService.updateBusinessSubSampleParentRecheck(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除分样复检业务数据") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')") + public CommonResult deleteBusinessSubSampleParentRecheck(@RequestParam("id") Long id) { + businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheck(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除分样复检业务数据") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')") + public CommonResult deleteBusinessSubSampleParentRecheckList(@RequestBody BatchDeleteReqVO req) { + businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheckListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得分样复检业务数据") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')") + public CommonResult getBusinessSubSampleParentRecheck(@RequestParam("id") Long id) { + BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheck(id); + return success(BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得分样复检业务数据分页") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')") + public CommonResult> getBusinessSubSampleParentRecheckPage(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO) { + PageResult pageResult = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessSubSampleParentRecheckRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出分样复检业务数据 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessSubSampleParentRecheckExcel(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "分样复检业务数据.xls", "数据", BusinessSubSampleParentRecheckRespVO.class, + BeanUtils.toBean(list, BusinessSubSampleParentRecheckRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java new file mode 100644 index 0000000..31a2c1f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/BusinessXRFDataController.java @@ -0,0 +1,105 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessXRFDataService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 荧光采集记录") +@RestController +@RequestMapping("/qms/business-xrf-data") +@Validated +public class BusinessXRFDataController implements BusinessControllerMarker { + + + @Resource + private BusinessXRFDataService businessXRFDataService; + + @PostMapping("/create") + @Operation(summary = "创建荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:create')") + public CommonResult createBusinessXRFData(@Valid @RequestBody BusinessXRFDataSaveReqVO createReqVO) { + return success(businessXRFDataService.createBusinessXRFData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:update')") + public CommonResult updateBusinessXRFData(@Valid @RequestBody BusinessXRFDataSaveReqVO updateReqVO) { + businessXRFDataService.updateBusinessXRFData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光采集记录") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:delete')") + public CommonResult deleteBusinessXRFData(@RequestParam("id") Long id) { + businessXRFDataService.deleteBusinessXRFData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光采集记录") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:delete')") + public CommonResult deleteBusinessXRFDataList(@RequestBody BatchDeleteReqVO req) { + businessXRFDataService.deleteBusinessXRFDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光采集记录") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:query')") + public CommonResult getBusinessXRFData(@RequestParam("id") Long id) { + BusinessXRFDataDO businessXRFData = businessXRFDataService.getBusinessXRFData(id); + return success(BeanUtils.toBean(businessXRFData, BusinessXRFDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光采集记录分页") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:query')") + public CommonResult> getBusinessXRFDataPage(@Valid BusinessXRFDataPageReqVO pageReqVO) { + PageResult pageResult = businessXRFDataService.getBusinessXRFDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, BusinessXRFDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光采集记录 Excel") + @PreAuthorize("@ss.hasPermission('qms:business-XRF-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportBusinessXRFDataExcel(@Valid BusinessXRFDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = businessXRFDataService.getBusinessXRFDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光采集记录.xls", "数据", BusinessXRFDataRespVO.class, + BeanUtils.toBean(list, BusinessXRFDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java new file mode 100644 index 0000000..5b0c23d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java @@ -0,0 +1,116 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +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.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +/** + * 分析审核 + */ +@Tag(name = "管理后台 - 样品分析") +@RestController +@RequestMapping("/qms/bus/sample/analysis-audit") +@Validated +public class SampleAnalysisAuditController { + + @Resource + private SampleAnalysisAuditService sampleAnalysisAuditService; + + @GetMapping("/crossAuditByTaskId") + public CommonResult crossAuditByTaskId(Long businessAssayTaskId) { + JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId); + return success(result); + } + + /** + * 交叉审核 + * @return + */ + @PostMapping("/crossAudit") + public CommonResult crossAudit(Long businessAssayTaskId, String auditStatus) { + sampleAnalysisAuditService.crossAuditByByTaskId(businessAssayTaskId, auditStatus); + return success("成功"); + } + + @GetMapping("/getSampleResultAssessmentList") + public CommonResult getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus) { + + JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId, assessmentStatus); + + return success(result); + } + + @GetMapping("/getResultAssessment") + public CommonResult getResultAssessment(String assayType, Long sampleId, Long configAssayMethodId) { + JSONObject result = null; + if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(assayType)) {//平行 + result = sampleAnalysisAuditService.getParallelResultAssessment(sampleId, configAssayMethodId); + } else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(assayType)) {//双杯 + result = sampleAnalysisAuditService.getDoubleCupResultAssessment(sampleId, configAssayMethodId); + } + return success(result); + } + + //平行分析结果判定 + @GetMapping("/getParallelResultAssessment") + public CommonResult getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId) { + JSONObject result = sampleAnalysisAuditService.getParallelResultAssessment(businessSubSampleId, configAssayMethodId); + return success(result); + } + + //双杯分析结果判定 + @GetMapping("/getDoubleCupResultAssessment") + public CommonResult getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId) { + JSONObject result = sampleAnalysisAuditService.getDoubleCupResultAssessment(businessSubParentSampleId, configAssayMethodId); + return success(result); + } + + //修改结果判定 + @PostMapping("/modifyResultAssessment") + public CommonResult modifyResultAssessment(@RequestBody ModifyResultAssessmentReqVO reqVO) { + JSONObject result = null; + if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(reqVO.getAssayType())) {//平行 + result = sampleAnalysisAuditService.modifyParallelResultAssessment(reqVO.getSampleId(), reqVO.getConfigAssayMethodId(), reqVO.getSampleAssessmentId(), reqVO.getBusinessAssayProjectDataIds()); + } else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(reqVO.getAssayType())) {//双杯 + + } + return success(result); + } + + //判定数据上报 + @PostMapping("/assessmentDataReporting") + public CommonResult assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) { + sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, configAssayMethodId); + return success("成功"); + } + + @PostMapping("/batchAssessmentDataReporting") + public CommonResult batchAssessmentDataReporting(@RequestBody BatchAssessmentDataReportingReqVO reqVO) { + for (Long businessSubSampleId : reqVO.getBusinessSubSampleIds()) { + sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, reqVO.getConfigAssayMethodId()); + } + return success("成功"); + } + + //重新创建复检委托 + @PostMapping("/createReAnalysis") + public CommonResult createReAnalysis(Long businessSubSampleId, Long configAssayMethodId) { + sampleAnalysisAuditService.createReAnalysis(businessSubSampleId, configAssayMethodId); + return success("成功"); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java new file mode 100644 index 0000000..9fbe165 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisController.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +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.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +/** + * 样品分析 + */ +@Tag(name = "管理后台 - 样品分析") +@RestController +@RequestMapping("/qms/bus/sample/analysis") +@Validated +public class SampleAnalysisController { + + @Resource + private SampleAnalysisService sampleAnalysisService ; + + @GetMapping("/batchSampleAnalysisByTaskId") + public CommonResult batchSampleAnalysisByTaskId(Long businessAssayTaskId) { + BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProject = sampleAnalysisService.batchSampleAnalysisByTaskId(businessAssayTaskId); + return success(businessAssayTaskAnalysisSampleProject); + } + + @PostMapping("/saveBatchSampleAnalysis") + public CommonResult saveBatchSampleAnalysis(@RequestBody BusinessAssayTaskAnalysisSampleProjectRespVO vo) { + sampleAnalysisService.saveBatchSampleAnalysis(vo); + return success("成功"); + } + + @GetMapping("/batchSampleAndQcAnalysisByTaskId") + public CommonResult batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) { + BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProject = sampleAnalysisService.batchSampleAndQcAnalysisByTaskId(businessAssayTaskId); + return success(businessAssayTaskAnalysisSampleAndQcProject); + } + + @PostMapping("/saveBatchSmpleAndQcAnalysis") + public CommonResult saveBatchSmpleAndQcAnalysis(@RequestBody BusinessAssayTaskAnalysisSampleAndQcProjectRespVO vo) { + sampleAnalysisService.saveBatchSmpleAndQcAnalysis(vo); + return success("成功"); + } + + //下发配料 + @PostMapping("/issuedIngredients") + public CommonResult issuedIngredients(Long businessAssayTaskId) { + sampleAnalysisService.issuedIngredients(businessAssayTaskId); + return success("成功"); + } + + @PostMapping("/submitSampleAnalysisByTaskId") + public CommonResult submitSampleAnalysisByTaskId(Long businessAssayTaskId) { + sampleAnalysisService.submitSampleAnalysisByTaskId(businessAssayTaskId); + return success("成功"); + } + + @GetMapping("/getSampleAnalysisDataByTaskDataId") + public CommonResult getSampleAnalysisDataByTaskDataId(Long businessAssayTaskDataId) { + JSONObject json = sampleAnalysisService.getSampleAnalysisDataByTaskDataId(businessAssayTaskDataId); + return success(json); + } + + @PostMapping("/rollbackAnalysisSample") + public CommonResult rollbackAnalysisSample(@RequestBody BusinessAssayTaskBackSampleReqVO req) { + sampleAnalysisService.rollbackAnalysisSample(req); + return success("成功"); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java index 4ad0753..9d02c5b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleEntrustController.java @@ -3,10 +3,8 @@ package com.zt.plat.module.qms.business.bus.controller.admin; import static com.zt.plat.framework.common.pojo.CommonResult.error; import static com.zt.plat.framework.common.pojo.CommonResult.success; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationSubmitReqVO; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -16,16 +14,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.tenant.core.context.TenantContextHolder; import com.zt.plat.module.qms.business.bus.controller.vo.*; -import com.zt.plat.module.qms.business.bus.liteflow.param.SampleEntrustDetail; -import com.zt.plat.module.qms.business.bus.liteflow.param.SampleEntrustDetailProject; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleEntrustParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; import com.zt.plat.module.qms.business.bus.service.SampleEntrustService; @@ -54,7 +49,7 @@ public class SampleEntrustController { if (response.isSuccess()) { return success(response.getContextBean(SampleEntrustContext.class)); } else { - return error(500, response.getMessage()); + return error(1_032_100_000, response.getMessage()); } } @@ -64,6 +59,14 @@ public class SampleEntrustController { BusinessSampleEntrustRegistrationExtendRespVO sampleEntrustRegistration = sampleEntrustService.detail(id); return success(sampleEntrustRegistration); } + + @GetMapping("/reportDetail") + @Operation(summary = "委托单详情数据") + public CommonResult reportDetail(@RequestParam("id") Long id) { + JSONObject jsonObject = sampleEntrustService.reportDetail(id); + return success(jsonObject); + + } @PostMapping("/update") @Operation(summary = "修改委托登记") @@ -72,7 +75,7 @@ public class SampleEntrustController { if (response.isSuccess()) { return success(response.getContextBean(SampleEntrustContext.class)); } else { - return error(500, response.getMessage()); + return error(1_032_100_000, response.getMessage()); } } @@ -103,71 +106,4 @@ public class SampleEntrustController { return success(true); } - @PostMapping("/test") - public CommonResult test() { - - Long tenantId = TenantContextHolder.getRequiredTenantId(); - - SampleEntrustDetail sampleEntrustDetail_1 = new SampleEntrustDetail(); - sampleEntrustDetail_1.setBaseSampleId(1000000000000000001L);//铜精矿(结算样) - sampleEntrustDetail_1.setDictionaryBusinessId(1965289473129664514L); - sampleEntrustDetail_1.setSampleName("铜精矿"); - sampleEntrustDetail_1.setEntrustSampleCode("SRC0001"); - sampleEntrustDetail_1.setEntrustSampleName("来样名称-铜精矿"); - sampleEntrustDetail_1.setSort(1); - sampleEntrustDetail_1.setAssayProject(""); - sampleEntrustDetail_1.setForecastResult(""); - sampleEntrustDetail_1.setRemark(""); - - List sampleEntrustDetailProjectList_1 = new ArrayList<>(); - SampleEntrustDetailProject sampleEntrustDetailProject_1_1 = new SampleEntrustDetailProject(); - sampleEntrustDetailProject_1_1.setMaterialAssayStandardDetailId(1000000000000000001L); - sampleEntrustDetailProject_1_1.setIsEnabled(1); - sampleEntrustDetailProjectList_1.add(sampleEntrustDetailProject_1_1); - sampleEntrustDetail_1.setSampleEntrustDetailProjectList(sampleEntrustDetailProjectList_1); - - SampleEntrustDetail sampleEntrustDetail_2 = new SampleEntrustDetail(); - sampleEntrustDetail_2.setBaseSampleId(1000000000000000001L);//铜精矿(结算样) - sampleEntrustDetail_2.setDictionaryBusinessId(1965289473129664514L); - sampleEntrustDetail_2.setSampleName("铜精矿"); - sampleEntrustDetail_2.setEntrustSampleCode("SRC0002"); - sampleEntrustDetail_2.setEntrustSampleName("来样名称-铜精矿"); - sampleEntrustDetail_2.setSort(2); - sampleEntrustDetail_2.setAssayProject(""); - sampleEntrustDetail_2.setForecastResult(""); - sampleEntrustDetail_2.setRemark(""); - - List sampleEntrustDetailProjectList_2 = new ArrayList<>(); - SampleEntrustDetailProject sampleEntrustDetailProject_2_1 = new SampleEntrustDetailProject(); - sampleEntrustDetailProject_2_1.setMaterialAssayStandardDetailId(1000000000000000001L); - sampleEntrustDetailProject_2_1.setIsEnabled(1); - sampleEntrustDetailProjectList_2.add(sampleEntrustDetailProject_2_1); - sampleEntrustDetail_2.setSampleEntrustDetailProjectList(sampleEntrustDetailProjectList_2); - - List sampleEntrustDetailList = new ArrayList<>(); - sampleEntrustDetailList.add(sampleEntrustDetail_1); - sampleEntrustDetailList.add(sampleEntrustDetail_2); - - - SampleEntrustParam sampleEntrustParam = new SampleEntrustParam(); - sampleEntrustParam.setId(1965960610828763137L); - sampleEntrustParam.setEntrustUnit("西南铜业"); - sampleEntrustParam.setSampleSender("送样人"); - sampleEntrustParam.setConfigEntrustSourceId(1000000000000000001L); - sampleEntrustParam.setSampleSendDate(LocalDateTime.now()); - sampleEntrustParam.setSampleQuantity(2); - sampleEntrustParam.setRemaineSampleRequirement("放弃1"); - sampleEntrustParam.setSampleEntrustDetailList(sampleEntrustDetailList); - - String jsonString = JSON.toJSONString(sampleEntrustParam); - System.out.println(jsonString); - - LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class); - if (response.isSuccess()) { - return success(response.getContextBean(SampleEntrustContext.class)); - } else { - return error(500, response.getMessage()); - } - //return success(FlowBus.getNodeMap()); - } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java index 03f47fd..e1589a8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleFlowController.java @@ -47,4 +47,136 @@ public class SampleFlowController { return success(response.getContextBean(SampleFlowContext.class)); } + @GetMapping("/test") + public CommonResult test() { + + SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition(); + sampleFlowDefinition.setFlowKey("flw_sub_sample_process"); + sampleFlowDefinition.setFlowName("子样样品流转流程"); + List flowNodeList = new ArrayList<>(); + + SampleFlowNode zxr = new SampleFlowNode(); + zxr.setNodeName("中心收样"); + zxr.setNodeKey("flw_center_receive"); + zxr.setSort(3100); + + SampleFlowNode zxs = new SampleFlowNode(); + zxs.setNodeName("中心送样"); + zxs.setNodeKey("flw_center_send"); + zxs.setSort(3200); + + SampleFlowNode bzr = new SampleFlowNode(); + bzr.setNodeName("班组收样"); + bzr.setNodeKey("flw_team_receive"); + bzr.setSort(3300); + + SampleFlowNode ypbm = new SampleFlowNode(); + ypbm.setNodeName("样品编密"); + ypbm.setNodeKey("flw_sample_encrypt"); + ypbm.setSort(3400); + +// SampleFlowNode fxr = new SampleFlowNode(); +// fxr.setNodeName("分析收样"); +// fxr.setNodeKey("flw_analysis_receive"); +// fxr.setSort(3500); +// + SampleFlowNode fx = new SampleFlowNode(); + fx.setNodeName("样品分析"); + fx.setNodeKey("flw_analysis"); + fx.setSort(3550); +// +// SampleFlowNode fxs = new SampleFlowNode(); +// fxs.setNodeName("分析送样"); +// fxs.setNodeKey("flw_analysis_send"); +// fxs.setSort(3600); + + SampleFlowNode bzs = new SampleFlowNode(); + bzs.setNodeName("班组送样"); + bzs.setNodeKey("flw_team_send"); + bzs.setSort(3700); + + SampleFlowNode ypgk = new SampleFlowNode(); + ypgk.setNodeName("样品归库"); + ypgk.setNodeKey("flw_sample_storage"); + ypgk.setSort(3800); + ypgk.setNextFlowNodeList(null); + flowNodeList.add(ypgk); + + + zxr.setNextFlowNodeList(new ArrayList() { + { + add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true)); + } + }); + flowNodeList.add(zxr); + + + zxs.setNextFlowNodeList(new ArrayList<>() {{ + add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true)); + }}); + flowNodeList.add(zxs); + + bzr.setNextFlowNodeList(new ArrayList<>() {{ + add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过 + add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过 + }}); + flowNodeList.add(bzr); + + + ypbm.setNextFlowNodeList(new ArrayList<>() {{ + add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true)); + }}); + flowNodeList.add(ypbm); + + +// fxr.setNextFlowNodeList(new ArrayList<>() {{ +// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true)); +// }}); +// flowNodeList.add(fxr); +// +// +// fxs.setNextFlowNodeList(new ArrayList<>() {{ +// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); +// }}); +// flowNodeList.add(fxs); + + fx.setNextFlowNodeList(new ArrayList<>() {{ + add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完")); + }}); + flowNodeList.add(fx); + + bzs.setNextFlowNodeList(new ArrayList<>() {{ + add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检")); + add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("当前部门数据已全部判断上报")); + add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("当前样品所有分析任务已全部上报完")); + }}); + flowNodeList.add(bzs); + + sampleFlowDefinition.setFlowNodeList(flowNodeList); + + String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition); + + System.out.println(jsonSampleFlowDefinition); + + Long tenantId = TenantContextHolder.getRequiredTenantId(); + + List sampleFlowInfoList = new ArrayList<>(); + sampleFlowInfoList.add(new SampleFlowInfo().setId(1967550576457330690L).setIsWeighing(0)); + + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowParam.setSampleSourceType(2); + sampleFlowParam.setCurrentSampleFlowKey("P3000"); + sampleFlowParam.setSampleFlowInfoList(sampleFlowInfoList); + + + + LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class); + if (response.isSuccess()) { + return success(response.getContextBean(SampleFlowContext.class)); + } else { + return error(1_032_100_000, response.getMessage()); + } + //return success(FlowBus.getNodeMap()); + } + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java new file mode 100644 index 0000000..a12cc29 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleResultReportingController.java @@ -0,0 +1,86 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService; + +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import java.util.List; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + + +/** + * 结果上报 + */ +@Tag(name = "管理后台 - 结果上报") +@RestController +@RequestMapping("/qms/bus/sample/result-reporting") +@Validated +public class SampleResultReportingController { + + @Resource + private SampleResultReportingService sampleResultReportingService; + + //获取未上报的方法 + @GetMapping("/getUnReportMethodGroupList") + public CommonResult getUnReportMethodGroupList() { + List list = sampleResultReportingService.getUnReportMethodGroupList(); + return success(list); + } + + //获取方法对应的样品 + @GetMapping("/getSampleResultReportingList") + public CommonResult getSampleResultReportingList(Long configAssayMethodId) { + JSONObject result = sampleResultReportingService.getSampleResultReportingList(configAssayMethodId); + return success(result); + } + + //获取复检方法 + @GetMapping("/getRecheckAssayMethodList") + public CommonResult getRecheckMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) { + List list = sampleResultReportingService.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId); + return success(list); + } + + //创建复检样 + @PostMapping("/createRecheckSample") + public CommonResult createRecheckSample(@RequestBody RecheckSubSampleParentCreateReqVO reqVO) { + sampleResultReportingService.createRecheckSample(reqVO); + + return success("成功"); + } + + //上报 + @PostMapping("/batchResultDataReporting") + public CommonResult batchResultDataReporting(@RequestBody BatchResultDataReportingReqVO reqVO) { + sampleResultReportingService.batchResultDataReporting(reqVO); + return success("成功"); + } + + //结果单个结果查询 + @GetMapping("/getSingleSampleResultReportingList") + public CommonResult getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId) { + JSONObject result = sampleResultReportingService.getSingleSampleResultReportingList(businessSubParentSampleId, configAssayMethodId); + return success(result); + } + + //修改结果 + @PostMapping("/modifySampleResultReporting") + public CommonResult modifySampleResultReporting(@RequestBody ModifySampleResultReportingReqVO reqVO) { + sampleResultReportingService.modifySampleResultReporting(reqVO); + return success("成功"); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java new file mode 100644 index 0000000..bb028ae --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleTaskAssignController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.controller.admin; + +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.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import java.util.List; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam; +import com.zt.plat.module.qms.business.bus.service.SampleTaskAssignService; +import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; + +@Tag(name = "管理后台 - 样品任务分配") +@RestController +@RequestMapping("/qms/bus/sample/task-assign") +@Validated +public class SampleTaskAssignController { + + @Resource + private SampleTaskAssignService sampleTaskAssignService; + + @Operation(description = "获取分配人员列表") + @GetMapping("/getAssignUserList") + public CommonResult getAssignUserList() { + List list = sampleTaskAssignService.getAssignUserList(); + return success(list); + } + + @GetMapping("/getAssaySampleList") + public CommonResult getAssaySampleList() { + List list = sampleTaskAssignService.getAssaySampleList(); + return success(list); + } + + @GetMapping("/getAssayMethodList") + public CommonResult getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) { + List list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId); + return success(list); + } + + @PostMapping("/changeMethod") + public CommonResult changeMethod(@RequestBody ChangeAssayMethodReqVO req) { + sampleTaskAssignService.changeMethod(req); + return success("成功"); + } + + @PostMapping("/methodAssign") + public CommonResult methodAssign(@RequestBody SampleTaskAssignMethodParam param) { + sampleTaskAssignService.methodAssign(param); + return success("成功"); + } + + @PostMapping("/manualAssign") + public CommonResult manualAssign(@RequestBody SampleTaskAssignManualParam param) { + sampleTaskAssignService.manualAssign(param); + return success("成功"); + } + + @PostMapping("/sampleAssign") + public CommonResult sampleAssign(@RequestBody SampleTaskAssignSampleParam param) { + sampleTaskAssignService.sampleAssign(param); + return success("成功"); + } + + @PostMapping("/removeAssignTaskDetail") + public CommonResult removeAssignTaskDetail(@RequestBody BatchDeleteReqVO req) { + sampleTaskAssignService.removeAssignTaskDetail(req); + return success("成功"); + } + + @PostMapping("/createQcSample") + public CommonResult createQcSample(@RequestBody CreateQcSampleReqVO req) { + sampleTaskAssignService.createQcSample(req); + return success("成功"); + } + + @PostMapping("/deleteQcSample") + public CommonResult deleteQcSample(@RequestBody DeleteQcSampleReqVO req) { + sampleTaskAssignService.deleteQcSample(req); + return success("成功"); + } + + @PostMapping("/submitAssign") + public CommonResult submitAssign(Long id) { + sampleTaskAssignService.submitAssign(id); + return success("成功"); + } + + @PostMapping("/voidAssign") + public CommonResult voidAssign(Long id) { + sampleTaskAssignService.voidAssign(id); + return success("成功"); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchAssessmentDataReportingReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchAssessmentDataReportingReqVO.java new file mode 100644 index 0000000..3fe58b0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchAssessmentDataReportingReqVO.java @@ -0,0 +1,13 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class BatchAssessmentDataReportingReqVO { + + private List businessSubSampleIds; + + private Long configAssayMethodId; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchResultDataReportingReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchResultDataReportingReqVO.java new file mode 100644 index 0000000..c56d948 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchResultDataReportingReqVO.java @@ -0,0 +1,13 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class BatchResultDataReportingReqVO { + + private List businessSubParentSampleIds; + + private Long configAssayMethodId; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java new file mode 100644 index 0000000..5b77329 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * BatchSampleAnalysisColumn + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月22日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月22日 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BatchSampleAnalysisColumnRespVO implements Serializable { + + private static final long serialVersionUID = 4283609584147441164L; + + @Schema(description = "列字索引名称") + private String fieldIndex; + + @Schema(description = "列字段名") + private String field; + + @Schema(description = "标题") + private String title; + + @Schema(description = "列宽度") + private String width; + + @Schema(description = "最小列宽度") + private String minWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位数") + private Integer decimalPosition; + + @Schema(description = "数字间隔") + private Float step; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "参数编号") + private Integer paramNo; + + @Schema(description = "是否允许编辑") + private Boolean isEdit; + + @Schema(description = "单位") + private String unit; + + /** 类型(project:元素,parameter:参数) **/ + @Schema(description = "类型(project:元素,parameter:参数)") + private String type; + + @Schema(description = "填写方式") + private String fillingWay; + + @Schema(description = "参数分组_ID") + private Long groupDictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String groupDictionaryBusinessKey; + + @Schema(description = "参数分组_Name") + private String groupDictionaryBusinessName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataPageReqVO.java index 1357787..62a98ea 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataPageReqVO.java @@ -13,19 +13,19 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayParameterDataPageReqVO extends PageParam { - @Schema(description = "检测项目业务ID", example = "31068") + @Schema(description = "检测项目业务ID", example = "4202") private Long businessAssayProjectDataId; - @Schema(description = "检测方法分析项目参数配置表ID", example = "10849") + @Schema(description = "检测方法分析项目参数配置表ID", example = "9808") private Long configAssayMethodProjectParameterId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "25302") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "22549") private Long dictionaryParameterId; - @Schema(description = "参数值") + @Schema(description = "值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") private String dataType; @Schema(description = "小数位") @@ -34,11 +34,11 @@ public class BusinessAssayParameterDataPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "7696") + @Schema(description = "乐观锁", example = "30975") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java new file mode 100644 index 0000000..37ec882 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测参数数据业务分页 Request VO") +@Data +public class BusinessAssayParameterDataReqVO { + + @Schema(description = "检测项目业务ID", example = "31068") + private Long businessAssayProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", example = "10849") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "25302") + private Long dictionaryParameterId; + + @Schema(description = "参数值") + private String value; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "7696") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataRespVO.java index 0edb4b6..129f89b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataRespVO.java @@ -12,28 +12,28 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessAssayParameterDataRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15246") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4344") @ExcelProperty("ID") private Long id; - @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31068") + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4202") @ExcelProperty("检测项目业务ID") private Long businessAssayProjectDataId; - @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10849") + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9808") @ExcelProperty("检测方法分析项目参数配置表ID") private Long configAssayMethodProjectParameterId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "25302") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "22549") @ExcelProperty("参数ID,字典表【T_DIC_PRM】") private Long dictionaryParameterId; - @Schema(description = "参数值") - @ExcelProperty("参数值") + @Schema(description = "值") + @ExcelProperty("值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") private String dataType; @Schema(description = "小数位") @@ -44,11 +44,11 @@ public class BusinessAssayParameterDataRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "7696") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30975") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataSaveReqVO.java index 25101ef..d7deeaf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayParameterDataSaveReqVO.java @@ -9,37 +9,35 @@ import jakarta.validation.constraints.*; @Data public class BusinessAssayParameterDataSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15246") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4344") private Long id; - @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31068") + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4202") @NotNull(message = "检测项目业务ID不能为空") private Long businessAssayProjectDataId; - @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10849") + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9808") @NotNull(message = "检测方法分析项目参数配置表ID不能为空") private Long configAssayMethodProjectParameterId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "25302") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "22549") @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") private Long dictionaryParameterId; - @Schema(description = "参数值") + @Schema(description = "值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") private String dataType; @Schema(description = "小数位") private Integer decimalPosition; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "7696") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30975") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java new file mode 100644 index 0000000..ce9ac89 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java @@ -0,0 +1,72 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 分析项目与参数 + */ +@Data +public class BusinessAssayProjectAndParameterRespVO implements Serializable { + + private static final long serialVersionUID = 2468650244768205378L; + + /** id主键 **/ + private Long id; + + /** 元素或参数字典id **/ + private Long dicId; + + /** 元素或参数字典key **/ + private String dicKey; + + /** 元素或参数名称 **/ + @Schema(description = "元素或参数名称") + private String name; + + @Schema(description = "元素或参数显示名称") + private String showName; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位数") + private Integer decimalPosition; + + /** 元素或参数单位 **/ + @Schema(description = "元素或参数单位") + private String unit; + + /** 结果值 **/ + @Schema(description = "结果值") + private String value; + + @Schema(description = "是否允许为空") + private Integer isNull; + + /** 计算公式 **/ + @Schema(description = "计算公式") + private String formula; + + /** 元素或参数配置参数编号 **/ + @Schema(description = "元素或参数配置参数编号") + private Integer paramNo; + + /** 类型(project:元素,parameter:参数) **/ + @Schema(description = "类型(project:元素,parameter:参数)") + private String type; + + @Schema(description = "填写方式") + private String fillingWay; + + @Schema(description = "参数分组_ID") + private Long groupDictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String groupDictionaryBusinessKey; + + @Schema(description = "参数分组_Name") + private String groupDictionaryBusinessName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java new file mode 100644 index 0000000..397744f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessAssayProjectDataExtendRespVO extends BusinessAssayProjectDataRespVO { + + @Schema(description = "样品主样ID", example = "23293") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "15024") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "20464") + private Long businessSubSampleId; + + @Schema(description = "任务分配单Id") + private Long businessAssayTaskId; + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "归库编号") + private String sampleReturnCode; + + @Schema(description = "分析人员") + private String assayOperator; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; + + @Schema(description = "单位") + private String dictionaryProjectUnit; + + @Schema(description = "分析次数") + private Integer analysisCount; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataPageReqVO.java index b4be45b..d6041ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataPageReqVO.java @@ -13,19 +13,25 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayProjectDataPageReqVO extends PageParam { - @Schema(description = "检测任务ID", example = "16505") + @Schema(description = "检测任务ID", example = "15606") private Long businessAssayTaskDataId; - @Schema(description = "检测方法分析项目配置ID", example = "15654") + @Schema(description = "检测方法分析项目配置ID", example = "17620") private Long configAssayMethodProjectId; - @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "5352") + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "19038") private Long dictionaryProjectId; + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + @Schema(description = "值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") private String dataType; @Schema(description = "小数位") @@ -34,16 +40,19 @@ public class BusinessAssayProjectDataPageReqVO extends PageParam { @Schema(description = "是否不参与超差判定") private Integer isNotAssessment; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否启用") private Integer isEnabled; - @Schema(description = "乐观锁", example = "30037") + @Schema(description = "乐观锁", example = "30046") private Integer updateCount; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java new file mode 100644 index 0000000..a052df1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java @@ -0,0 +1,68 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测项目数据业务分页 Request VO") +@Data +public class BusinessAssayProjectDataReqVO { + + @Schema(description = "分样子样ID", example = "20464") + private Long businessSubSampleId; + + @Schema(description = "检测方法配置ID", example = "9130") + private Long configAssayMethodId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "检测方法分析项目配置ID", example = "15654") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "5352") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", example = "30037") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataRespVO.java index b973f6f..c3a55c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataRespVO.java @@ -12,28 +12,34 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessAssayProjectDataRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21103") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17927") @ExcelProperty("ID") private Long id; - @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16505") + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15606") @ExcelProperty("检测任务ID") private Long businessAssayTaskDataId; - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15654") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17620") @ExcelProperty("检测方法分析项目配置ID") private Long configAssayMethodProjectId; - @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "5352") + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "19038") @ExcelProperty("检测项目字典ID,字典表【T_DIC_PRJ】") private Long dictionaryProjectId; + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + @Schema(description = "值") @ExcelProperty("值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") private String dataType; @Schema(description = "小数位") @@ -44,11 +50,14 @@ public class BusinessAssayProjectDataRespVO { @ExcelProperty("是否不参与超差判定") private Integer isNotAssessment; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否启用") private Integer isEnabled; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30037") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30046") @ExcelProperty("乐观锁") private Integer updateCount; @@ -56,8 +65,8 @@ public class BusinessAssayProjectDataRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataSaveReqVO.java index 92afa21..191c685 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataSaveReqVO.java @@ -9,26 +9,26 @@ import jakarta.validation.constraints.*; @Data public class BusinessAssayProjectDataSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21103") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17927") private Long id; - @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16505") + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15606") @NotNull(message = "检测任务ID不能为空") private Long businessAssayTaskDataId; - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15654") - @NotEmpty(message = "检测方法分析项目配置ID不能为空") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17620") + @NotNull(message = "检测方法分析项目配置ID不能为空") private Long configAssayMethodProjectId; - @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "5352") + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "19038") @NotNull(message = "检测项目字典ID,字典表【T_DIC_PRJ】不能为空") private Long dictionaryProjectId; @Schema(description = "值") private String value; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") private String dataType; @Schema(description = "小数位") @@ -38,16 +38,17 @@ public class BusinessAssayProjectDataSaveReqVO { @NotNull(message = "是否不参与超差判定不能为空") private Integer isNotAssessment; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否启用不能为空") private Integer isEnabled; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30037") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "30046") private Integer updateCount; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataPageReqVO.java new file mode 100644 index 0000000..a80f63f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataPageReqVO.java @@ -0,0 +1,76 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测报表数据业务分页 Request VO") +@Data +public class BusinessAssayReportDataPageReqVO extends PageParam { + + @Schema(description = "报表类型ID", example = "15805") + private Long configReportTypeId; + + @Schema(description = "报表配置ID", example = "24960") + private Long configSampleReportId; + + @Schema(description = "样品主样ID", example = "30453") + private Long businessBaseSampleId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "数据来源") + private String dataSource; + + @Schema(description = "分析数据") + private String assayData; + + @Schema(description = "是否已全部上报") + private Integer isAllReported; + + @Schema(description = "已上报数据来源") + private String reportedSource; + + @Schema(description = "流程code") + private String reportFlowCode; + + @Schema(description = "报告数据明细id", example = "6437") + private Long documentDataId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "378") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + + //==================扩展字段=========== + + @Schema(description = "id列表") + private List idList; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "主样创建时间范围") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] baseSampleCreateTime; + + @Schema(description = "委托id列表") + private List businessSampleEntrustRegistrationIdList; + + @Schema(description = "报告类型ID", example = "2124") + private Long reportDocumentTypeId; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataRespVO.java new file mode 100644 index 0000000..93cf652 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataRespVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测报表数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessAssayReportDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5943") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15805") + @ExcelProperty("报表类型ID") + private Long configReportTypeId; + + @Schema(description = "报表配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24960") + @ExcelProperty("报表配置ID") + private Long configSampleReportId; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30453") + @ExcelProperty("样品主样ID") + private Long businessBaseSampleId; + + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "数据来源") + private String dataSource; + + @Schema(description = "分析数据") + @ExcelProperty("分析数据") + private String assayData; + + @Schema(description = "是否已全部上报") + private Integer isAllReported; + + @Schema(description = "已上报数据来源") + private String reportedSource; + + @Schema(description = "流程code") + @ExcelProperty("流程code") + private String reportFlowCode; + + @Schema(description = "报告数据明细id", example = "6437") + @ExcelProperty("报告数据明细id") + private Long documentDataId; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "378") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + //=====自定义字段 + @Schema(description = "样品名称") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "样品创建时间") + @ExcelProperty("样品创建时间") + private LocalDateTime baseSampleCreateTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataSaveReqVO.java new file mode 100644 index 0000000..80bcf3e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayReportDataSaveReqVO.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 检测报表数据业务新增/修改 Request VO") +@Data +public class BusinessAssayReportDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5943") + private Long id; + + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15805") + @NotNull(message = "报表类型ID不能为空") + private Long configReportTypeId; + + @Schema(description = "报表配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24960") + @NotNull(message = "报表配置ID不能为空") + private Long configSampleReportId; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30453") + @NotNull(message = "样品主样ID不能为空") + private Long businessBaseSampleId; + + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品编号不能为空") + private String sampleCode; + + @Schema(description = "数据来源") + private String dataSource; + + @Schema(description = "分析数据") + private String assayData; + + @Schema(description = "是否已全部上报") + private Integer isAllReported; + + @Schema(description = "已上报数据来源") + private String reportedSource; + + @Schema(description = "流程code") + private String reportFlowCode; + + @Schema(description = "报告数据明细id", example = "6437") + private Long documentDataId; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "378") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleAndQcProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleAndQcProjectRespVO.java new file mode 100644 index 0000000..8a6c9f8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleAndQcProjectRespVO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.time.LocalDateTime; +import java.util.List; + +import com.zt.plat.module.qms.business.config.controller.vo.*; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 分配任务单 分析样品及质控样品检测项目 + */ +@Data +public class BusinessAssayTaskAnalysisSampleAndQcProjectRespVO { + + /** 分配任务单id **/ + private Long businessAssayTaskId; + + /** 任务分配单编号 **/ + private String businessAssayTasNo; + + /** 任务分配单名称 **/ + private String businessAssayTasName; + + /** 分析人员 **/ + private String assayOperator; + + /** 分析时间 **/ + private LocalDateTime assayTime; + + /** 检测方法id **/ + private Long configAssayMethodId; + + /** 检测方法名称 **/ + private String configAssayMethodName; + + /** 数据集key **/ + private String dataCollectionKey; + + /** 数据集id **/ + private Long dataCollectionId; + + /** 动态表单值 **/ + private String formValue; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + + /** 质量控制分析方法 **/ + //private List configQCSampleMethodList; + + /** 分配任务的分析数据 **/ + private List assayTaskAnalysisDataList; + + /** 检测方法分析项目补正系数 **/ + private List configAssayMethodProjectCoefficientList; + + /** 检测方法范围 **/ + private List configAssayMethodProjectRangeList; + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleProjectRespVO.java new file mode 100644 index 0000000..459ded0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskAnalysisSampleProjectRespVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 分配任务单分析样品项目 + */ +@Data +public class BusinessAssayTaskAnalysisSampleProjectRespVO { + + /** 分配任务单id **/ + private Long businessAssayTaskId; + + /** 任务分配单编号 **/ + private String businessAssayTasNo; + + /** 任务分配单名称 **/ + private String businessAssayTasName; + + /** 分析人员 **/ + private String assayOperator; + + /** 分析时间 **/ + private LocalDateTime assayTime; + + /** 检测方法id **/ + private Long configAssayMethodId; + + /** 检测方法名称 **/ + private String configAssayMethodName; + + /** 数据集key **/ + private String dataCollectionKey; + + /** 数据集id **/ + private Long dataCollectionId; + + /** 动态表单值 **/ + private String formValue; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + /** 分析的列 **/ + private List columns; + + /** 分析的数据 **/ + private List> datas; + + /** 检测方法分析项目补正系数 **/ + private List configAssayMethodProjectCoefficientList; + + /** 检测方法范围 **/ + private List configAssayMethodProjectRangeList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskBackSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskBackSampleReqVO.java new file mode 100644 index 0000000..b6b5446 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskBackSampleReqVO.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class BusinessAssayTaskBackSampleReqVO { + + /** + * 任务明细id + */ + private List idList; + + /** + * 退回描述 + */ + private String backDesc; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java index c1b3258..07d8ee4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java @@ -1,10 +1,18 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataRespVO { + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; /** 分析方法名称 **/ @Schema(description = "分析方法名称") @@ -18,4 +26,7 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp @Schema(description = "分析编号") private String sampleAssayCode; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java new file mode 100644 index 0000000..8a9e48f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataGroupRespVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessAssayTaskDataGroupRespVO { + + private Long configAssayMethodId; + + private String configAssayMethodName; + + private String assayType; + + private Integer sampleTaskCount; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java index 7cebfd7..f635d7a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataPageReqVO.java @@ -13,36 +13,45 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayTaskDataPageReqVO extends PageParam { - @Schema(description = "样品主样ID", example = "11587") + @Schema(description = "样品主样ID", example = "23293") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", example = "2157") + @Schema(description = "样品分样ID", example = "15024") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", example = "2427") + @Schema(description = "分样子样ID", example = "20464") private Long businessSubSampleId; - @Schema(description = "检测方法ID", example = "21835") + @Schema(description = "检测方法配置ID", example = "9130") private Long configAssayMethodId; - @Schema(description = "指派单ID", example = "15392") + @Schema(description = "指派单ID", example = "23566") private Long businessAssayTaskId; @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", example = "1") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2") private String assayType; + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "16988") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "任务指派时间") + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] taskTime; + private LocalDateTime[] assignTaskTime; - @Schema(description = "是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; @Schema(description = "是否已上报") private Integer isReported; @@ -54,19 +63,26 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; - @Schema(description = "流程节点") - private String flowNode; + @Schema(description = "样品流程配置ID", example = "10639") + private Long configSampleFlowId; - @Schema(description = "复检次数,0代表正常分析", example = "27671") - private Integer recheckCount; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "乐观锁", example = "4946") + @Schema(description = "样品流程节点时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleFlowNodeTime; + + @Schema(description = "分析次数,复检的累加次数", example = "13073") + private Integer analysisCount; + + @Schema(description = "乐观锁", example = "11435") private Integer updateCount; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java index d42c011..eb5545f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataReqVO.java @@ -13,36 +13,45 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayTaskDataReqVO { - @Schema(description = "样品主样ID", example = "11587") + @Schema(description = "样品主样ID", example = "23293") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", example = "2157") + @Schema(description = "样品分样ID", example = "15024") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", example = "2427") + @Schema(description = "分样子样ID", example = "20464") private Long businessSubSampleId; - @Schema(description = "检测方法ID", example = "21835") + @Schema(description = "检测方法配置ID", example = "9130") private Long configAssayMethodId; - @Schema(description = "指派单ID", example = "15392") + @Schema(description = "指派单ID", example = "23566") private Long businessAssayTaskId; @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", example = "1") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2") private String assayType; + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "16988") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "任务指派时间") + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] taskTime; + private LocalDateTime[] assignTaskTime; - @Schema(description = "是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; @Schema(description = "是否已上报") private Integer isReported; @@ -54,19 +63,26 @@ public class BusinessAssayTaskDataReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; - @Schema(description = "流程节点") - private String flowNode; + @Schema(description = "样品流程配置ID", example = "10639") + private Long configSampleFlowId; - @Schema(description = "复检次数,0代表正常分析", example = "27671") - private Integer recheckCount; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "乐观锁", example = "4946") + @Schema(description = "样品流程节点时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleFlowNodeTime; + + @Schema(description = "分析次数,复检的累加次数", example = "13073") + private Integer analysisCount; + + @Schema(description = "乐观锁", example = "11435") private Integer updateCount; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java index af0a584..bb92eed 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataRespVO.java @@ -12,27 +12,27 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessAssayTaskDataRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32383") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1089") @ExcelProperty("ID") private Long id; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11587") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23293") @ExcelProperty("样品主样ID") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2157") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15024") @ExcelProperty("样品分样ID") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2427") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20464") @ExcelProperty("分样子样ID") private Long businessSubSampleId; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21835") - @ExcelProperty("检测方法ID") - private String configAssayMethodId; + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9130") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; - @Schema(description = "指派单ID", example = "15392") + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23566") @ExcelProperty("指派单ID") private Long businessAssayTaskId; @@ -40,21 +40,33 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("任务类型,【字典】【jy_sample_task_type】常规、抽查...") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...") private String assayType; + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16988") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + @Schema(description = "分析人") @ExcelProperty("分析人") private String assayOperator; - @Schema(description = "任务指派时间") - @ExcelProperty("任务指派时间") - private LocalDateTime taskTime; + @Schema(description = "分配任务时间") + @ExcelProperty("分配任务时间") + private LocalDateTime assignTaskTime; - @Schema(description = "是否已指派") - @ExcelProperty("是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + @ExcelProperty("是否已分配任务") + private Integer isAssignTasked; @Schema(description = "是否已上报") @ExcelProperty("是否已上报") @@ -68,15 +80,23 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("上报时间") private LocalDateTime reportTime; - @Schema(description = "流程节点", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("流程节点") - private String flowNode; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10639") + @ExcelProperty("样品流程配置ID") + private Long configSampleFlowId; - @Schema(description = "复检次数,0代表正常分析", requiredMode = Schema.RequiredMode.REQUIRED, example = "27671") - @ExcelProperty("复检次数,0代表正常分析") - private Integer recheckCount; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4946") + @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点时间") + private LocalDateTime sampleFlowNodeTime; + + @Schema(description = "分析次数,复检的累加次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13073") + @ExcelProperty("分析次数,复检的累加次数") + private Integer analysisCount; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") @ExcelProperty("乐观锁") private Integer updateCount; @@ -84,8 +104,8 @@ public class BusinessAssayTaskDataRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java index 9070771..bd7fa13 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataSaveReqVO.java @@ -11,44 +11,56 @@ import java.time.LocalDateTime; @Data public class BusinessAssayTaskDataSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32383") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1089") private Long id; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11587") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23293") @NotNull(message = "样品主样ID不能为空") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2157") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15024") @NotNull(message = "样品分样ID不能为空") private Long businessSubParentSampleId; - @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2427") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20464") @NotNull(message = "分样子样ID不能为空") private Long businessSubSampleId; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21835") - @NotEmpty(message = "检测方法ID不能为空") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9130") + @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "指派单ID", example = "15392") + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23566") + @NotNull(message = "指派单ID不能为空") private Long businessAssayTaskId; @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotEmpty(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...不能为空") + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...不能为空") private String assayType; + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测项目不能为空") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16988") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "任务指派时间") - private LocalDateTime taskTime; + @Schema(description = "分配任务时间") + private LocalDateTime assignTaskTime; - @Schema(description = "是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; @Schema(description = "是否已上报") private Integer isReported; @@ -59,20 +71,26 @@ public class BusinessAssayTaskDataSaveReqVO { @Schema(description = "上报时间") private LocalDateTime reportTime; - @Schema(description = "流程节点", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "流程节点不能为空") - private String flowNode; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10639") + @NotNull(message = "样品流程配置ID不能为空") + private Long configSampleFlowId; - @Schema(description = "复检次数,0代表正常分析", requiredMode = Schema.RequiredMode.REQUIRED, example = "27671") - @NotNull(message = "复检次数,0代表正常分析不能为空") - private Integer recheckCount; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品流程节点KEY不能为空") + private String sampleFlowNodeKey; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4946") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "样品流程节点时间不能为空") + private LocalDateTime sampleFlowNodeTime; + + @Schema(description = "分析次数,复检的累加次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13073") + @NotNull(message = "分析次数,复检的累加次数不能为空") + private Integer analysisCount; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "11435") private Integer updateCount; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailExtendRespVO.java new file mode 100644 index 0000000..79bf052 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailExtendRespVO.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessAssayTaskDetailExtendRespVO extends BusinessAssayTaskDetailRespVO { + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "样品主样ID", example = "23293") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "15024") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "20464") + private Long businessSubSampleId; + + @Schema(description = "检测方法配置ID", example = "9130") + private Long configAssayMethodId; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2") + private String assayType; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "16988") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailPageReqVO.java index 33bff71..cd86e94 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailPageReqVO.java @@ -13,19 +13,19 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayTaskDetailPageReqVO extends PageParam { - @Schema(description = "指派单ID", example = "6438") + @Schema(description = "指派单ID", example = "21102") private Long businessAssayTaskId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; - @Schema(description = "样品id", example = "26703") + @Schema(description = "样品id", example = "9299") private Long sampleId; @Schema(description = "指派编号") private String taskNo; - @Schema(description = "物料名称", example = "张三") - private String materialName; - - @Schema(description = "样品名称", example = "芋艿") + @Schema(description = "样品名称", example = "王五") private String sampleName; @Schema(description = "样品编号") @@ -37,8 +37,8 @@ public class BusinessAssayTaskDetailPageReqVO extends PageParam { @Schema(description = "数据来源类型,【字典】【jy_assay_task_data_source_type】正常,筛上,筛下", example = "1") private String dataSourceType; - @Schema(description = "序号") - private Integer sort; + @Schema(description = "排序号") + private Integer sortNo; @Schema(description = "任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回", example = "1") private String rollbackStatus; @@ -46,7 +46,7 @@ public class BusinessAssayTaskDetailPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailReqVO.java new file mode 100644 index 0000000..1fb05aa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailReqVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测任务分配明细分页 Request VO") +@Data +public class BusinessAssayTaskDetailReqVO { + + @Schema(description = "指派单ID", example = "21102") + private Long businessAssayTaskId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "样品id", example = "9299") + private Long sampleId; + + @Schema(description = "指派编号") + private String taskNo; + + @Schema(description = "样品名称", example = "王五") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "杯号") + private String cupNumber; + + @Schema(description = "数据来源类型,【字典】【jy_assay_task_data_source_type】正常,筛上,筛下", example = "1") + private String dataSourceType; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回", example = "1") + private String rollbackStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailRespVO.java index a06da26..8379609 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailRespVO.java @@ -12,15 +12,18 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessAssayTaskDetailRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19713") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6020") @ExcelProperty("ID") private Long id; - @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6438") + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21102") @ExcelProperty("指派单ID") private Long businessAssayTaskId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; - @Schema(description = "样品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26703") + @Schema(description = "样品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9299") @ExcelProperty("样品id") private Long sampleId; @@ -28,11 +31,7 @@ public class BusinessAssayTaskDetailRespVO { @ExcelProperty("指派编号") private String taskNo; - @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @ExcelProperty("物料名称") - private String materialName; - - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("样品名称") private String sampleName; @@ -48,9 +47,9 @@ public class BusinessAssayTaskDetailRespVO { @ExcelProperty("数据来源类型,【字典】【jy_assay_task_data_source_type】正常,筛上,筛下") private String dataSourceType; - @Schema(description = "序号") - @ExcelProperty("序号") - private Integer sort; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("排序号") + private Integer sortNo; @Schema(description = "任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回") @@ -60,8 +59,8 @@ public class BusinessAssayTaskDetailRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailSaveReqVO.java index dc7e050..b3c0b3d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDetailSaveReqVO.java @@ -9,14 +9,17 @@ import jakarta.validation.constraints.*; @Data public class BusinessAssayTaskDetailSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19713") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6020") private Long id; - @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6438") + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21102") @NotNull(message = "指派单ID不能为空") private Long businessAssayTaskId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; - @Schema(description = "样品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26703") + @Schema(description = "样品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9299") @NotNull(message = "样品id不能为空") private Long sampleId; @@ -24,11 +27,7 @@ public class BusinessAssayTaskDetailSaveReqVO { @NotEmpty(message = "指派编号不能为空") private String taskNo; - @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @NotEmpty(message = "物料名称不能为空") - private String materialName; - - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "样品名称不能为空") private String sampleName; @@ -43,15 +42,15 @@ public class BusinessAssayTaskDetailSaveReqVO { @NotEmpty(message = "数据来源类型,【字典】【jy_assay_task_data_source_type】正常,筛上,筛下不能为空") private String dataSourceType; - @Schema(description = "序号") - private Integer sort; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "排序号不能为空") + private Integer sortNo; @Schema(description = "任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotEmpty(message = "任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回不能为空") private String rollbackStatus; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java new file mode 100644 index 0000000..7ed693e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskExtendRespVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; + +import lombok.Data; + +/** + * BusinessAssayTaskExtendRespVO + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月25日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月25日 + */ +@Data +public class BusinessAssayTaskExtendRespVO extends BusinessAssayTaskRespVO { + + /** 分析方法名称 **/ + private String configAssayMethodName; + + /** 分析方法对应的分析项目 **/ + private String configAssayMethodProjectShowNames; + + /** 分析任务数 **/ + private Long assayTaskCount; + + /** 质量控制分析方法 **/ + private List configQCSampleMethodList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java index 7b19c8e..65d3703 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskPageReqVO.java @@ -16,25 +16,58 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "指派编号") private String taskNo; - @Schema(description = "指派单名称", example = "芋艿") + @Schema(description = "指派单名称", example = "张三") private String taskName; - @Schema(description = "检测方法ID", example = "18615") + @Schema(description = "检测方法配置ID", example = "13609") private Long configAssayMethodId; - @Schema(description = "任务单来源", example = "1") + @Schema(description = "任务单模板ID", example = "4389") + private Long configReportTemplateId; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; + + @Schema(description = "任务单来源,分配-task_assign、领取-task_claim", example = "1") private String taskSourceType; - @Schema(description = "指派人") - private String taskOperator; + @Schema(description = "任务单分配人") + private String taskAssignOperator; - @Schema(description = "指派时间") + @Schema(description = "任务单分配时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] taskOperatorTime; + private LocalDateTime[] taskAssignTime; - @Schema(description = "指派分析人") + @Schema(description = "任务单分配状态,进行中-in_progress、已提交-submitted、作废-void", example = "2") + private String taskAssignStatus; + + @Schema(description = "任务单分配提交时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] taskAssignSubmitTime; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assayTime; + + @Schema(description = "分析提交时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assaySubmitTime; + + @Schema(description = "任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted", example = "1") + private String taskAssayStatus; + + @Schema(description = "分析状态列表") + private List taskAssayStatusList; + @Schema(description = "上报时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; @@ -42,37 +75,15 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "上报人") private String reportOperator; - @Schema(description = "提交时间") + @Schema(description = "任务单完成时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] submitTime; + private LocalDateTime[] taskFinishTime; - @Schema(description = "指派单状态,【字典】【jy_assay_task_status】0-初始状态,1-已提交", example = "1") - private String taskStatus; - - @Schema(description = "同步状态,【字典】【jy_assay_task_syn_status】0-未同步,1-已同步", example = "2") - private String synchronousStatus; - - @Schema(description = "标样业务ID", example = "21760") - private Long standardSampleId; - - @Schema(description = "标样编号") - private String standardSampleCode; - - @Schema(description = "标准样类型ID", example = "31587") - private Long standardSampleTypeId; - - @Schema(description = "质控样编号") - private String qualitySampleCode; - - @Schema(description = "质控样分析时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] qualitySampleAssayTime; - - @Schema(description = "流程实例id", example = "15616") + @Schema(description = "流程实例id", example = "19026") private Long flowInstanceId; - @Schema(description = "顶部字段配置") - private String formConfig; + @Schema(description = "顶部字段数据集ID,T_DAT_COLT_FLD", example = "9742") + private Long formDataCollectionId; @Schema(description = "顶部字段值") private String formValue; @@ -80,16 +91,16 @@ public class BusinessAssayTaskPageReqVO extends PageParam { @Schema(description = "签名信息") private String documentSignature; - @Schema(description = "完成状态,【字典】【jy_assay_task_finish_status】默认;待处理;已完成(待提交);已提交", example = "2") + @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") private String finishStatus; - @Schema(description = "流程状态,【字典】【jy_assay_task_flow_status】默认;审批中;打回;已完成", example = "1") + @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") private String flowStatus; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java new file mode 100644 index 0000000..445dc92 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskReqVO.java @@ -0,0 +1,109 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测任务分配业务分页 Request VO") +@Data +public class BusinessAssayTaskReqVO { + + @Schema(description = "指派编号") + private String taskNo; + + @Schema(description = "指派单名称", example = "张三") + private String taskName; + + @Schema(description = "检测方法配置ID", example = "13609") + private Long configAssayMethodId; + + @Schema(description = "任务单模板ID", example = "4389") + private Long configReportTemplateId; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; + + @Schema(description = "任务单来源,分配-task_assign、领取-task_claim", example = "1") + private String taskSourceType; + + @Schema(description = "任务单分配人") + private String taskAssignOperator; + + @Schema(description = "任务单分配时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] taskAssignTime; + + @Schema(description = "任务单分配状态,进行中-in_progress、已提交-submitted、作废-void", example = "2") + private String taskAssignStatus; + + @Schema(description = "任务单分配提交时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] taskAssignSubmitTime; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分析时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assayTime; + + @Schema(description = "分析提交时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assaySubmitTime; + + @Schema(description = "任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted", example = "1") + private String taskAssayStatus; + + @Schema(description = "分析状态列表") + private List taskAssayStatusList; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "上报人") + private String reportOperator; + + @Schema(description = "任务单完成时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] taskFinishTime; + + @Schema(description = "流程实例id", example = "19026") + private Long flowInstanceId; + + @Schema(description = "顶部字段数据集ID,T_DAT_COLT_FLD", example = "9742") + private Long formDataCollectionId; + + @Schema(description = "顶部字段值") + private String formValue; + + @Schema(description = "签名信息") + private String documentSignature; + + @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") + private String finishStatus; + + @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") + private String flowStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java index 835f71f..9bae38a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskRespVO.java @@ -2,8 +2,6 @@ package com.zt.plat.module.qms.business.bus.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; @@ -12,7 +10,7 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessAssayTaskRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5973") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11667") @ExcelProperty("ID") private Long id; @@ -20,30 +18,64 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("指派编号") private String taskNo; - @Schema(description = "指派单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "指派单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("指派单名称") private String taskName; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18615") - @ExcelProperty("检测方法ID") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13609") + @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "任务单来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("任务单来源") + @Schema(description = "任务单模板ID", example = "4389") + @ExcelProperty("任务单模板ID") + private Long configReportTemplateId; + + @Schema(description = "任务单模板key") + @ExcelProperty("任务单模板key") + private String configReportTemplateKey; + + @Schema(description = "任务单来源,分配-task_assign、领取-task_claim", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("任务单来源,分配-task_assign、领取-task_claim") private String taskSourceType; - @Schema(description = "指派人", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("指派人") - private String taskOperator; + @Schema(description = "任务单分配人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("任务单分配人") + private String taskAssignOperator; - @Schema(description = "指派时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("指派时间") - private LocalDateTime taskOperatorTime; + @Schema(description = "任务单分配时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("任务单分配时间") + private LocalDateTime taskAssignTime; - @Schema(description = "指派分析人", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("指派分析人") + @Schema(description = "任务单分配状态,进行中-in_progress、已提交-submitted、作废-void", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("任务单分配状态,进行中-in_progress、已提交-submitted") + private String taskAssignStatus; + + @Schema(description = "任务单分配提交时间") + @ExcelProperty("任务单分配提交时间") + private LocalDateTime taskAssignSubmitTime; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + @Schema(description = "分析人") + @ExcelProperty("分析人") private String assayOperator; + @Schema(description = "分析时间") + @ExcelProperty("分析时间") + private LocalDateTime assayTime; + + @Schema(description = "分析提交时间") + @ExcelProperty("分析提交时间") + private LocalDateTime assaySubmitTime; + + @Schema(description = "任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted", example = "1") + @ExcelProperty("任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted") + private String taskAssayStatus; + @Schema(description = "上报时间") @ExcelProperty("上报时间") private LocalDateTime reportTime; @@ -52,45 +84,17 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("上报人") private String reportOperator; - @Schema(description = "提交时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("提交时间") - private LocalDateTime submitTime; + @Schema(description = "任务单完成时间") + @ExcelProperty("任务单完成时间") + private LocalDateTime taskFinishTime; - @Schema(description = "指派单状态,【字典】【jy_assay_task_status】0-初始状态,1-已提交", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("指派单状态,【字典】【jy_assay_task_status】0-初始状态,1-已提交") - private String taskStatus; - - @Schema(description = "同步状态,【字典】【jy_assay_task_syn_status】0-未同步,1-已同步", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("同步状态,【字典】【jy_assay_task_syn_status】0-未同步,1-已同步") - private String synchronousStatus; - - @Schema(description = "标样业务ID", example = "21760") - @ExcelProperty("标样业务ID") - private Long standardSampleId; - - @Schema(description = "标样编号") - @ExcelProperty("标样编号") - private String standardSampleCode; - - @Schema(description = "标准样类型ID", example = "31587") - @ExcelProperty("标准样类型ID") - private Long standardSampleTypeId; - - @Schema(description = "质控样编号") - @ExcelProperty("质控样编号") - private String qualitySampleCode; - - @Schema(description = "质控样分析时间") - @ExcelProperty("质控样分析时间") - private LocalDateTime qualitySampleAssayTime; - - @Schema(description = "流程实例id", example = "15616") + @Schema(description = "流程实例id", example = "19026") @ExcelProperty("流程实例id") private Long flowInstanceId; - @Schema(description = "顶部字段配置", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("顶部字段配置") - private String formConfig; + @Schema(description = "顶部字段数据集ID,T_DAT_COLT_FLD", example = "9742") + @ExcelProperty("顶部字段数据集ID,T_DAT_COLT_FLD") + private Long formDataCollectionId; @Schema(description = "顶部字段值") @ExcelProperty("顶部字段值") @@ -100,20 +104,20 @@ public class BusinessAssayTaskRespVO { @ExcelProperty("签名信息") private String documentSignature; - @Schema(description = "完成状态,【字典】【jy_assay_task_finish_status】默认;待处理;已完成(待提交);已提交", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("完成状态,【字典】【jy_assay_task_finish_status】默认;待处理;已完成(待提交);已提交") + @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") + @ExcelProperty("完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved") private String finishStatus; - @Schema(description = "流程状态,【字典】【jy_assay_task_flow_status】默认;审批中;打回;已完成", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("流程状态,【字典】【jy_assay_task_flow_status】默认;审批中;打回;已完成") + @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") + @ExcelProperty("流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved") private String flowStatus; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java index 020d44b..aa444e5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskSaveReqVO.java @@ -5,82 +5,88 @@ import lombok.*; import java.util.*; import jakarta.validation.constraints.*; import org.springframework.format.annotation.DateTimeFormat; + +import com.alibaba.excel.annotation.ExcelProperty; + import java.time.LocalDateTime; @Schema(description = "管理后台 - 检测任务分配业务新增/修改 Request VO") @Data public class BusinessAssayTaskSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5973") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11667") private Long id; @Schema(description = "指派编号", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "指派编号不能为空") private String taskNo; - @Schema(description = "指派单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "指派单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @NotEmpty(message = "指派单名称不能为空") private String taskName; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18615") - @NotNull(message = "检测方法ID不能为空") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13609") + @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "任务单来源", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "任务单来源不能为空") + @Schema(description = "任务单模板ID", example = "4389") + private Long configReportTemplateId; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; + + @Schema(description = "任务单来源,分配-task_assign、领取-task_claim", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "任务单来源,分配-task_assign、领取-task_claim不能为空") private String taskSourceType; - @Schema(description = "指派人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "指派人不能为空") - private String taskOperator; + @Schema(description = "任务单分配人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "任务单分配人不能为空") + private String taskAssignOperator; - @Schema(description = "指派时间", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "指派时间不能为空") - private LocalDateTime taskOperatorTime; + @Schema(description = "任务单分配时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "任务单分配时间不能为空") + private LocalDateTime taskAssignTime; - @Schema(description = "指派分析人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "指派分析人不能为空") + @Schema(description = "任务单分配状态,进行中-in_progress、已提交-submitted、作废-void", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "任务单分配状态,进行中-in_progress、已提交-submitted不能为空、作废-void") + private String taskAssignStatus; + + @Schema(description = "任务单分配提交时间") + @ExcelProperty("任务单分配提交时间") + private LocalDateTime taskAssignSubmitTime; + + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit", example = "2") + private String ingredientsStatus; + + @Schema(description = "分析人") private String assayOperator; + @Schema(description = "分析时间") + private LocalDateTime assayTime; + + @Schema(description = "分析提交时间") + private LocalDateTime assaySubmitTime; + + @Schema(description = "任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted", example = "1") + private String taskAssayStatus; + @Schema(description = "上报时间") private LocalDateTime reportTime; @Schema(description = "上报人") private String reportOperator; - @Schema(description = "提交时间", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "提交时间不能为空") - private LocalDateTime submitTime; + @Schema(description = "任务单完成时间") + private LocalDateTime taskFinishTime; - @Schema(description = "指派单状态,【字典】【jy_assay_task_status】0-初始状态,1-已提交", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "指派单状态,【字典】【jy_assay_task_status】0-初始状态,1-已提交不能为空") - private String taskStatus; - - @Schema(description = "同步状态,【字典】【jy_assay_task_syn_status】0-未同步,1-已同步", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "同步状态,【字典】【jy_assay_task_syn_status】0-未同步,1-已同步不能为空") - private String synchronousStatus; - - @Schema(description = "标样业务ID", example = "21760") - private Long standardSampleId; - - @Schema(description = "标样编号") - private String standardSampleCode; - - @Schema(description = "标准样类型ID", example = "31587") - private Long standardSampleTypeId; - - @Schema(description = "质控样编号") - private String qualitySampleCode; - - @Schema(description = "质控样分析时间") - private LocalDateTime qualitySampleAssayTime; - - @Schema(description = "流程实例id", example = "15616") + @Schema(description = "流程实例id", example = "19026") private Long flowInstanceId; - @Schema(description = "顶部字段配置", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "顶部字段配置不能为空") - private String formConfig; + @Schema(description = "顶部字段数据集ID,T_DAT_COLT_FLD", example = "9742") + private Long formDataCollectionId; @Schema(description = "顶部字段值") private String formValue; @@ -88,16 +94,13 @@ public class BusinessAssayTaskSaveReqVO { @Schema(description = "签名信息") private String documentSignature; - @Schema(description = "完成状态,【字典】【jy_assay_task_finish_status】默认;待处理;已完成(待提交);已提交", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "完成状态,【字典】【jy_assay_task_finish_status】默认;待处理;已完成(待提交);已提交不能为空") + @Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2") private String finishStatus; - @Schema(description = "流程状态,【字典】【jy_assay_task_flow_status】默认;审批中;打回;已完成", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "流程状态,【字典】【jy_assay_task_flow_status】默认;审批中;打回;已完成不能为空") + @Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1") private String flowStatus; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSamplePageReqVO.java index e5b10e4..e957a3f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSamplePageReqVO.java @@ -13,53 +13,56 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessBaseSamplePageReqVO extends PageParam { - @Schema(description = "样品名称", example = "芋艿") + @Schema(description = "样品名称", example = "张三") private String sampleName; + @Schema(description = "样品大类名称", example = "张三") + private String baseSampleName; + @Schema(description = "样品编号") private String sampleCode; - @Schema(description = "主样配置ID", example = "26608") + @Schema(description = "主样配置ID", example = "3221") private Long configBaseSampleId; - @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", example = "27887") + @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", example = "32376") private Long dictionaryBusinessId; @Schema(description = "样品生成时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] sampleTime; - @Schema(description = "打印次数", example = "20143") + @Schema(description = "打印次数", example = "31445") private Integer printCount; @Schema(description = "末次打印时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] printLastTime; - @Schema(description = "样品流程ID", example = "25222") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", example = "30581") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "样品流程节点时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] sampleFlowTime; + private LocalDateTime[] sampleFlowNodeTime; @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "1") private String sampleStatus; + @Schema(description = "操作人") + private String operator; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建人名称") - private String operator; - - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "13116") + @Schema(description = "乐观锁", example = "24886") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleRespVO.java index a3a9566..7d12438 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleRespVO.java @@ -12,23 +12,27 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessBaseSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14424") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26968") @ExcelProperty("ID") private Long id; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("样品名称") private String sampleName; + @Schema(description = "样品大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("样品大类名称") + private String baseSampleName; + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("样品编号") private String sampleCode; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26608") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3221") @ExcelProperty("主样配置ID") private Long configBaseSampleId; - @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", requiredMode = Schema.RequiredMode.REQUIRED, example = "27887") + @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", requiredMode = Schema.RequiredMode.REQUIRED, example = "32376") @ExcelProperty("主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样") private Long dictionaryBusinessId; @@ -36,7 +40,7 @@ public class BusinessBaseSampleRespVO { @ExcelProperty("样品生成时间") private LocalDateTime sampleTime; - @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "20143") + @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "31445") @ExcelProperty("打印次数") private Integer printCount; @@ -44,35 +48,35 @@ public class BusinessBaseSampleRespVO { @ExcelProperty("末次打印时间") private LocalDateTime printLastTime; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25222") - @ExcelProperty("样品流程ID") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30581") + @ExcelProperty("样品流程配置ID") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("样品流程节点时间") - private LocalDateTime sampleFlowTime; + private LocalDateTime sampleFlowNodeTime; @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废") private String sampleStatus; + @Schema(description = "操作人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("操作人") + private String operator; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建人名称", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建人名称") - private String operator; - - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13116") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24886") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleSaveReqVO.java index 808fd09..326f1cf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessBaseSampleSaveReqVO.java @@ -11,22 +11,26 @@ import java.time.LocalDateTime; @Data public class BusinessBaseSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14424") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26968") private Long id; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @NotEmpty(message = "样品名称不能为空") private String sampleName; + @Schema(description = "样品大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "样品大类名称不能为空") + private String baseSampleName; + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "样品编号不能为空") private String sampleCode; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26608") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3221") @NotNull(message = "主样配置ID不能为空") private Long configBaseSampleId; - @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", requiredMode = Schema.RequiredMode.REQUIRED, example = "27887") + @Schema(description = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样", requiredMode = Schema.RequiredMode.REQUIRED, example = "32376") @NotNull(message = "主样类型ID,字典表:【T_DIC_BSN】结算样、抽查样、委检样不能为空") private Long dictionaryBusinessId; @@ -34,39 +38,37 @@ public class BusinessBaseSampleSaveReqVO { @NotNull(message = "样品生成时间不能为空") private LocalDateTime sampleTime; - @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "20143") + @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "31445") @NotNull(message = "打印次数不能为空") private Integer printCount; @Schema(description = "末次打印时间") private LocalDateTime printLastTime; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25222") - @NotNull(message = "样品流程ID不能为空") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30581") + @NotNull(message = "样品流程配置ID不能为空") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "样品流程KEY不能为空") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品流程节点KEY不能为空") + private String sampleFlowNodeKey; @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "样品流程节点时间不能为空") - private LocalDateTime sampleFlowTime; + private LocalDateTime sampleFlowNodeTime; @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空") private String sampleStatus; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") - private String systemDepartmentCode; - - @Schema(description = "创建人名称", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "创建人名称不能为空") + @Schema(description = "操作人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "操作人不能为空") private String operator; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13116") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24886") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java index c91950a..9872acf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubPageReqVO.java @@ -14,14 +14,14 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessHandoverRecordSubPageReqVO extends PageParam { - @Schema(description = "样品子样ID", example = "7268") + @Schema(description = "分样子样ID", example = "15157") private Long businessSubSampleId; - @Schema(description = "样品流程ID", example = "27410") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", example = "9154") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "样品编号") private String sampleCode; @@ -29,6 +29,9 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam { @Schema(description = "样品重量") private BigDecimal sampleWeight; + @Schema(description = "天平编号") + private String balanceCode; + @Schema(description = "操作时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] operationTime; @@ -36,7 +39,7 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam { @Schema(description = "操作人") private String operator; - @Schema(description = "操作人ID", example = "9370") + @Schema(description = "操作人ID", example = "19708") private Long operatorId; @Schema(description = "送样人") @@ -45,10 +48,16 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam { @Schema(description = "收样人") private String receiveSampleOperator; + @Schema(description = "上一个交接记录ID", example = "5605") + private Long upSampleRecordId; + + @Schema(description = "下一个交接记录ID", example = "31634") + private Long nextSampleRecordId; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubRespVO.java index b732e00..bb27827 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubRespVO.java @@ -13,23 +13,23 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessHandoverRecordSubRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3962") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20889") @ExcelProperty("ID") private Long id; - @Schema(description = "样品子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7268") - @ExcelProperty("样品子样ID") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15157") + @ExcelProperty("分样子样ID") private Long businessSubSampleId; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27410") - @ExcelProperty("样品流程ID") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9154") + @ExcelProperty("样品流程配置ID") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "样品编号") + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("样品编号") private String sampleCode; @@ -37,6 +37,10 @@ public class BusinessHandoverRecordSubRespVO { @ExcelProperty("样品重量") private BigDecimal sampleWeight; + @Schema(description = "天平编号") + @ExcelProperty("天平编号") + private String balanceCode; + @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("操作时间") private LocalDateTime operationTime; @@ -45,7 +49,7 @@ public class BusinessHandoverRecordSubRespVO { @ExcelProperty("操作人") private String operator; - @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9370") + @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19708") @ExcelProperty("操作人ID") private Long operatorId; @@ -57,12 +61,20 @@ public class BusinessHandoverRecordSubRespVO { @ExcelProperty("收样人") private String receiveSampleOperator; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "上一个交接记录ID", example = "5605") + @ExcelProperty("上一个交接记录ID") + private Long upSampleRecordId; + + @Schema(description = "下一个交接记录ID", example = "31634") + @ExcelProperty("下一个交接记录ID") + private Long nextSampleRecordId; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubSaveReqVO.java index 33e407b..f961a49 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessHandoverRecordSubSaveReqVO.java @@ -12,27 +12,31 @@ import java.time.LocalDateTime; @Data public class BusinessHandoverRecordSubSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3962") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20889") private Long id; - @Schema(description = "样品子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7268") - @NotNull(message = "样品子样ID不能为空") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15157") + @NotNull(message = "分样子样ID不能为空") private Long businessSubSampleId; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27410") - @NotNull(message = "样品流程ID不能为空") - private Long sampleFlowId; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9154") +// @NotNull(message = "样品流程配置ID不能为空") + private Long configSampleFlowId; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "样品流程KEY不能为空") - private String sampleFlowKey; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品流程节点KEY不能为空") + private String sampleFlowNodeKey; - @Schema(description = "样品编号") + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品编号不能为空") private String sampleCode; @Schema(description = "样品重量") private BigDecimal sampleWeight; + @Schema(description = "天平编号") + private String balanceCode; + @Schema(description = "操作时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "操作时间不能为空") private LocalDateTime operationTime; @@ -41,20 +45,25 @@ public class BusinessHandoverRecordSubSaveReqVO { @NotEmpty(message = "操作人不能为空") private String operator; - @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9370") + @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19708") @NotNull(message = "操作人ID不能为空") private Long operatorId; @Schema(description = "送样人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "送样人不能为空") +// @NotEmpty(message = "送样人不能为空") private String sendSampleOperator; @Schema(description = "收样人", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "收样人不能为空") +// @NotEmpty(message = "收样人不能为空") private String receiveSampleOperator; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "上一个交接记录ID", example = "5605") + private Long upSampleRecordId; + + @Schema(description = "下一个交接记录ID", example = "31634") + private Long nextSampleRecordId; + + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java new file mode 100644 index 0000000..0223ac0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataPageReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测系数任务数据,空白样、标样分页 Request VO") +@Data +public class BusinessQCCoefficientDataPageReqVO extends PageParam { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "31198") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "28147") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "5300") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "21660") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "12186") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "6160") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java new file mode 100644 index 0000000..cf8ca9d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测系数任务数据,空白样、标样分页 Request VO") +@Data +public class BusinessQCCoefficientDataReqVO { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "31198") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "28147") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "5300") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "21660") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "12186") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "6160") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java new file mode 100644 index 0000000..b0cc663 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataRespVO.java @@ -0,0 +1,99 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测系数任务数据,空白样、标样 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCCoefficientDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19352") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品编号") + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31198") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "28147") + @ExcelProperty("指派单ID") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "5300") + @ExcelProperty("定值样业务ID") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "21660") + @ExcelProperty("质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + @ExcelProperty("质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12186") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + + @Schema(description = "分析人") + @ExcelProperty("分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @ExcelProperty("分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + @ExcelProperty("是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java new file mode 100644 index 0000000..a02d79e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientDataSaveReqVO.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 质控样检测系数任务数据,空白样、标样新增/修改 Request VO") +@Data +public class BusinessQCCoefficientDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19352") + private Long id; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31198") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "28147") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "5300") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "21660") + @NotNull(message = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样不能为空") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12186") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "6160") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataPageReqVO.java new file mode 100644 index 0000000..1f9d122 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataPageReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测系数参数业务分页 Request VO") +@Data +public class BusinessQCCoefficientParameterDataPageReqVO extends PageParam { + + @Schema(description = "检测项目业务ID", example = "23013") + private Long businessQCCoefficientDataId; + + @Schema(description = "质控样检测方法参数配置ID", example = "870") + private Long configQCSampleMethodParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "7977") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "25016") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataReqVO.java new file mode 100644 index 0000000..8594339 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测系数参数业务分页 Request VO") +@Data +public class BusinessQCCoefficientParameterDataReqVO { + + @Schema(description = "检测项目业务ID", example = "23013") + private Long businessQCCoefficientDataId; + + @Schema(description = "质控样检测方法参数配置ID", example = "870") + private Long configQCSampleMethodParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "7977") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "25016") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataRespVO.java new file mode 100644 index 0000000..5ecf14a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测系数参数业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCCoefficientParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14408") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23013") + @ExcelProperty("检测项目业务ID") + private Long businessQCCoefficientDataId; + + @Schema(description = "质控样检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "870") + @ExcelProperty("质控样检测方法参数配置ID") + private Long configQCSampleMethodParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "7977") + @ExcelProperty("参数ID,字典表【T_DIC_PRM】") + private Long dictionaryParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "25016") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataSaveReqVO.java new file mode 100644 index 0000000..b36512a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCCoefficientParameterDataSaveReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测系数参数业务新增/修改 Request VO") +@Data +public class BusinessQCCoefficientParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14408") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23013") + @NotNull(message = "检测项目业务ID不能为空") + private Long businessQCCoefficientDataId; + + @Schema(description = "质控样检测方法参数配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "870") + @NotNull(message = "质控样检测方法参数配置ID不能为空") + private Long configQCSampleMethodParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "7977") + @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "25016") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataExtendRespVO.java new file mode 100644 index 0000000..6f26a7c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataExtendRespVO.java @@ -0,0 +1,8 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessQCDataExtendRespVO extends BusinessQCDataRespVO { + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataPageReqVO.java new file mode 100644 index 0000000..52d818a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataPageReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样业务分页 Request VO") +@Data +public class BusinessQCDataPageReqVO extends PageParam { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "8003") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "29117") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "29365") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "李四") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "24118") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataReqVO.java new file mode 100644 index 0000000..3a450a7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样业务分页 Request VO") +@Data +public class BusinessQCDataReqVO { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "赵六") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "8003") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "29117") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "29365") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "李四") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "24118") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataRespVO.java new file mode 100644 index 0000000..00527e4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataRespVO.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8465") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8003") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "29117") + @ExcelProperty("指派单ID") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29365") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "李四") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + + @Schema(description = "分析人") + @ExcelProperty("分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @ExcelProperty("分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + @ExcelProperty("是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24118") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataSaveReqVO.java new file mode 100644 index 0000000..d0361f4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCDataSaveReqVO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 质控样业务新增/修改 Request VO") +@Data +public class BusinessQCDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8465") + private Long id; + + @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "样品编号不能为空") + private String sampleCode; + + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotNull(message = "样品名称不能为空") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8003") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "29117") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测项目不能为空") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29365") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "李四") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24118") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java new file mode 100644 index 0000000..f9c44bf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataPageReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控管理样检测任务数据,管理样、标准样分页 Request VO") +@Data +public class BusinessQCManagementDataPageReqVO extends PageParam { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "22240") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "12452") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "29446") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "512") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "21281") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "16695") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java new file mode 100644 index 0000000..43a2f19 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控管理样检测任务数据,管理样、标准样分页 Request VO") +@Data +public class BusinessQCManagementDataReqVO { + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "检测方法配置ID", example = "22240") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "12452") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "29446") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "512") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "21281") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "16695") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java new file mode 100644 index 0000000..fc265de --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataRespVO.java @@ -0,0 +1,99 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控管理样检测任务数据,管理样、标准样 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCManagementDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31717") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品编号") + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22240") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "12452") + @ExcelProperty("指派单ID") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "29446") + @ExcelProperty("定值样业务ID") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "512") + @ExcelProperty("质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + @ExcelProperty("质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21281") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + + @Schema(description = "分析人") + @ExcelProperty("分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + @ExcelProperty("分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + @ExcelProperty("是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16695") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java new file mode 100644 index 0000000..77dc4d1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementDataSaveReqVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 质控管理样检测任务数据,管理样、标准样新增/修改 Request VO") +@Data +public class BusinessQCManagementDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31717") + private Long id; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22240") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "指派单ID", example = "12452") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "29446") + private Long businessStandardSampleId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "512") + @NotNull(message = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样不能为空") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测项目不能为空") + private String assayProject; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21281") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + private String assayDepartmentName; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "分配任务时间") + private LocalDateTime assignTaskTime; + + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16695") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataPageReqVO.java new file mode 100644 index 0000000..17aa571 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataPageReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测参数数据业务分页 Request VO") +@Data +public class BusinessQCManagementParameterDataPageReqVO extends PageParam { + + @Schema(description = "检测项目业务ID", example = "23428") + private Long businessQCManagementProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", example = "12018") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "18162") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "18772") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataReqVO.java new file mode 100644 index 0000000..cb948d8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测参数数据业务分页 Request VO") +@Data +public class BusinessQCManagementParameterDataReqVO extends PageParam { + + @Schema(description = "检测项目业务ID", example = "23428") + private Long businessQCManagementProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", example = "12018") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "18162") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "18772") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataRespVO.java new file mode 100644 index 0000000..1e31364 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测参数数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCManagementParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23533") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23428") + @ExcelProperty("检测项目业务ID") + private Long businessQCManagementProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12018") + @ExcelProperty("检测方法分析项目参数配置表ID") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "18162") + @ExcelProperty("参数ID,字典表【T_DIC_PRM】") + private Long dictionaryParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18772") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataSaveReqVO.java new file mode 100644 index 0000000..c89a8dd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementParameterDataSaveReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测参数数据业务新增/修改 Request VO") +@Data +public class BusinessQCManagementParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23533") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23428") + @NotNull(message = "检测项目业务ID不能为空") + private Long businessQCManagementProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12018") + @NotNull(message = "检测方法分析项目参数配置表ID不能为空") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "18162") + @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18772") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataPageReqVO.java new file mode 100644 index 0000000..90a541e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataPageReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测项目数据业务分页 Request VO") +@Data +public class BusinessQCManagementProjectDataPageReqVO extends PageParam { + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法分析项目配置ID", example = "413") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "3746") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", example = "10206") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataReqVO.java new file mode 100644 index 0000000..4200d73 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测项目数据业务分页 Request VO") +@Data +public class BusinessQCManagementProjectDataReqVO { + + @Schema(description = "检测任务ID", example = "940") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法分析项目配置ID", example = "413") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "3746") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", example = "10206") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataRespVO.java new file mode 100644 index 0000000..9558976 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataRespVO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测项目数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCManagementProjectDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6446") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "940") + @ExcelProperty("检测任务ID") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "413") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "3746") + @ExcelProperty("检测项目字典ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制") + @ExcelProperty("用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制") + private String usage; + + @Schema(description = "符号,=、>、<、等") + @ExcelProperty("符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "10206") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataSaveReqVO.java new file mode 100644 index 0000000..c6aaa83 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCManagementProjectDataSaveReqVO.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测项目数据业务新增/修改 Request VO") +@Data +public class BusinessQCManagementProjectDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6446") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "940") + @NotNull(message = "检测任务ID不能为空") + private Long businessQCManagementDataId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "413") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "3746") + @NotNull(message = "检测项目字典ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否不参与超差判定不能为空") + private Integer isNotAssessment; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否启用不能为空") + private Integer isEnabled; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "10206") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataPageReqVO.java new file mode 100644 index 0000000..e781933 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataPageReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测参数数据业务分页 Request VO") +@Data +public class BusinessQCParameterDataPageReqVO extends PageParam { + + @Schema(description = "检测项目业务ID", example = "28949") + private Long businessQCProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", example = "21530") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "5071") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "24150") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataRespVO.java new file mode 100644 index 0000000..eb345f1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测参数数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCParameterDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6511") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28949") + @ExcelProperty("检测项目业务ID") + private Long businessQCProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21530") + @ExcelProperty("检测方法分析项目参数配置表ID") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "5071") + @ExcelProperty("参数ID,字典表【T_DIC_PRM】") + private Long dictionaryParameterId; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24150") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataSaveReqVO.java new file mode 100644 index 0000000..b96fd81 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCParameterDataSaveReqVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测参数数据业务新增/修改 Request VO") +@Data +public class BusinessQCParameterDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6511") + private Long id; + + @Schema(description = "检测项目业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28949") + @NotNull(message = "检测项目业务ID不能为空") + private Long businessQCProjectDataId; + + @Schema(description = "检测方法分析项目参数配置表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21530") + @NotNull(message = "检测方法分析项目参数配置表ID不能为空") + private Long configAssayMethodProjectParameterId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "5071") + @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") + private Long dictionaryParameterId; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "24150") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataPageReqVO.java new file mode 100644 index 0000000..3e21ba6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataPageReqVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测项目数据业务分页 Request VO") +@Data +public class BusinessQCProjectDataPageReqVO extends PageParam { + + @Schema(description = "检测任务ID", example = "19978") + private Long businessQCDataId; + + @Schema(description = "检测方法分析项目配置ID", example = "4744") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", example = "1375") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", example = "25139") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataRespVO.java new file mode 100644 index 0000000..2fc447b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataRespVO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测项目数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQCProjectDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30726") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19978") + @ExcelProperty("检测任务ID") + private Long businessQCDataId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4744") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "1375") + @ExcelProperty("检测项目字典ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + @ExcelProperty("用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + @ExcelProperty("符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + @ExcelProperty("值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否不参与超差判定") + private Integer isNotAssessment; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用") + private Integer isEnabled; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "25139") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataSaveReqVO.java new file mode 100644 index 0000000..8094fef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQCProjectDataSaveReqVO.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测项目数据业务新增/修改 Request VO") +@Data +public class BusinessQCProjectDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30726") + private Long id; + + @Schema(description = "检测任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19978") + @NotNull(message = "检测任务ID不能为空") + private Long businessQCDataId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4744") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目字典ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "1375") + @NotNull(message = "检测项目字典ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "值") + private String value; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否不参与超差判定", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否不参与超差判定不能为空") + private Integer isNotAssessment; + + @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否启用不能为空") + private Integer isEnabled; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "25139") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectPageReqVO.java new file mode 100644 index 0000000..8854a81 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectPageReqVO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测项目业务分页 Request VO") +@Data +public class BusinessQualityControlSampleProjectPageReqVO extends PageParam { + + @Schema(description = "指派单ID", example = "11066") + private Long businessAssayTaskId; + + @Schema(description = "标准样元素配置ID", example = "15889") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", example = "32665") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称,字典表:【UNT】", example = "李四") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + private String standardValue; + + @Schema(description = "允差值") + private String toleraanceValue; + + @Schema(description = "质控样值") + private String qualityControlValue; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "14124") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectRespVO.java new file mode 100644 index 0000000..39ddc76 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectRespVO.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测项目业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessQualityControlSampleProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5422") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11066") + @ExcelProperty("指派单ID") + private Long businessAssayTaskId; + + @Schema(description = "标准样元素配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15889") + @ExcelProperty("标准样元素配置ID") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32665") + @ExcelProperty("检测项目ID,字典表:【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称,字典表:【UNT】", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @ExcelProperty("检测项目名称,字典表:【UNT】") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + @ExcelProperty("检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + @ExcelProperty("标准值") + private String standardValue; + + @Schema(description = "允差值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("允差值") + private String toleraanceValue; + + @Schema(description = "质控样值") + @ExcelProperty("质控样值") + private String qualityControlValue; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "14124") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectSaveReqVO.java new file mode 100644 index 0000000..f3a78d2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessQualityControlSampleProjectSaveReqVO.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测项目业务新增/修改 Request VO") +@Data +public class BusinessQualityControlSampleProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5422") + private Long id; + + @Schema(description = "指派单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11066") + @NotNull(message = "指派单ID不能为空") + private Long businessAssayTaskId; + + @Schema(description = "标准样元素配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15889") + @NotNull(message = "标准样元素配置ID不能为空") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32665") + @NotNull(message = "检测项目ID,字典表:【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称,字典表:【UNT】", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "检测项目名称,字典表:【UNT】不能为空") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + private String standardValue; + + @Schema(description = "允差值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "允差值不能为空") + private String toleraanceValue; + + @Schema(description = "质控样值") + private String qualityControlValue; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "小数位不能为空") + private Integer decimalPosition; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "14124") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultPageReqVO.java index c31af41..edcc998 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultPageReqVO.java @@ -13,13 +13,13 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSampleAssayResultPageReqVO extends PageParam { - @Schema(description = "委托登记样品明细ID", example = "5711") + @Schema(description = "委托登记样品明细ID", example = "26226") private Long businessSampleEntrustDetailId; - @Schema(description = "样品主样ID", example = "22353") + @Schema(description = "样品主样ID", example = "9132") private Long businessBaseSampleId; - @Schema(description = "来样品位") + @Schema(description = "来样品位(JSON数据)") private String data; @Schema(description = "所属部门") @@ -29,7 +29,7 @@ public class BusinessSampleAssayResultPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "18328") + @Schema(description = "乐观锁", example = "31515") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultRespVO.java index 2073359..18ce6d7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultRespVO.java @@ -12,20 +12,20 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSampleAssayResultRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31437") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21507") @ExcelProperty("ID") private Long id; - @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5711") + @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26226") @ExcelProperty("委托登记样品明细ID") private Long businessSampleEntrustDetailId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22353") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9132") @ExcelProperty("样品主样ID") private Long businessBaseSampleId; - @Schema(description = "来样品位", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("来样品位") + @Schema(description = "来样品位(JSON数据)", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("来样品位(JSON数据)") private String data; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @@ -36,7 +36,7 @@ public class BusinessSampleAssayResultRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18328") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "31515") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultSaveReqVO.java index ded75d3..2331b28 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleAssayResultSaveReqVO.java @@ -9,27 +9,25 @@ import jakarta.validation.constraints.*; @Data public class BusinessSampleAssayResultSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31437") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21507") private Long id; - @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5711") + @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26226") @NotNull(message = "委托登记样品明细ID不能为空") private Long businessSampleEntrustDetailId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22353") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9132") @NotNull(message = "样品主样ID不能为空") private Long businessBaseSampleId; - @Schema(description = "来样品位", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "来样品位不能为空") + @Schema(description = "来样品位(JSON数据)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "来样品位(JSON数据)不能为空") private String data; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18328") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "31515") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailExtendRespVO.java new file mode 100644 index 0000000..f2e1bc9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailExtendRespVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class BusinessSampleDispatchDetailExtendRespVO extends BusinessSampleDispatchDetailRespVO{ + //样品编号 + private String sampleCode; + + //样品名称 + private String sampleName; + + //归库码 + private String sampleReturnCode; + + //归库状态 + private String sampleReturnStatus; + + //归库时间 + private LocalDateTime sampleReturnTime; + + //调拨状态 + private String dispatchStatus; + + //归库状态 + private String returnStatus; + + //库位编码 + private String warehouseLocationCode; + + //仓库名称 + private String warehouseName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java new file mode 100644 index 0000000..4e2d30e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailPageReqVO.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import java.util.List; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 样品调拨明细分页 Request VO") +@Data +public class BusinessSampleDispatchDetailPageReqVO extends PageParam { + + @Schema(description = "父ID", example = "828") + private Long parentId; + + @Schema(description = "子样数据ID", example = "828") + private Long businessSubSampleId; + + @Schema(description = "领用人") + private String borrowUser; + + @Schema(description = "领用人id", example = "22151") + private Long borrowUserId; + + @Schema(description = "领用时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] borrowTime; + + @Schema(description = "领用状态,0-未领用;1-已领用", example = "1") + private String borrowStatus; + + @Schema(description = "归还人") + private String givebackUser; + + @Schema(description = "归还人id", example = "23976") + private Long givebackUserId; + + @Schema(description = "归还时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] givebackTime; + + @Schema(description = "归还状态,0-未归还;1-已归还", example = "2") + private String givebackStatus; + + @Schema(description = "使用状态", example = "2") + private String useStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + //================================扩展字段============================================= + + @Schema(description = "样品号") + private String sampleCode; + + @Schema(description = "idsList") + private List idList; + + @Schema(description = "调拨状态") + private String dispatchStatus; + + @Schema(description = "归库状态") + private String returnStatus; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailRespVO.java new file mode 100644 index 0000000..060b54f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailRespVO.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 样品调拨明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSampleDispatchDetailRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20771") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父ID", example = "828") + @ExcelProperty("父ID") + private Long parentId; + + @Schema(description = "子样数据ID", example = "828") + @ExcelProperty("子样数据ID") + private Long businessSubSampleId; + + @Schema(description = "领用人") + @ExcelProperty("领用人") + private String borrowUser; + + @Schema(description = "领用人id", example = "22151") + @ExcelProperty("领用人id") + private Long borrowUserId; + + @Schema(description = "领用时间") + @ExcelProperty("领用时间") + private LocalDateTime borrowTime; + + @Schema(description = "领用状态,0-未领用;1-已领用", example = "1") + @ExcelProperty("领用状态,0-未领用;1-已领用") + private String borrowStatus; + + @Schema(description = "归还人") + @ExcelProperty("归还人") + private String givebackUser; + + @Schema(description = "归还人id", example = "23976") + @ExcelProperty("归还人id") + private Long givebackUserId; + + @Schema(description = "归还时间") + @ExcelProperty("归还时间") + private LocalDateTime givebackTime; + + @Schema(description = "归还状态,0-未归还;1-已归还", example = "2") + @ExcelProperty("归还状态,0-未归还;1-已归还") + private String givebackStatus; + + @Schema(description = "使用状态", example = "2") + @ExcelProperty("使用状态") + private String useStatus; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailSaveReqVO.java new file mode 100644 index 0000000..3f7afd7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchDetailSaveReqVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import jakarta.validation.constraints.*; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 样品调拨明细新增/修改 Request VO") +@Data +public class BusinessSampleDispatchDetailSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20771") + private Long id; + + @Schema(description = "父ID", example = "828") + private Long parentId; + + @Schema(description = "子样数据ID", example = "828") + private Long businessSubSampleId; + + @Schema(description = "领用人") + private String borrowUser; + + @Schema(description = "领用人id", example = "22151") + private Long borrowUserId; + + @Schema(description = "领用时间") + private LocalDateTime borrowTime; + + @Schema(description = "领用状态,0-未领用;1-已领用", example = "1") + private String borrowStatus; + + @Schema(description = "归还人") + private String givebackUser; + + @Schema(description = "归还人id", example = "23976") + private Long givebackUserId; + + @Schema(description = "归还时间") + private LocalDateTime givebackTime; + + @Schema(description = "归还状态,0-未归还;1-已归还", example = "2") + private String givebackStatus; + + @Schema(description = "使用状态", example = "2") + private String useStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java new file mode 100644 index 0000000..78ebfdc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchPageReqVO.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 样品调拨分页 Request VO") +@Data +public class BusinessSampleDispatchPageReqVO extends PageParam { + + @Schema(description = "主管部门id", example = "14119") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "王五") + private String mainDepartmentName; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "20497") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "28216") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] applyTime; + + @Schema(description = "申请原因") + private String applyContent; + + @Schema(description = "库管员") + private String warehouseUser; + + @Schema(description = "库管员ID", example = "15295") + private Long warehouseUserId; + + @Schema(description = "提交状态,用于无申请调拨,0-未提交;1-已提交", example = "2") + private String submitStatus; + + @Schema(description = "流程实例id", example = "25006") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + private String flowStatus; + + @Schema(description = "完成状态", example = "1") + private String finishStatus; + + @Schema(description = "取消状态", example = "1") + private String cancelStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java new file mode 100644 index 0000000..5cc4f43 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchRespVO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 样品调拨 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSampleDispatchRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24883") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "主管部门id", example = "14119") + @ExcelProperty("主管部门id") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "王五") + @ExcelProperty("主管部门名称") + private String mainDepartmentName; + + @Schema(description = "申请人") + @ExcelProperty("申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "20497") + @ExcelProperty("申请人id") + private Long applyUserId; + + @Schema(description = "申请部门") + @ExcelProperty("申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "28216") + @ExcelProperty("申请部门id") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + @ExcelProperty("申请时间") + private LocalDateTime applyTime; + + @Schema(description = "申请原因") + @ExcelProperty("申请原因") + private String applyContent; + + @Schema(description = "库管员") + @ExcelProperty("库管员") + private String warehouseUser; + + @Schema(description = "库管员ID", example = "15295") + @ExcelProperty("库管员ID") + private Long warehouseUserId; + + @Schema(description = "提交状态,用于无申请调拨,0-未提交;1-已提交", example = "2") + @ExcelProperty("提交状态,用于无申请调拨,0-未提交;1-已提交") + private String submitStatus; + + @Schema(description = "流程实例id", example = "25006") + @ExcelProperty("流程实例id") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + @ExcelProperty("流程审批状态") + private String flowStatus; + + @Schema(description = "完成状态", example = "1") + @ExcelProperty("完成状态") + private String finishStatus; + + @Schema(description = "取消状态", example = "1") + @ExcelProperty("取消状态") + private String cancelStatus; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java new file mode 100644 index 0000000..221b983 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleDispatchSaveReqVO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import java.util.List; + +@Schema(description = "管理后台 - 样品调拨新增/修改 Request VO") +@Data +public class BusinessSampleDispatchSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24883") + private Long id; + + @Schema(description = "主管部门id", example = "14119") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "王五") + private String mainDepartmentName; + + @Schema(description = "申请人") + private String applyUser; + + @Schema(description = "申请人id", example = "20497") + private Long applyUserId; + + @Schema(description = "申请部门") + private String applyDepartment; + + @Schema(description = "申请部门id", example = "28216") + private Long applyDepartmentId; + + @Schema(description = "申请时间") + private LocalDateTime applyTime; + + @Schema(description = "申请原因") + private String applyContent; + + @Schema(description = "库管员") + private String warehouseUser; + + @Schema(description = "库管员ID", example = "15295") + private Long warehouseUserId; + + @Schema(description = "提交状态,用于无申请调拨,0-未提交;1-已提交", example = "2") + private String submitStatus; + + @Schema(description = "流程实例id", example = "25006") + private String flowInstanceId; + + @Schema(description = "流程审批状态", example = "1") + private String flowStatus; + + @Schema(description = "完成状态", example = "1") + private String finishStatus; + + @Schema(description = "取消状态", example = "1") + private String cancelStatus; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + //=========================扩展字段======================================= + @Schema(description = "新增子样id") + List addSubSampleIds; + + @Schema(description = "移除明细id") + List removeDetailIds; + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java index d2b23d4..c9ffcc6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailExtendRespVO.java @@ -7,6 +7,15 @@ import lombok.Data; @Data public class BusinessSampleEntrustDetailExtendRespVO extends BusinessSampleEntrustDetailRespVO { + /** 样品大类名称 **/ + private String baseSampleName; + + /** 主样配置id **/ + private Long configBaseSampleId; + + /** 打印标签 **/ + private String printTemplate; + private List sampleEntrustDetailProjectList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailPageReqVO.java index af26f26..e7cccb9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailPageReqVO.java @@ -13,19 +13,19 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSampleEntrustDetailPageReqVO extends PageParam { - @Schema(description = "检验委托登记ID", example = "3509") + @Schema(description = "检验委托登记ID", example = "17352") private Long businessSampleEntrustRegistrationId; - @Schema(description = "主样业务ID", example = "24710") + @Schema(description = "主样业务ID", example = "9560") private Long businessBaseSampleId; - @Schema(description = "样品大类ID", example = "10243") + @Schema(description = "样品大类ID", example = "1920") private Long baseSampleId; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等", example = "27392") - private Long dictionaryBusinessId; + @Schema(description = "样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等", example = "5244") + private Long sampleTypeDictionaryBusinessId; - @Schema(description = "样品名称", example = "芋艿") + @Schema(description = "样品名称", example = "李四") private String sampleName; @Schema(description = "样品编号") @@ -37,15 +37,15 @@ public class BusinessSampleEntrustDetailPageReqVO extends PageParam { @Schema(description = "委托样品编号") private String entrustSampleCode; - @Schema(description = "排序") - private Integer sort; - @Schema(description = "检测项目") private String assayProject; @Schema(description = "预报结果") private String forecastResult; + @Schema(description = "排序") + private Integer sort; + @Schema(description = "是否称重,1-启用,0-不启用") private Integer isWeighing; @@ -56,7 +56,7 @@ public class BusinessSampleEntrustDetailPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "12540") + @Schema(description = "乐观锁", example = "18310") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailReqVO.java new file mode 100644 index 0000000..6fa1b09 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailReqVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 委检登记样品明细分页 Request VO") +@Data +public class BusinessSampleEntrustDetailReqVO { + + @Schema(description = "检验委托登记ID", example = "17352") + private Long businessSampleEntrustRegistrationId; + + @Schema(description = "主样业务ID", example = "9560") + private Long businessBaseSampleId; + + @Schema(description = "样品大类ID", example = "1920") + private Long baseSampleId; + + @Schema(description = "样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等", example = "5244") + private Long sampleTypeDictionaryBusinessId; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "委托样品名称", example = "赵六") + private String entrustSampleName; + + @Schema(description = "委托样品编号") + private String entrustSampleCode; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "预报结果") + private String forecastResult; + + @Schema(description = "排序") + private Integer sort; + + @Schema(description = "是否称重,1-启用,0-不启用") + private Integer isWeighing; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "18310") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailRespVO.java index df900c2..b2df559 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailRespVO.java @@ -12,27 +12,27 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSampleEntrustDetailRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12340") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6935") @ExcelProperty("ID") private Long id; - @Schema(description = "检验委托登记ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3509") + @Schema(description = "检验委托登记ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17352") @ExcelProperty("检验委托登记ID") private Long businessSampleEntrustRegistrationId; - @Schema(description = "主样业务ID", example = "24710") + @Schema(description = "主样业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9560") @ExcelProperty("主样业务ID") private Long businessBaseSampleId; - @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1920") @ExcelProperty("样品大类ID") private Long baseSampleId; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等", requiredMode = Schema.RequiredMode.REQUIRED, example = "27392") - @ExcelProperty("样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等") - private Long dictionaryBusinessId; + @Schema(description = "样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等", requiredMode = Schema.RequiredMode.REQUIRED, example = "5244") + @ExcelProperty("样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等") + private Long sampleTypeDictionaryBusinessId; - @Schema(description = "样品名称", example = "芋艿") + @Schema(description = "样品名称", example = "李四") @ExcelProperty("样品名称") private String sampleName; @@ -48,11 +48,7 @@ public class BusinessSampleEntrustDetailRespVO { @ExcelProperty("委托样品编号") private String entrustSampleCode; - @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("排序") - private Integer sort; - - @Schema(description = "检测项目") + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("检测项目") private String assayProject; @@ -60,6 +56,10 @@ public class BusinessSampleEntrustDetailRespVO { @ExcelProperty("预报结果") private String forecastResult; + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("排序") + private Integer sort; + @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否称重,1-启用,0-不启用") private Integer isWeighing; @@ -72,7 +72,7 @@ public class BusinessSampleEntrustDetailRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", example = "12540") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18310") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailSaveReqVO.java index 961baa3..e96cfbd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustDetailSaveReqVO.java @@ -9,25 +9,26 @@ import jakarta.validation.constraints.*; @Data public class BusinessSampleEntrustDetailSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12340") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6935") private Long id; - @Schema(description = "检验委托登记ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3509") + @Schema(description = "检验委托登记ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17352") @NotNull(message = "检验委托登记ID不能为空") private Long businessSampleEntrustRegistrationId; - @Schema(description = "主样业务ID", example = "24710") + @Schema(description = "主样业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9560") + @NotNull(message = "主样业务ID不能为空") private Long businessBaseSampleId; - @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1920") @NotNull(message = "样品大类ID不能为空") private Long baseSampleId; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等", requiredMode = Schema.RequiredMode.REQUIRED, example = "27392") - @NotNull(message = "样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等不能为空") - private Long dictionaryBusinessId; + @Schema(description = "样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等", requiredMode = Schema.RequiredMode.REQUIRED, example = "5244") + @NotNull(message = "样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等不能为空") + private Long sampleTypeDictionaryBusinessId; - @Schema(description = "样品名称", example = "芋艿") + @Schema(description = "样品名称", example = "李四") private String sampleName; @Schema(description = "样品编号") @@ -41,16 +42,17 @@ public class BusinessSampleEntrustDetailSaveReqVO { @NotEmpty(message = "委托样品编号不能为空") private String entrustSampleCode; - @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "排序不能为空") - private Integer sort; - - @Schema(description = "检测项目") + @Schema(description = "检测项目", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测项目不能为空") private String assayProject; @Schema(description = "预报结果") private String forecastResult; + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "排序不能为空") + private Integer sort; + @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否称重,1-启用,0-不启用不能为空") private Integer isWeighing; @@ -58,7 +60,7 @@ public class BusinessSampleEntrustDetailSaveReqVO { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "乐观锁", example = "12540") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18310") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectPageReqVO.java index af46ce9..c445720 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectPageReqVO.java @@ -9,17 +9,17 @@ import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 委检样品检测项目业务分页 Request VO") +@Schema(description = "管理后台 - 委检登记样品检测项目分页 Request VO") @Data public class BusinessSampleEntrustProjectPageReqVO extends PageParam { - @Schema(description = "样品检验委托明细ID", example = "31234") + @Schema(description = "委托登记样品明细ID", example = "30574") private Long businessSampleEntrustDetailId; - @Schema(description = "物料检测标准检测项目ID", example = "1780") + @Schema(description = "物料检测标准检测项目ID", example = "32027") private Long materialAssayStandardDetailId; - @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", example = "29566") + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", example = "32209") private Long dictionaryProjectId; @Schema(description = "是否启用,1-启用,0-不启用") @@ -32,7 +32,7 @@ public class BusinessSampleEntrustProjectPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "22753") + @Schema(description = "乐观锁", example = "15928") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectRespVO.java index 53083e4..5ea468e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectRespVO.java @@ -7,24 +7,24 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 委检样品检测项目业务 Response VO") +@Schema(description = "管理后台 - 委检登记样品检测项目 Response VO") @Data @ExcelIgnoreUnannotated public class BusinessSampleEntrustProjectRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6960") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19565") @ExcelProperty("ID") private Long id; - @Schema(description = "样品检验委托明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31234") - @ExcelProperty("样品检验委托明细ID") + @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30574") + @ExcelProperty("委托登记样品明细ID") private Long businessSampleEntrustDetailId; - @Schema(description = "物料检测标准检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1780") + @Schema(description = "物料检测标准检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32027") @ExcelProperty("物料检测标准检测项目ID") private Long materialAssayStandardDetailId; - @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29566") + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32209") @ExcelProperty("检测项目ID,字典表:【T_DIC_PRJ】") private Long dictionaryProjectId; @@ -40,7 +40,7 @@ public class BusinessSampleEntrustProjectRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "22753") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "15928") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectSaveReqVO.java index b86ea87..93cd7e4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustProjectSaveReqVO.java @@ -5,22 +5,22 @@ import lombok.*; import java.util.*; import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 委检样品检测项目业务新增/修改 Request VO") +@Schema(description = "管理后台 - 委检登记样品检测项目新增/修改 Request VO") @Data public class BusinessSampleEntrustProjectSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6960") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19565") private Long id; - @Schema(description = "样品检验委托明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31234") - @NotNull(message = "样品检验委托明细ID不能为空") + @Schema(description = "委托登记样品明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30574") + @NotNull(message = "委托登记样品明细ID不能为空") private Long businessSampleEntrustDetailId; - @Schema(description = "物料检测标准检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1780") + @Schema(description = "物料检测标准检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32027") @NotNull(message = "物料检测标准检测项目ID不能为空") private Long materialAssayStandardDetailId; - @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29566") + @Schema(description = "检测项目ID,字典表:【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32209") @NotNull(message = "检测项目ID,字典表:【T_DIC_PRJ】不能为空") private Long dictionaryProjectId; @@ -29,11 +29,9 @@ public class BusinessSampleEntrustProjectSaveReqVO { private Integer isEnabled; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "22753") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "15928") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationExtendRespVO.java index 871e447..478e00c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationExtendRespVO.java @@ -14,9 +14,6 @@ public class BusinessSampleEntrustRegistrationExtendRespVO extends BusinessSampl @ExcelProperty("委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托") private String configEntrustSourceName; - @Schema(description = "委托单报表模板") - private String entrustReportTemplate; - @Schema(description = "样品称重数量") @ExcelProperty("样品称重数量") private Integer sampleWeighingCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java index 303318f..9b2e59d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationPageReqVO.java @@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { - @Schema(description = "委托ID", example = "9871") + @Schema(description = "委托ID", example = "8978") private Long entrustId; @Schema(description = "委托单号") @@ -22,7 +22,7 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { @Schema(description = "委托单位/送样单位") private String entrustUnit; - @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "28265") + @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "6609") private Long configEntrustSourceId; @Schema(description = "样品数量") @@ -37,9 +37,45 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { @Schema(description = "余样要求,【字典】【jy_sample_entrust_remaine_requirement】余样返回、放弃") private String remaineSampleRequirement; - @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", example = "1") + @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") + private String createWay; + + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") + private String entrustType; + + @Schema(description = "委托时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] entrustTime; + + @Schema(description = "送样人") + private String sampleSender; + + @Schema(description = "送样日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleSendDate; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleReceiveDate; + + @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", example = "2") private String sampleStatus; + @Schema(description = "扩展信息数据集ID,T_DAT_COLT_FLD", example = "9517") + private Long externalInfomationDataCollectionId; + + @Schema(description = "扩展信息") + private String externalInfomation; + + @Schema(description = "委托单模板ID", example = "13752") + private Long configReportTemplateId; + + @Schema(description = "委托单模板key") + private String configReportTemplateKey; + @Schema(description = "电话") private String tel; @@ -70,33 +106,19 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { @Schema(description = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择") private String assayMethod; - @Schema(description = "送样人") - private String sampleSender; - - @Schema(description = "送样日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] sampleSendDate; - - @Schema(description = "收样人") - private String sampleReceiver; - - @Schema(description = "收样日期") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] sampleReceiveDate; - - @Schema(description = "登记状态,register-登记中、submitted-已提交", example = "2") + @Schema(description = "登记状态,in_progress-登记中、submit-已提交", example = "1") private String registrationStatus; - @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "1") + @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "2") private String dataCheckStatus; - @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "1") + @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2") private String assayStatus; - @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "2") + @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1") private String dataStatus; - @Schema(description = "报告IDs", example = "1825") + @Schema(description = "报告IDs", example = "26875") private String documentMainId; @Schema(description = "报告发送方式,【字典】【jy_sample_entrust_send_way】自取、邮寄、电话、传真、E-mail") @@ -123,29 +145,13 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "9487") + @Schema(description = "乐观锁", example = "13676") private Integer updateCount; @Schema(description = "备注") private String remark; - @Schema(description = "扩展信息") - private String externalInfomation; - - @Schema(description = "数据集key,T_DAT_COLT_FLD", example = "29021") - private Long dataCollectionId; - - @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") - private String createWay; - - @Schema(description = "创建人") - private String createOperator; - - @Schema(description = "委托类型:委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") - private String entrustType; - - @Schema(description = "委托时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] entrustTime; - + //====================扩展字段====================== + @Schema(description = "委托来源名称") + private String configEntrustSourceName; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java index 8ced4f0..2d33f95 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSampleEntrustRegistrationRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13395") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23276") @ExcelProperty("ID") private Long id; - @Schema(description = "委托ID", example = "9871") + @Schema(description = "委托ID", example = "8978") @ExcelProperty("委托ID") private Long entrustId; @@ -28,7 +28,7 @@ public class BusinessSampleEntrustRegistrationRespVO { @ExcelProperty("委托单位/送样单位") private String entrustUnit; - @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "28265") + @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "6609") @ExcelProperty("委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托") private Long configEntrustSourceId; @@ -48,10 +48,54 @@ public class BusinessSampleEntrustRegistrationRespVO { @ExcelProperty("余样要求,【字典】【jy_sample_entrust_remaine_requirement】余样返回、放弃") private String remaineSampleRequirement; - @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", example = "1") + @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") + @ExcelProperty("创建方式,手动创建-manual、外部系统创建-interface") + private String createWay; + + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") + @ExcelProperty("委托类型,委托登记-entrust_registration、检验委托-entrust_inspection") + private String entrustType; + + @Schema(description = "委托时间") + @ExcelProperty("委托时间") + private LocalDateTime entrustTime; + + @Schema(description = "送样人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("送样人") + private String sampleSender; + + @Schema(description = "送样日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("送样日期") + private LocalDateTime sampleSendDate; + + @Schema(description = "收样人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("收样人") + private String sampleReceiver; + + @Schema(description = "收样日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("收样日期") + private LocalDateTime sampleReceiveDate; + + @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体") private String sampleStatus; + @Schema(description = "扩展信息数据集ID,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED, example = "9517") + @ExcelProperty("扩展信息数据集ID,T_DAT_COLT_FLD") + private Long externalInfomationDataCollectionId; + + @Schema(description = "扩展信息") + @ExcelProperty("扩展信息") + private String externalInfomation; + + @Schema(description = "委托单模板ID", example = "13752") + @ExcelProperty("委托单模板ID") + private Long configReportTemplateId; + + @Schema(description = "委托单模板key") + @ExcelProperty("委托单模板key") + private String configReportTemplateKey; + @Schema(description = "电话") @ExcelProperty("电话") private String tel; @@ -80,51 +124,35 @@ public class BusinessSampleEntrustRegistrationRespVO { @ExcelProperty("样品类别(装港/卸港),【字典】【jy_sample_entrust_category】装港样、卸港样") private String sampleCategory; - @Schema(description = "样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样") + @Schema(description = "样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样") private String sampleOrigin; - @Schema(description = "保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求") + @Schema(description = "保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求") private String secrecyRequire; - @Schema(description = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择") + @Schema(description = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择") private String assayMethod; - @Schema(description = "送样人") - @ExcelProperty("送样人") - private String sampleSender; - - @Schema(description = "送样日期") - @ExcelProperty("送样日期") - private LocalDateTime sampleSendDate; - - @Schema(description = "收样人") - @ExcelProperty("收样人") - private String sampleReceiver; - - @Schema(description = "收样日期") - @ExcelProperty("收样日期") - private LocalDateTime sampleReceiveDate; - - @Schema(description = "登记状态,register-登记中、submitted-已提交", example = "2") - @ExcelProperty("登记状态,register-登记中、submitted-已提交") + @Schema(description = "登记状态,in_progress-登记中、submit-已提交", example = "1") + @ExcelProperty("登记状态,in_progress-登记中、submit-已提交") private String registrationStatus; - @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "1") + @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "2") @ExcelProperty("数据校验状态,success-数据校验成功、fail-数据校验失败") private String dataCheckStatus; - @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "1") + @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2") @ExcelProperty("检验状态,unchecked-未检验;checked-已检验") private String assayStatus; - @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "2") + @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1") @ExcelProperty("数据回报状态,unreturned-未回报;returned-已回报") private String dataStatus; - @Schema(description = "报告IDs", example = "1825") + @Schema(description = "报告IDs", example = "26875") @ExcelProperty("报告IDs") private String documentMainId; @@ -156,35 +184,15 @@ public class BusinessSampleEntrustRegistrationRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "9487") + @Schema(description = "创建人") + private String creatorName; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13676") @ExcelProperty("乐观锁") private Integer updateCount; - @Schema(description = "备注") + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("备注") private String remark; - @Schema(description = "扩展信息") - @ExcelProperty("扩展信息") - private String externalInfomation; - - @Schema(description = "数据集key,T_DAT_COLT_FLD", example = "29021") - @ExcelProperty("数据集key,T_DAT_COLT_FLD") - private Long dataCollectionId; - - @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") - @ExcelProperty("创建方式,手动创建-manual、外部系统创建-interface") - private String createWay; - - @Schema(description = "创建人") - @ExcelProperty("创建人") - private String createOperator; - - @Schema(description = "委托类型:委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") - @ExcelProperty("委托类型:委托登记-entrust_registration、检验委托-entrust_inspection") - private String entrustType; - - @Schema(description = "委托时间") - private LocalDateTime entrustTime; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationSaveReqVO.java index 4f876f6..93378ce 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleEntrustRegistrationSaveReqVO.java @@ -11,10 +11,10 @@ import java.time.LocalDateTime; @Data public class BusinessSampleEntrustRegistrationSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13395") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23276") private Long id; - @Schema(description = "委托ID", example = "9871") + @Schema(description = "委托ID", example = "8978") private Long entrustId; @Schema(description = "委托单号", requiredMode = Schema.RequiredMode.REQUIRED) @@ -25,7 +25,7 @@ public class BusinessSampleEntrustRegistrationSaveReqVO { @NotEmpty(message = "委托单位/送样单位不能为空") private String entrustUnit; - @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "28265") + @Schema(description = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "6609") @NotNull(message = "委托来源,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托不能为空") private Long configEntrustSourceId; @@ -43,9 +43,48 @@ public class BusinessSampleEntrustRegistrationSaveReqVO { @NotEmpty(message = "余样要求,【字典】【jy_sample_entrust_remaine_requirement】余样返回、放弃不能为空") private String remaineSampleRequirement; - @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", example = "1") + @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") + private String createWay; + + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") + private String entrustType; + + @Schema(description = "委托时间") + private LocalDateTime entrustTime; + + @Schema(description = "送样人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "送样人不能为空") + private String sampleSender; + + @Schema(description = "送样日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "送样日期不能为空") + private LocalDateTime sampleSendDate; + + @Schema(description = "收样人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "收样人不能为空") + private String sampleReceiver; + + @Schema(description = "收样日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "收样日期不能为空") + private LocalDateTime sampleReceiveDate; + + @Schema(description = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体不能为空") private String sampleStatus; + @Schema(description = "扩展信息数据集ID,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED, example = "9517") + @NotNull(message = "扩展信息数据集ID,T_DAT_COLT_FLD不能为空") + private Long externalInfomationDataCollectionId; + + @Schema(description = "扩展信息") + private String externalInfomation; + + @Schema(description = "委托单模板ID", example = "13752") + private Long configReportTemplateId; + + @Schema(description = "委托单模板key") + private String configReportTemplateKey; + @Schema(description = "电话") private String tel; @@ -67,40 +106,31 @@ public class BusinessSampleEntrustRegistrationSaveReqVO { @Schema(description = "样品类别(装港/卸港),【字典】【jy_sample_entrust_category】装港样、卸港样") private String sampleCategory; - @Schema(description = "样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样") + @Schema(description = "样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "样品来源,【字典】【jy_sample_entrust_origin】送样、邮寄、现场取样不能为空") private String sampleOrigin; - @Schema(description = "保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求") + @Schema(description = "保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "保密要求,【字典】【jy_sample_entrust_secrecy_requirement】要求对样品和文件保密、无保密要求不能为空") private String secrecyRequire; - @Schema(description = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择") + @Schema(description = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测方法,【字典】【jy_sample_entrust_assay_method】国标、行标、客户要求、检测方依据样品选择不能为空") private String assayMethod; - @Schema(description = "送样人") - private String sampleSender; - - @Schema(description = "送样日期") - private LocalDateTime sampleSendDate; - - @Schema(description = "收样人") - private String sampleReceiver; - - @Schema(description = "收样日期") - private LocalDateTime sampleReceiveDate; - - @Schema(description = "登记状态,register-登记中、submitted-已提交", example = "2") + @Schema(description = "登记状态,in_progress-登记中、submit-已提交", example = "1") private String registrationStatus; - @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "1") + @Schema(description = "数据校验状态,success-数据校验成功、fail-数据校验失败", example = "2") private String dataCheckStatus; - @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "1") + @Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2") private String assayStatus; - @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "2") + @Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1") private String dataStatus; - @Schema(description = "报告IDs", example = "1825") + @Schema(description = "报告IDs", example = "26875") private String documentMainId; @Schema(description = "报告发送方式,【字典】【jy_sample_entrust_send_way】自取、邮寄、电话、传真、E-mail") @@ -121,29 +151,11 @@ public class BusinessSampleEntrustRegistrationSaveReqVO { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "9487") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "13676") private Integer updateCount; - @Schema(description = "备注") + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "备注不能为空") private String remark; - @Schema(description = "扩展信息") - private String externalInfomation; - - @Schema(description = "数据集key,T_DAT_COLT_FLD", example = "29021") - private Long dataCollectionId; - - @Schema(description = "创建方式,手动创建-manual、外部系统创建-interface") - private String createWay; - - @Schema(description = "创建人") - private String createOperator; - - @Schema(description = "委托类型:委托登记-entrust_registration、检验委托-entrust_inspection", example = "2") - private String entrustType; - - @Schema(description = "委托时间") - private LocalDateTime entrustTime; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailPageReqVO.java index 640a4c3..32556ca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailPageReqVO.java @@ -14,13 +14,13 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSampleHandoverDetailPageReqVO extends PageParam { - @Schema(description = "交接单ID", example = "7637") + @Schema(description = "交接单ID", example = "12067") private Long businessSampleHandoverId; - @Schema(description = "样品子样ID", example = "14005") + @Schema(description = "分样子样ID", example = "17670") private Long businessSubSampleId; - @Schema(description = "样品名称", example = "李四") + @Schema(description = "样品名称", example = "王五") private String sampleName; @Schema(description = "样品编号") @@ -32,16 +32,16 @@ public class BusinessSampleHandoverDetailPageReqVO extends PageParam { @Schema(description = "天平编号") private String balanceCode; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", example = "29761") + @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", example = "15453") private Long dictionaryBusinessId; - @Schema(description = "样品类型", example = "王五") + @Schema(description = "样品类型", example = "芋艿") private String dictionaryBusinessName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java index b979304..54cf9e6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailRespVO.java @@ -13,19 +13,19 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSampleHandoverDetailRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30266") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10448") @ExcelProperty("ID") private Long id; - @Schema(description = "交接单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7637") + @Schema(description = "交接单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12067") @ExcelProperty("交接单ID") private Long businessSampleHandoverId; - @Schema(description = "样品子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14005") - @ExcelProperty("样品子样ID") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @ExcelProperty("分样子样ID") private Long businessSubSampleId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("样品名称") private String sampleName; @@ -41,11 +41,11 @@ public class BusinessSampleHandoverDetailRespVO { @ExcelProperty("天平编号") private String balanceCode; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29761") + @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", requiredMode = Schema.RequiredMode.REQUIRED, example = "15453") @ExcelProperty("样品类型ID,字典表:【T_DIC_BSN】") private Long dictionaryBusinessId; - @Schema(description = "样品类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @Schema(description = "样品类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("样品类型") private String dictionaryBusinessName; @@ -53,8 +53,8 @@ public class BusinessSampleHandoverDetailRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailSaveReqVO.java index 8de5ed1..d0d5d3c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverDetailSaveReqVO.java @@ -10,18 +10,18 @@ import java.math.BigDecimal; @Data public class BusinessSampleHandoverDetailSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30266") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10448") private Long id; - @Schema(description = "交接单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7637") + @Schema(description = "交接单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12067") @NotNull(message = "交接单ID不能为空") private Long businessSampleHandoverId; - @Schema(description = "样品子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14005") - @NotNull(message = "样品子样ID不能为空") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") + @NotNull(message = "分样子样ID不能为空") private Long businessSubSampleId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "样品名称不能为空") private String sampleName; @@ -34,16 +34,15 @@ public class BusinessSampleHandoverDetailSaveReqVO { @Schema(description = "天平编号") private String balanceCode; - @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29761") + @Schema(description = "样品类型ID,字典表:【T_DIC_BSN】", requiredMode = Schema.RequiredMode.REQUIRED, example = "15453") @NotNull(message = "样品类型ID,字典表:【T_DIC_BSN】不能为空") private Long dictionaryBusinessId; - @Schema(description = "样品类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @Schema(description = "样品类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "样品类型不能为空") private String dictionaryBusinessName; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java index cbdb0be..637fa35 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverPageReqVO.java @@ -16,17 +16,20 @@ public class BusinessSampleHandoverPageReqVO extends PageParam { @Schema(description = "交接单编号") private String code; - @Schema(description = "交接单名称", example = "赵六") + @Schema(description = "交接单名称", example = "芋艿") private String name; - @Schema(description = "交接单模版Key") - private String templateKey; + @Schema(description = "交接单模板ID", example = "29613") + private Long configReportTemplateId; - @Schema(description = "样品流程ID", example = "27863") - private String sampleFlowId; + @Schema(description = "交接单模板key") + private String configReportTemplateKey; - @Schema(description = "样品流程code") - private String sampleFlowCode; + @Schema(description = "样品流程配置ID", example = "9154") + private Long configSampleFlowId; + + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁", example = "2") private String operationType; @@ -38,7 +41,7 @@ public class BusinessSampleHandoverPageReqVO extends PageParam { @Schema(description = "操作人") private String operator; - @Schema(description = "操作人ID", example = "8793") + @Schema(description = "操作人ID", example = "32492") private Long operatorId; @Schema(description = "流程模型Key") @@ -50,7 +53,7 @@ public class BusinessSampleHandoverPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverRespVO.java index f9c034a..d39f85a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverRespVO.java @@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSampleHandoverRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16517") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13208") @ExcelProperty("ID") private Long id; @@ -20,21 +20,23 @@ public class BusinessSampleHandoverRespVO { @ExcelProperty("交接单编号") private String code; - @Schema(description = "交接单名称", example = "赵六") + @Schema(description = "交接单名称", example = "芋艿") @ExcelProperty("交接单名称") private String name; - @Schema(description = "交接单模版Key") - @ExcelProperty("交接单模版Key") - private String templateKey; + @Schema(description = "交接单模板ID", example = "29613") + @ExcelProperty("交接单模板ID") + private Long configReportTemplateId; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27863") - @ExcelProperty("样品流程ID") - private String sampleFlowId; + @Schema(description = "交接单模板key") + @ExcelProperty("交接单模板key") + private String configReportTemplateKey; - @Schema(description = "样品流程code", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品流程code") - private String sampleFlowCode; + @Schema(description = "样品流程配置ID", example = "9154") + private Long configSampleFlowId; + + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁") @@ -48,7 +50,7 @@ public class BusinessSampleHandoverRespVO { @ExcelProperty("操作人") private String operator; - @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8793") + @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32492") @ExcelProperty("操作人ID") private Long operatorId; @@ -60,12 +62,12 @@ public class BusinessSampleHandoverRespVO { @ExcelProperty("流程流水号") private String flowSerialNumber; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverSaveReqVO.java index c77ab6e..1859533 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSampleHandoverSaveReqVO.java @@ -11,26 +11,27 @@ import java.time.LocalDateTime; @Data public class BusinessSampleHandoverSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16517") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13208") private Long id; @Schema(description = "交接单编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "交接单编号不能为空") + @NotEmpty(message = "交接单编号不能为空") private String code; - @Schema(description = "交接单名称", example = "赵六") + @Schema(description = "交接单名称", example = "芋艿") private String name; - @Schema(description = "交接单模版Key") - private String templateKey; + @Schema(description = "交接单模板ID", example = "29613") + private Long configReportTemplateId; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27863") - @NotEmpty(message = "样品流程ID不能为空") - private String sampleFlowId; + @Schema(description = "交接单模板key") + private String configReportTemplateKey; - @Schema(description = "样品流程code", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "样品流程code不能为空") - private String sampleFlowCode; + @Schema(description = "样品流程配置ID", example = "9154") + private Long configSampleFlowId; + + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; @Schema(description = "操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotEmpty(message = "操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁不能为空") @@ -44,7 +45,7 @@ public class BusinessSampleHandoverSaveReqVO { @NotEmpty(message = "操作人不能为空") private String operator; - @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8793") + @Schema(description = "操作人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32492") @NotNull(message = "操作人ID不能为空") private Long operatorId; @@ -54,8 +55,7 @@ public class BusinessSampleHandoverSaveReqVO { @Schema(description = "流程流水号") private String flowSerialNumber; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleExtendRespVO.java new file mode 100644 index 0000000..59cf8ed --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleExtendRespVO.java @@ -0,0 +1,26 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; +import java.util.stream.Collectors; + +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; + +import cn.hutool.core.collection.CollUtil; +import lombok.Data; + +@Data +public class BusinessStandardSampleExtendRespVO extends BusinessStandardSampleRespVO { + + private Long configQCSampleMethodId; + + private String standardSampleProjects; + + public String getStandardSampleProjects() { + if (CollUtil.isNotEmpty(this.standardSampleProjectList)) { + return this.standardSampleProjectList.stream().map(m -> m.getDictionaryProjectName() + "(" + m.getDictionaryProjectUnit() + "):" + m.getStandardValue()).collect(Collectors.joining(",")); + } + return null; + } + + private List standardSampleProjectList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSamplePageReqVO.java new file mode 100644 index 0000000..6209ec8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSamplePageReqVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 定值样业务分页 Request VO") +@Data +public class BusinessStandardSamplePageReqVO extends PageParam { + + @Schema(description = "ID路径") + private String idPath; + + @Schema(description = "上级ID", example = "9719") + private Long parentId; + + @Schema(description = "名称,一级:管理样、标准样、标样;二级:具体定值样", example = "赵六") + private String name; + + @Schema(description = "编号") + private String code; + + @Schema(description = "是否启用,1-启用,0-不启用") + private Integer isUse; + + @Schema(description = "是否发布,1-是,0-否") + private Integer isPublish; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectPageReqVO.java new file mode 100644 index 0000000..49d8324 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectPageReqVO.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 定值样检测项目业务分页 Request VO") +@Data +public class BusinessStandardSampleProjectPageReqVO extends PageParam { + + @Schema(description = "定值样ID", example = "17499") + private Long businessStandardSampleId; + + @Schema(description = "定值样元素配置ID", example = "10892") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID", example = "7881") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称", example = "张三") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + private String standardValue; + + @Schema(description = "标准允差值") + private String standardToleraanceValue; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectRespVO.java new file mode 100644 index 0000000..de96ae4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectRespVO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 定值样检测项目业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessStandardSampleProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30840") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "定值样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17499") + @ExcelProperty("定值样ID") + private Long businessStandardSampleId; + + @Schema(description = "定值样元素配置ID", example = "10892") + @ExcelProperty("定值样元素配置ID") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7881") + @ExcelProperty("检测项目ID") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("检测项目名称") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + @ExcelProperty("检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + @ExcelProperty("标准值") + private String standardValue; + + @Schema(description = "标准允差值") + @ExcelProperty("标准允差值") + private String standardToleraanceValue; + + @Schema(description = "小数位", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectSaveReqVO.java new file mode 100644 index 0000000..91381d3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleProjectSaveReqVO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 定值样检测项目业务新增/修改 Request VO") +@Data +public class BusinessStandardSampleProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30840") + private Long id; + + @Schema(description = "定值样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17499") + @NotNull(message = "定值样ID不能为空") + private Long businessStandardSampleId; + + @Schema(description = "定值样元素配置ID", example = "10892") + private Long configStandardSampleProjectId; + + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7881") + @NotNull(message = "检测项目ID不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "检测项目名称不能为空") + private String dictionaryProjectName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "标准值") + private String standardValue; + + @Schema(description = "标准允差值") + private String standardToleraanceValue; + + @Schema(description = "小数位", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "小数位不能为空") + private Integer decimalPosition; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleReqVO.java new file mode 100644 index 0000000..92461da --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleReqVO.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 定值样业务分页 Request VO") +@Data +public class BusinessStandardSampleReqVO { + + @Schema(description = "ID路径") + private String idPath; + + @Schema(description = "上级ID", example = "9719") + private Long parentId; + + @Schema(description = "名称,一级:管理样、标准样、标样;二级:具体定值样", example = "赵六") + private String name; + + @Schema(description = "编号") + private String code; + + @Schema(description = "是否启用,1-启用,0-不启用") + private Integer isUse; + + @Schema(description = "是否发布,1-是,0-否") + private Integer isPublish; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleRespVO.java new file mode 100644 index 0000000..a13a352 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleRespVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 定值样业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessStandardSampleRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22309") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "ID路径") + @ExcelProperty("ID路径") + private String idPath; + + @Schema(description = "上级ID", example = "9719") + @ExcelProperty("上级ID") + private Long parentId; + + @Schema(description = "名称,一级:管理样、标准样、标样;二级:具体定值样", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("名称,一级:管理样、标准样、标样;二级:具体定值样") + private String name; + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("编号") + private String code; + + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用,1-启用,0-不启用") + private Integer isUse; + + @Schema(description = "是否发布,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否发布,1-是,0-否") + private Integer isPublish; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleSaveReqVO.java new file mode 100644 index 0000000..0806574 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessStandardSampleSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 定值样业务新增/修改 Request VO") +@Data +public class BusinessStandardSampleSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22309") + private Long id; + + @Schema(description = "ID路径") + private String idPath; + + @Schema(description = "上级ID", example = "9719") + private Long parentId; + + @Schema(description = "名称,一级:管理样、标准样、标样;二级:具体定值样", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "名称,一级:管理样、标准样、标样;二级:具体定值样不能为空") + private String name; + + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "编号不能为空") + private String code; + + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否启用,1-启用,0-不启用不能为空") + private Integer isUse; + + @Schema(description = "是否发布,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否发布,1-是,0-否不能为空") + private Integer isPublish; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java new file mode 100644 index 0000000..7ca9494 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentExtendRespVO.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubParentSampleAssessmentExtendRespVO extends BusinessSubParentSampleAssessmentRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; + + @Schema(description = "分析方法") + private String configAssayMethodName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java new file mode 100644 index 0000000..08373a7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentGroupRespVO.java @@ -0,0 +1,13 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class BusinessSubParentSampleAssessmentGroupRespVO { + + private Long configAssayMethodId; + + private String configAssayMethodName; + + private Integer sampleCount; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java new file mode 100644 index 0000000..b0ba2e4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentPageReqVO.java @@ -0,0 +1,78 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 班组判定数据业务分页 Request VO") +@Data +public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam { + + @Schema(description = "样品分样ID", example = "23188") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "17642") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", example = "7653") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", example = "16271") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "16999") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java new file mode 100644 index 0000000..26572f0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentRespVO.java @@ -0,0 +1,94 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 班组判定数据业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSubParentSampleAssessmentRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + @ExcelProperty("判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java new file mode 100644 index 0000000..436b51a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleAssessmentSaveReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 班组判定数据业务新增/修改 Request VO") +@Data +public class BusinessSubParentSampleAssessmentSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014") + private Long id; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "判定值") + private String assessmentValue; + + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差不能为空") + private String assessmentStatus; + + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否已上报不能为空") + private Integer isReported; + + @Schema(description = "上报人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "上报人不能为空") + private String reporter; + + @Schema(description = "上报时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "上报时间不能为空") + private LocalDateTime reportTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSamplePageReqVO.java index 454f4c6..67427e7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSamplePageReqVO.java @@ -13,16 +13,16 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSubParentSamplePageReqVO extends PageParam { - @Schema(description = "样品ID", example = "18364") + @Schema(description = "样品ID", example = "28356") private Long sampleId; - @Schema(description = "样品主样ID", example = "26057") + @Schema(description = "样品主样ID", example = "26456") private Long businessBaseSampleId; - @Schema(description = "分样配置ID", example = "2344") + @Schema(description = "分样配置ID", example = "13475") private Long configSubSampleParentId; - @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", example = "21472") + @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", example = "12061") private Long dictionaryBusinessId; @Schema(description = "样品编号") @@ -47,10 +47,10 @@ public class BusinessSubParentSamplePageReqVO extends PageParam { @Schema(description = "审核流程code") private String auditFlowCode; - @Schema(description = "超差标注", example = "2") - private Integer assessmentStatus; + @Schema(description = "超差标注", example = "1") + private String assessmentStatus; - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "2") + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "1") private String sampleStatus; @Schema(description = "是否启用,1-启用,0-不启用") @@ -59,11 +59,11 @@ public class BusinessSubParentSamplePageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "4381") + @Schema(description = "乐观锁", example = "21148") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleRespVO.java index 4c0d413..4c85eca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleRespVO.java @@ -12,23 +12,23 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSubParentSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25832") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7844") @ExcelProperty("ID") private Long id; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18364") + @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28356") @ExcelProperty("样品ID") private Long sampleId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26057") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26456") @ExcelProperty("样品主样ID") private Long businessBaseSampleId; - @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2344") + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13475") @ExcelProperty("分样配置ID") private Long configSubSampleParentId; - @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", requiredMode = Schema.RequiredMode.REQUIRED, example = "21472") + @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", requiredMode = Schema.RequiredMode.REQUIRED, example = "12061") @ExcelProperty("分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样") private Long dictionaryBusinessId; @@ -60,11 +60,11 @@ public class BusinessSubParentSampleRespVO { @ExcelProperty("审核流程code") private String auditFlowCode; - @Schema(description = "超差标注", example = "2") + @Schema(description = "超差标注", example = "1") @ExcelProperty("超差标注") - private Integer assessmentStatus; + private String assessmentStatus; - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废") private String sampleStatus; @@ -76,11 +76,11 @@ public class BusinessSubParentSampleRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4381") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "21148") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleSaveReqVO.java index 0528a44..eeaf076 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubParentSampleSaveReqVO.java @@ -11,22 +11,22 @@ import java.time.LocalDateTime; @Data public class BusinessSubParentSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25832") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7844") private Long id; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18364") + @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28356") @NotNull(message = "样品ID不能为空") private Long sampleId; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26057") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26456") @NotNull(message = "样品主样ID不能为空") private Long businessBaseSampleId; - @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2344") + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13475") @NotNull(message = "分样配置ID不能为空") private Long configSubSampleParentId; - @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", requiredMode = Schema.RequiredMode.REQUIRED, example = "21472") + @Schema(description = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样", requiredMode = Schema.RequiredMode.REQUIRED, example = "12061") @NotNull(message = "分样类型ID,字典表:【T_DIC_BSN】化学样、试金样、仪器样不能为空") private Long dictionaryBusinessId; @@ -54,10 +54,10 @@ public class BusinessSubParentSampleSaveReqVO { @Schema(description = "审核流程code") private String auditFlowCode; - @Schema(description = "超差标注", example = "2") - private Integer assessmentStatus; + @Schema(description = "超差标注", example = "1") + private String assessmentStatus; - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空") private String sampleStatus; @@ -66,11 +66,9 @@ public class BusinessSubParentSampleSaveReqVO { private Integer isEnabled; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4381") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "21148") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java new file mode 100644 index 0000000..0739593 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupPageReqVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 子样分析班组业务分页 Request VO") +@Data +public class BusinessSubSampleAnalysisGroupPageReqVO extends PageParam { + + @Schema(description = "样品主样ID", example = "25096") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "23696") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "17149") + private Long businessSubSampleId; + + @Schema(description = "分析部门ID", example = "2493") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + private String assayDepartmentName; + + @Schema(description = "样品状态", example = "1") + private String sampleStatus; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleReceiveTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "16821") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java new file mode 100644 index 0000000..7382885 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupRespVO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 子样分析班组业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSubSampleAnalysisGroupRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3097") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25096") + @ExcelProperty("样品主样ID") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23696") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17149") + @ExcelProperty("分样子样ID") + private Long businessSubSampleId; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2493") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + + @Schema(description = "样品状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("样品状态") + private String sampleStatus; + + @Schema(description = "收样人") + @ExcelProperty("收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + @ExcelProperty("收样时间") + private LocalDateTime sampleReceiveTime; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16821") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java new file mode 100644 index 0000000..d163842 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAnalysisGroupSaveReqVO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 子样分析班组业务新增/修改 Request VO") +@Data +public class BusinessSubSampleAnalysisGroupSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3097") + private Long id; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25096") + @NotNull(message = "样品主样ID不能为空") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23696") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17149") + @NotNull(message = "分样子样ID不能为空") + private Long businessSubSampleId; + + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2493") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "赵六") + private String assayDepartmentName; + + @Schema(description = "样品状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "样品状态不能为空") + private String sampleStatus; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16821") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java new file mode 100644 index 0000000..4fcaf8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubSampleAssessmentExtendRespVO extends BusinessSubSampleAssessmentRespVO { + + /** 分析方法名称 **/ + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java index 906d006..a46f4c5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentPageReqVO.java @@ -13,25 +13,34 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSubSampleAssessmentPageReqVO extends PageParam { - @Schema(description = "子样样ID", example = "21287") + @Schema(description = "分样id") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "7025") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "19965") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "21744") private Long dictionaryProjectId; - @Schema(description = "检测方法分析项目配置ID", example = "11904") + @Schema(description = "检测方法分析项目配置ID", example = "14847") private Long configAssayMethodProjectId; - @Schema(description = "检测方法配置ID", example = "11800") + @Schema(description = "检测方法配置ID", example = "8091") private Long configAssayMethodId; - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "1") - private Long taskType; + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", example = "1") - private Long assayType; + @Schema(description = "符号,=、>、<、等") + private String symbol; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") private String dataType; @Schema(description = "小数位") @@ -40,9 +49,12 @@ public class BusinessSubSampleAssessmentPageReqVO extends PageParam { @Schema(description = "判定值") private String assessmentValue; - @Schema(description = "超差标注", example = "1") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") private String assessmentStatus; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否已上报") private Integer isReported; @@ -53,17 +65,14 @@ public class BusinessSubSampleAssessmentPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] reportTime; - @Schema(description = "复检次数", example = "3971") - private Integer recheckCount; - @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "21743") + @Schema(description = "乐观锁", example = "12836") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java index 310c614..8a0b34a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentRespVO.java @@ -12,36 +12,45 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSubSampleAssessmentRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18232") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") @ExcelProperty("ID") private Long id; + + @Schema(description = "分样id") + private Long businessSubParentSampleId; - @Schema(description = "子样样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21287") - @ExcelProperty("子样样ID") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") + @ExcelProperty("分样子样ID") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "19965") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") private Long dictionaryProjectId; - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11904") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") @ExcelProperty("检测方法分析项目配置ID") private Long configAssayMethodProjectId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11800") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "符号,=、>、<、等") + private String symbol; + + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("任务类型,【字典】【jy_sample_task_type】常规、抽查...") - private Long taskType; + private String taskType; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...") - private Long assayType; + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...") + private String assayType; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") private String dataType; @Schema(description = "小数位") @@ -52,10 +61,13 @@ public class BusinessSubSampleAssessmentRespVO { @ExcelProperty("判定值") private String assessmentValue; - @Schema(description = "超差标注", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("超差标注") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") + @ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差") private String assessmentStatus; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否已上报") private Integer isReported; @@ -68,19 +80,15 @@ public class BusinessSubSampleAssessmentRespVO { @ExcelProperty("上报时间") private LocalDateTime reportTime; - @Schema(description = "复检次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "3971") - @ExcelProperty("复检次数") - private Integer recheckCount; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "21743") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java index c53e983..62f5df2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentSaveReqVO.java @@ -11,35 +11,44 @@ import java.time.LocalDateTime; @Data public class BusinessSubSampleAssessmentSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18232") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478") private Long id; + + @Schema(description = "分样id") + private Long businessSubParentSampleId; - @Schema(description = "子样样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21287") - @NotNull(message = "子样样ID不能为空") + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025") + @NotNull(message = "分样子样ID不能为空") private Long businessSubSampleId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "19965") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "21744") @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") private Long dictionaryProjectId; - @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11904") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14847") @NotNull(message = "检测方法分析项目配置ID不能为空") private Long configAssayMethodProjectId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11800") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8091") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") - private Long taskType; + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; - @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...不能为空") - private Long assayType; + @Schema(description = "符号,=、>、<、等") + private String symbol; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") + @Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "任务类型,【字典】【jy_sample_task_type】常规、抽查...不能为空") + private String taskType; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...不能为空") + private String assayType; + + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") private String dataType; @Schema(description = "小数位") @@ -48,10 +57,12 @@ public class BusinessSubSampleAssessmentSaveReqVO { @Schema(description = "判定值") private String assessmentValue; - @Schema(description = "超差标注", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "超差标注不能为空") + @Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1") private String assessmentStatus; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否已上报不能为空") private Integer isReported; @@ -64,16 +75,10 @@ public class BusinessSubSampleAssessmentSaveReqVO { @NotNull(message = "上报时间不能为空") private LocalDateTime reportTime; - @Schema(description = "复检次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "3971") - @NotNull(message = "复检次数不能为空") - private Integer recheckCount; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "21743") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "12836") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java index 58bb0cd..81c345c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleExtendRespVO.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.util.List; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -9,5 +11,22 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO { /** 子样类型名称 **/ @Schema(description = "子样类型名称") private String dictionaryBusinessName; + + @Schema(description = "分析任务数") + private Integer assayTaskCount; + + @Schema(description = "子样检测方法") + private List businessAssayTaskDataList; + @Schema(description = "是否打印") + private Integer isPrint; + + @Schema(description = "样品标签打印模版") + private String printTemplate; + + @Schema(description = "库位编码") + private String warehouseLocationCode; + + @Schema(description = "仓库名称") + private String warehouseName; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java index c30ccc5..01c5f67 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSamplePageReqVO.java @@ -1,14 +1,12 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; - -import com.alibaba.excel.annotation.ExcelProperty; - import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -17,28 +15,28 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessSubSamplePageReqVO extends PageParam { - @Schema(description = "样品主样ID", example = "11587") + @Schema(description = "样品主样ID", example = "10824") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", example = "2157") + @Schema(description = "样品分样ID", example = "31262") private Long businessSubParentSampleId; - @Schema(description = "子样配置ID", example = "20299") + @Schema(description = "子样配置ID", example = "19843") private Long configSubSampleId; - @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", example = "30304") + @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", example = "25153") private Long dictionaryBusinessId; - @Schema(description = "库位信息ID", example = "28807") + @Schema(description = "库位信息ID", example = "5479") private Long configWarehouseLocationInfomationId; - @Schema(description = "样品ID", example = "13062") + @Schema(description = "样品ID", example = "15518") private Long sampleId; - @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "29885") + @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "16918") private String groupId; - @Schema(description = "样品名称", example = "赵六") + @Schema(description = "样品名称", example = "张三") private String sampleName; @Schema(description = "样品编号") @@ -50,33 +48,40 @@ public class BusinessSubSamplePageReqVO extends PageParam { @Schema(description = "归库编号") private String sampleReturnCode; - @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否称重,1-启用,0-不启用") private Integer isWeighing; - @Schema(description = "末次样品重量") + @Schema(description = "末次重量,末次样品重量") private BigDecimal lastSampleWeight; - @Schema(description = "样品流程ID", example = "18294") - private Long sampleFlowId; + @Schema(description = "末次称重天平编号") + private String lastBalanceCode; - @Schema(description = "样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程配置ID", example = "15413") + private Long configSampleFlowId; - @Schema(description = "下一步样品流程名称") - private String nextSampleFlow; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "是否已生成归库码") - private Integer isGenerateReturnCode; + @Schema(description = "样品流程节点时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleFlowNodeTime; - @Schema(description = "任务指派给分析人") + @Schema(description = "下一步样品流程节点名称") + private String nextSampleFlowNode; + + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "1") + private String sampleStatus; + + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; - @Schema(description = "指派时间") + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] taskTime; + private LocalDateTime[] assignTaskTime; @Schema(description = "是否已上报") private Integer isReported; @@ -92,40 +97,43 @@ public class BusinessSubSamplePageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] returnTime; - @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "1") - private Integer returnStatus; + @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2") + private String returnStatus; - @Schema(description = "打印次数", example = "28859") + @Schema(description = "调拨状态") + private String dispatchStatus; + + @Schema(description = "打印次数", example = "32651") private Integer returnCodePrintCount; @Schema(description = "末次打印时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] printLastTime; - @Schema(description = "样品流程节点时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] sampleFlowTime; - - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "2") - private String sampleStatus; - - @Schema(description = "是否启用,1-启用,0-不启用") - private Integer isEnabled; + @Schema(description = "上一个交接记录ID", example = "29555") + private Long upSampleRecordId; @Schema(description = "分析元素备注") private String analysisRemark; + @Schema(description = "是否启用,1-启用,0-不启用") + private Integer isEnabled; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "8971") + @Schema(description = "乐观锁", example = "28696") private Integer updateCount; @Schema(description = "备注") private String remark; + //扩展字段 + @Schema(description = "库位编码") + private String warehouseLocationCode; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java new file mode 100644 index 0000000..c3646a8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckPageReqVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 分样复检业务数据分页 Request VO") +@Data +public class BusinessSubSampleParentRecheckPageReqVO extends PageParam { + + @Schema(description = "样品ID", example = "19065") + private Long sampleId; + + @Schema(description = "样品主样ID", example = "26605") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "29386") + private Long businessSubParentSampleId; + + @Schema(description = "检测方法配置ID", example = "19087") + private Long configAssayMethodId; + + @Schema(description = "复检样品主样ID", example = "12742") + private Long recheckBusinessBaseSampleId; + + @Schema(description = "复检样品分样ID", example = "24043") + private Long recheckBusinessSubParentSampleId; + + @Schema(description = "复检检测方法配置ID", example = "4026") + private Long recheckConfigAssayMethodId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "乐观锁", example = "18382") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java new file mode 100644 index 0000000..dc1a051 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckRespVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 分样复检业务数据 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessSubSampleParentRecheckRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "样品ID", example = "19065") + @ExcelProperty("样品ID") + private Long sampleId; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605") + @ExcelProperty("样品主样ID") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742") + @ExcelProperty("复检样品主样ID") + private Long recheckBusinessBaseSampleId; + + @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043") + @ExcelProperty("复检样品分样ID") + private Long recheckBusinessSubParentSampleId; + + @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026") + @ExcelProperty("复检检测方法配置ID") + private Long recheckConfigAssayMethodId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java new file mode 100644 index 0000000..b0d6802 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleParentRecheckSaveReqVO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 分样复检业务数据新增/修改 Request VO") +@Data +public class BusinessSubSampleParentRecheckSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631") + private Long id; + + @Schema(description = "样品ID", example = "19065") + private Long sampleId; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605") + @NotNull(message = "样品主样ID不能为空") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742") + @NotNull(message = "复检样品主样ID不能为空") + private Long recheckBusinessBaseSampleId; + + @Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043") + @NotNull(message = "复检样品分样ID不能为空") + private Long recheckBusinessSubParentSampleId; + + @Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026") + @NotNull(message = "复检检测方法配置ID不能为空") + private Long recheckConfigAssayMethodId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java index 47a6e6a..b9e404c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleReqVO.java @@ -1,42 +1,41 @@ package com.zt.plat.module.qms.business.bus.controller.vo; import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; -import org.springframework.format.annotation.DateTimeFormat; - -import com.alibaba.excel.annotation.ExcelProperty; - +import com.zt.plat.framework.common.pojo.PageParam; import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 子样业务 Request VO") +@Schema(description = "管理后台 - 子样业务分页 Request VO") @Data public class BusinessSubSampleReqVO { - @Schema(description = "样品主样ID", example = "11587") + @Schema(description = "样品主样ID", example = "10824") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", example = "2157") + @Schema(description = "样品分样ID", example = "31262") private Long businessSubParentSampleId; - @Schema(description = "子样配置ID", example = "20299") + @Schema(description = "子样配置ID", example = "19843") private Long configSubSampleId; - @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", example = "30304") + @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", example = "25153") private Long dictionaryBusinessId; - @Schema(description = "库位信息ID", example = "28807") + @Schema(description = "库位信息ID", example = "5479") private Long configWarehouseLocationInfomationId; - @Schema(description = "样品ID", example = "13062") + @Schema(description = "样品ID", example = "15518") private Long sampleId; - @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "29885") + @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "16918") private String groupId; - @Schema(description = "样品名称", example = "赵六") + @Schema(description = "样品名称", example = "张三") private String sampleName; @Schema(description = "样品编号") @@ -48,33 +47,40 @@ public class BusinessSubSampleReqVO { @Schema(description = "归库编号") private String sampleReturnCode; - @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否称重,1-启用,0-不启用") private Integer isWeighing; - @Schema(description = "末次样品重量") + @Schema(description = "末次重量,末次样品重量") private BigDecimal lastSampleWeight; - @Schema(description = "样品流程ID", example = "18294") - private Long sampleFlowId; + @Schema(description = "末次称重天平编号") + private String lastBalanceCode; - @Schema(description = "样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程配置ID", example = "15413") + private Long configSampleFlowId; - @Schema(description = "下一步样品流程名称") - private String nextSampleFlow; + @Schema(description = "样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "是否已生成归库码") - private Integer isGenerateReturnCode; + @Schema(description = "样品流程节点时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleFlowNodeTime; - @Schema(description = "任务指派给分析人") + @Schema(description = "下一步样品流程节点名称") + private String nextSampleFlowNode; + + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "1") + private String sampleStatus; + + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务") + private Integer isAssignTasked; - @Schema(description = "指派时间") + @Schema(description = "分配任务时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] taskTime; + private LocalDateTime[] assignTaskTime; @Schema(description = "是否已上报") private Integer isReported; @@ -90,37 +96,36 @@ public class BusinessSubSampleReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] returnTime; - @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "1") - private Integer returnStatus; + @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2") + private String returnStatus; - @Schema(description = "打印次数", example = "28859") + @Schema(description = "调拨状态") + private String dispatchStatus; + + @Schema(description = "打印次数", example = "32651") private Integer returnCodePrintCount; @Schema(description = "末次打印时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] printLastTime; - @Schema(description = "样品流程节点时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] sampleFlowTime; - - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", example = "2") - private String sampleStatus; - - @Schema(description = "是否启用,1-启用,0-不启用") - private Integer isEnabled; + @Schema(description = "上一个交接记录ID", example = "29555") + private Long upSampleRecordId; @Schema(description = "分析元素备注") private String analysisRemark; + @Schema(description = "是否启用,1-启用,0-不启用") + private Integer isEnabled; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "8971") + @Schema(description = "乐观锁", example = "28696") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java index fb2e58c..c3d4a3d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleRespVO.java @@ -1,11 +1,11 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; - import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; @@ -14,39 +14,39 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class BusinessSubSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18282") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22387") @ExcelProperty("ID") private Long id; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11587") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10824") @ExcelProperty("样品主样ID") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2157") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31262") @ExcelProperty("样品分样ID") private Long businessSubParentSampleId; - @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20299") + @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19843") @ExcelProperty("子样配置ID") private Long configSubSampleId; - @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", requiredMode = Schema.RequiredMode.REQUIRED, example = "30304") + @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") @ExcelProperty("子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样") private Long dictionaryBusinessId; - @Schema(description = "库位信息ID", example = "28807") + @Schema(description = "库位信息ID", example = "5479") @ExcelProperty("库位信息ID") private Long configWarehouseLocationInfomationId; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13062") + @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15518") @ExcelProperty("样品ID") private Long sampleId; - @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "29885") + @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "16918") @ExcelProperty("组ID,如果是委托创建的,则组ID和样品分样ID一致") private String groupId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("样品名称") private String sampleName; @@ -66,37 +66,45 @@ public class BusinessSubSampleRespVO { @ExcelProperty("是否称重,1-启用,0-不启用") private Integer isWeighing; - @Schema(description = "末次样品重量") - @ExcelProperty("末次样品重量") + @Schema(description = "末次重量,末次样品重量") + @ExcelProperty("末次重量,末次样品重量") private BigDecimal lastSampleWeight; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18294") - @ExcelProperty("样品流程ID") - private Long sampleFlowId; + @Schema(description = "末次称重天平编号") + @ExcelProperty("末次称重天平编号") + private String lastBalanceCode; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品流程KEY") - private String sampleFlowKey; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15413") + @ExcelProperty("样品流程配置ID") + private Long configSampleFlowId; - @Schema(description = "下一步样品流程名称", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("下一步样品流程名称") - private String nextSampleFlow; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点KEY") + private String sampleFlowNodeKey; - @Schema(description = "是否已生成归库码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否已生成归库码") - private Integer isGenerateReturnCode; + @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("样品流程节点时间") + private LocalDateTime sampleFlowNodeTime; - @Schema(description = "任务指派给分析人") - @ExcelProperty("任务指派给分析人") + @Schema(description = "下一步样品流程节点名称", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("下一步样品流程节点名称") + private String nextSampleFlowNode; + + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废") + private String sampleStatus; + + @Schema(description = "分析人") + @ExcelProperty("分析人") private String assayOperator; - @Schema(description = "是否已指派", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否已指派") - private Integer isTasked; + @Schema(description = "是否已分配任务", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否已分配任务") + private Integer isAssignTasked; - @Schema(description = "指派时间") - @ExcelProperty("指派时间") - private LocalDateTime taskTime; + @Schema(description = "分配任务时间") + @ExcelProperty("分配任务时间") + private LocalDateTime assignTaskTime; @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否已上报") @@ -114,11 +122,16 @@ public class BusinessSubSampleRespVO { @ExcelProperty("归库时间") private LocalDateTime returnTime; - @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "1") + @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2") @ExcelProperty("归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁") - private Integer returnStatus; + @Dict(dicCode = "jy_sample_return_status") + private String returnStatus; - @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "28859") + @Schema(description = "调拨状态") + @ExcelProperty("调拨状态") + private String dispatchStatus; + + @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "32651") @ExcelProperty("打印次数") private Integer returnCodePrintCount; @@ -126,31 +139,27 @@ public class BusinessSubSampleRespVO { @ExcelProperty("末次打印时间") private LocalDateTime printLastTime; - @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品流程节点时间") - private LocalDateTime sampleFlowTime; - - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废") - private String sampleStatus; - - @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否启用,1-启用,0-不启用") - private Integer isEnabled; + @Schema(description = "上一个交接记录ID", example = "29555") + @ExcelProperty("上一个交接记录ID") + private Long upSampleRecordId; @Schema(description = "分析元素备注") @ExcelProperty("分析元素备注") private String analysisRemark; + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否启用,1-启用,0-不启用") + private Integer isEnabled; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "8971") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "28696") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java index 0eafac9..e41a62c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleSaveReqVO.java @@ -4,52 +4,49 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; import jakarta.validation.constraints.*; -import org.springframework.format.annotation.DateTimeFormat; - -import com.alibaba.excel.annotation.ExcelProperty; - import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @Schema(description = "管理后台 - 子样业务新增/修改 Request VO") @Data public class BusinessSubSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18282") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22387") private Long id; - @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11587") - @NotNull(message = "样品主样ID不能为空") + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10824") +// @NotNull(message = "样品主样ID不能为空") private Long businessBaseSampleId; - @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2157") - @NotNull(message = "样品分样ID不能为空") + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31262") +// @NotNull(message = "样品分样ID不能为空") private Long businessSubParentSampleId; - @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20299") - @NotNull(message = "子样配置ID不能为空") + @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19843") +// @NotNull(message = "子样配置ID不能为空") private Long configSubSampleId; - @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", requiredMode = Schema.RequiredMode.REQUIRED, example = "30304") - @NotNull(message = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样不能为空") + @Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") +// @NotNull(message = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样不能为空") private Long dictionaryBusinessId; - @Schema(description = "库位信息ID", example = "28807") + @Schema(description = "库位信息ID", example = "5479") private Long configWarehouseLocationInfomationId; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13062") - @NotNull(message = "样品ID不能为空") + @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15518") +// @NotNull(message = "样品ID不能为空") private Long sampleId; - @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "29885") + @Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "16918") private String groupId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") - @NotEmpty(message = "样品名称不能为空") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") +// @NotEmpty(message = "样品名称不能为空") private String sampleName; @Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "样品编号不能为空") +// @NotEmpty(message = "样品编号不能为空") private String sampleCode; @Schema(description = "分析编号") @@ -59,39 +56,47 @@ public class BusinessSubSampleSaveReqVO { private String sampleReturnCode; @Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "是否称重,1-启用,0-不启用不能为空") private Integer isWeighing; - @Schema(description = "末次样品重量") + @Schema(description = "末次重量,末次样品重量") private BigDecimal lastSampleWeight; - @Schema(description = "样品流程ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18294") - @NotNull(message = "样品流程ID不能为空") - private Long sampleFlowId; + @Schema(description = "末次称重天平编号") + private String lastBalanceCode; - @Schema(description = "样品流程KEY", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "样品流程KEY不能为空") - private String sampleFlowKey; + @Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15413") +// @NotNull(message = "样品流程配置ID不能为空") + private Long configSampleFlowId; - @Schema(description = "下一步样品流程名称", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "下一步样品流程名称不能为空") - private String nextSampleFlow; + @Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotEmpty(message = "样品流程节点KEY不能为空") + private String sampleFlowNodeKey; - @Schema(description = "是否已生成归库码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否已生成归库码不能为空") - private Integer isGenerateReturnCode; + @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "样品流程节点时间不能为空") + private LocalDateTime sampleFlowNodeTime; - @Schema(description = "任务指派给分析人") + @Schema(description = "下一步样品流程节点名称", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotEmpty(message = "下一步样品流程节点名称不能为空") + private String nextSampleFlowNode; + + @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") +// @NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空") + private String sampleStatus; + + @Schema(description = "分析人") private String assayOperator; - @Schema(description = "是否已指派", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否已指派不能为空") - private Integer isTasked; + @Schema(description = "是否已分配任务", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "是否已分配任务不能为空") + private Integer isAssignTasked; - @Schema(description = "指派时间") - private LocalDateTime taskTime; + @Schema(description = "分配任务时间") + private LocalDateTime assignTaskTime; @Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否已上报不能为空") +// @NotNull(message = "是否已上报不能为空") private Integer isReported; @Schema(description = "上报人") @@ -103,40 +108,42 @@ public class BusinessSubSampleSaveReqVO { @Schema(description = "归库时间") private LocalDateTime returnTime; - @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "1") - private Integer returnStatus; + @Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2") + private String returnStatus; - @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "28859") - @NotNull(message = "打印次数不能为空") + @Schema(description = "调拨状态") + private String dispatchStatus; + + @Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "32651") +// @NotNull(message = "打印次数不能为空") private Integer returnCodePrintCount; @Schema(description = "末次打印时间") private LocalDateTime printLastTime; - @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "样品流程节点时间不能为空") - private LocalDateTime sampleFlowTime; - - @Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空") - private String sampleStatus; - - @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否启用,1-启用,0-不启用不能为空") - private Integer isEnabled; + @Schema(description = "上一个交接记录ID", example = "29555") + private Long upSampleRecordId; @Schema(description = "分析元素备注") private String analysisRemark; + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "是否启用,1-启用,0-不启用不能为空") + private Integer isEnabled; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "8971") - @NotNull(message = "乐观锁不能为空") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "28696") private Integer updateCount; @Schema(description = "备注") private String remark; + //============================扩展属性=============================== + @Schema(description = "库位编码") + private String warehouseLocationCode; + + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java new file mode 100644 index 0000000..93689ac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataPageReqVO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 荧光采集记录分页 Request VO") +@Data +public class BusinessXRFDataPageReqVO extends PageParam { + + @Schema(description = "设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", example = "王五") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + private String xRFSampleId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", example = "29288") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "4878") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "13189") + private Long businessSubSampleId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "检测数据") + private String assayData; + + @Schema(description = "是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "4171") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java new file mode 100644 index 0000000..f767309 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataReqVO.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 荧光采集记录分页 Request VO") +@Data +public class BusinessXRFDataReqVO { + + @Schema(description = "设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", example = "王五") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + private String xRFSampleId; + + @Schema(description = "荧光样品id列表") + private List xRFSampleIdList; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] sampleTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", example = "29288") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", example = "4878") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", example = "13189") + private Long businessSubSampleId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "检测数据") + private String assayData; + + @Schema(description = "是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "乐观锁", example = "4171") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java new file mode 100644 index 0000000..eb2ef7b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataRespVO.java @@ -0,0 +1,102 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 荧光采集记录 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BusinessXRFDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + @ExcelProperty("荧光样品id") + private String xRFSampleId; + + @Schema(description = "样品编号") + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "样品时间") + @ExcelProperty("样品时间") + private LocalDateTime sampleTime; + + @Schema(description = "分析人") + @ExcelProperty("分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288") + @ExcelProperty("样品主样ID") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878") + @ExcelProperty("样品分样ID") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189") + @ExcelProperty("分样子样ID") + private Long businessSubSampleId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测数据") + private String assayData; + + @Schema(description = "是否为检查创建数据") + @ExcelProperty("是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + @ExcelProperty("是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + @ExcelProperty("是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + @ExcelProperty("上报人") + private String reporter; + + @Schema(description = "上报时间") + @ExcelProperty("上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171") + @ExcelProperty("乐观锁") + private Integer updateCount; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java new file mode 100644 index 0000000..cfe3d2c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessXRFDataSaveReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 荧光采集记录新增/修改 Request VO") +@Data +public class BusinessXRFDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "荧光样品id", example = "13273") + private String xRFSampleId; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称", example = "李四") + private String sampleName; + + @Schema(description = "样品时间") + private LocalDateTime sampleTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288") + @NotNull(message = "样品主样ID不能为空") + private Long businessBaseSampleId; + + @Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878") + @NotNull(message = "样品分样ID不能为空") + private Long businessSubParentSampleId; + + @Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189") + @NotNull(message = "分样子样ID不能为空") + private Long businessSubSampleId; + + @Schema(description = "检测任务ID", example = "16505") + private Long businessAssayTaskDataId; + + @Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测数据不能为空") + private String assayData; + + @Schema(description = "是否为检查创建数据") + private Integer isCheckCreate; + + @Schema(description = "是否已匹配") + private Integer isMatched; + + @Schema(description = "是否已上报") + private Integer isReported; + + @Schema(description = "上报人") + private String reporter; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; + + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171") + @NotNull(message = "乐观锁不能为空") + private Integer updateCount; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java new file mode 100644 index 0000000..85f692d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ChangeAssayMethodReqVO.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class ChangeAssayMethodReqVO { + + private Long businessSubSampleId; + + private Long configAssayMethodId; + + private List changeConfigAssayMethodIdList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java new file mode 100644 index 0000000..791ac1c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/CreateQcSampleReqVO.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class CreateQcSampleReqVO { + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "样品编号", example = "张三") + private String sampleCode; + + @Schema(description = "指派单ID", example = "29117") + private Long businessAssayTaskId; + + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; + + @Schema(description = "质控样配置方法id") + private Long configQCSampleMethodId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java new file mode 100644 index 0000000..370da2d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/DeleteQcSampleReqVO.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class DeleteQcSampleReqVO { + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "质控样id") + private List qcSampleIdList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifyResultAssessmentReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifyResultAssessmentReqVO.java new file mode 100644 index 0000000..70bc584 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifyResultAssessmentReqVO.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class ModifyResultAssessmentReqVO { + + private String assayType; + + private Long sampleId; + + private Long configAssayMethodId; + + private Long sampleAssessmentId; + + private List businessAssayProjectDataIds; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java new file mode 100644 index 0000000..9ff8961 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ModifySampleResultReportingReqVO.java @@ -0,0 +1,11 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class ModifySampleResultReportingReqVO { + + private String businessSubParentSampleAssessmentIds; + + private String businessSubSampleAssessmentIds; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java new file mode 100644 index 0000000..6726322 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/NoReportSubParentSampleAssessmentRespVO.java @@ -0,0 +1,25 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import lombok.Data; + +@Data +public class NoReportSubParentSampleAssessmentRespVO { + + private Long baseSampleId; + + private Long businessBaseSampleId; + + private Long businessSubParentSampleId; + + private Long configBaseSampleId; + + private Long configSubSampleParentId; + + private String sampleName; + + private String baseSampleName; + + private String taskType; + + private String assayType; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java new file mode 100644 index 0000000..bc37688 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentCreateReqVO.java @@ -0,0 +1,26 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import lombok.Data; + +@Data +public class RecheckSubSampleParentCreateReqVO { + + private String sampleCode; + + private String sampleName; + + private Long baseSampleId; + + private Long businessBaseSampleId; + + private Long businessSubParentSampleId; + + private Long businessSubSampleId; + + + private Long configAssayMethodId; + + List recheckProjectList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java new file mode 100644 index 0000000..afe6019 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/RecheckSubSampleParentMethodRespVO.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.util.List; + +import com.zt.plat.module.qms.business.config.controller.vo.*; + +import lombok.Data; + +@Data +public class RecheckSubSampleParentMethodRespVO { + + private Long dictionaryProjectId; + + private String dictionaryProjectName; + + private String dictionaryProjectSimpleName; + + private String dictionaryProjectShowName; + + private Long configAssayMethodId; + + private String configAssayMethodName; + + private Long baseSampleId; + + private String baseSampleName; + + private Integer isRecheckDefault; + + private List methodList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java new file mode 100644 index 0000000..126b34b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ReportFieldValueData implements Serializable { + + private static final long serialVersionUID = 4301653225442965919L; + + @Schema(description = "字段名称") + private String fieldName; + + @Schema(description = "值") + private String fieldValue; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "符号") + private String mathSymbol; + + @Schema(description = "用途,ingredient-配料、report-报出、ingredient_report-配料及报出") + private String usage; + + @Schema(description = "分析方法") + private String methodName; + + @Schema(description = "下限值") + private String minLimitValue; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java new file mode 100644 index 0000000..4d1a5f6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportedDataSource.java @@ -0,0 +1,88 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang.StringUtils; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +public class ReportedDataSource implements Serializable { + + private static final long serialVersionUID = 5854800501968008943L; + + /** + * 自动上报时间 + */ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime autoReportedTime; + + /** 已完成数据来源明细 **/ + private List details; + + /** + * 添加数据来源 + * @param sourceCode 来源编码 + * @param reportedOper 上报人 + * @param reportedTime 上报时间 + */ + public void addDataSource(String sourceCode, String reportedOper, LocalDateTime reportedTime) { + if (this.details == null) { + this.details = new ArrayList<>(); + this.details.add(new DataSourceDetail(sourceCode, reportedOper, reportedTime)); + } else { + List dataSources = this.details.stream().map(m -> m.getSourceCode()).collect(Collectors.toList()); + if (dataSources.contains(sourceCode)) { + DataSourceDetail dataSourceDetail = this.details.stream().filter(f -> f.getSourceCode().equals(sourceCode)).findAny().get(); + dataSourceDetail.setReportedOper(reportedOper); + dataSourceDetail.setReportedTime(reportedTime); + } else { + this.details.add(new DataSourceDetail(sourceCode, reportedOper, reportedTime)); + } + } + } + + /** + * 检查是否存在来源编码 + * @param sourceCode 来源编码 + * @return true 存在 false 不存在 + */ + public boolean checkIsExist(String sourceCode) { + if (StringUtils.isBlank(sourceCode)) { + return false; + } + if (this.details == null) { + return false; + } + return this.details.stream().anyMatch(f -> sourceCode.equals(f.getSourceCode())); + } + + @Data + @NoArgsConstructor + @AllArgsConstructor + public static class DataSourceDetail { + /** + * 来源编码 + */ + private String sourceCode; + + /** + * 上报人 + */ + private String reportedOper; + + /** + * 上报时间 + */ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime reportedTime; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java new file mode 100644 index 0000000..9173376 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 样品分析结果判定 + */ +@Data +public class SampleAssayResultAssessmentRespVO implements Serializable { + + private static final long serialVersionUID = 5216179630941802338L; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java new file mode 100644 index 0000000..99f408d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/UnAssignTaskedSubSampleRespVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class UnAssignTaskedSubSampleRespVO implements Serializable { + + private static final long serialVersionUID = -6009144013166409560L; + + @Schema(description = "联合id") + private String id; + + @Schema(description = "分样子样ID") + private Long businessSubSampleId; + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "归库编号") + private String sampleReturnCode; + + @Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime sampleFlowNodeTime; + + @Schema(description = "检测方法配置ID", example = "9130") + private Long configAssayMethodId; + + @Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2") + private String assayType; + + @Schema(description = "检测项目") + private String assayProject; + + @Schema(description = "分析部门ID", example = "16988") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "芋艿") + private String assayDepartmentName; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java index a705ea2..f69102f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayParameterDataDO.java @@ -47,12 +47,12 @@ public class BusinessAssayParameterDataDO extends BusinessBaseDO { @TableField("DIC_PRM_ID") private Long dictionaryParameterId; /** - * 参数值 + * 值 */ @TableField("VAL") private String value; /** - * 数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 */ @TableField("DAT_TP") private String dataType; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java index 856b4b3..3da3238 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayProjectDataDO.java @@ -47,12 +47,22 @@ public class BusinessAssayProjectDataDO extends BusinessBaseDO { @TableField("DIC_PRJ_ID") private Long dictionaryProjectId; /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** * 值 */ @TableField("VAL") private String value; /** - * 数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 */ @TableField("DAT_TP") private String dataType; @@ -72,6 +82,11 @@ public class BusinessAssayProjectDataDO extends BusinessBaseDO { @TableField("IS_ENBD") private Integer isEnabled; /** + * 方法检出下限值 + */ + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** * 乐观锁 */ @TableField("UPD_CNT") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java new file mode 100644 index 0000000..e1aa53f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayReportDataDO.java @@ -0,0 +1,112 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测报表数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_asy_rpt_dat") +@KeySequence("t_bsn_asy_rpt_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessAssayReportDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 报表类型ID + */ + @TableField("CFG_RPT_TP_ID") + private Long configReportTypeId; + /** + * 报表配置ID + */ + @TableField("CFG_SMP_RPT_ID") + private Long configSampleReportId; + /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 数据来源 + */ + @TableField("DAT_SRC") + private String dataSource; + /** + * 分析数据 + */ + @TableField("ASY_DAT") + private String assayData; + /** + * 是否已全部上报(0-否,1-是) + */ + @TableField("IS_ALL_RPOD") + private Integer isAllReported; + /** + * 已上报数据来源 + */ + @TableField("RPOD_SRC") + private String reportedSource; + /** + * 流程code + */ + @TableField("RPT_FLW_CD") + private String reportFlowCode; + /** + * 报告数据明细id + */ + @TableField("DOC_DAT_ID") + private Long documentDataId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + //==================扩展字段=========== + //样品名称 + @TableField(exist = false) + private String sampleName; + + //样品大类名称 + @TableField(exist = false) + private String baseSampleName; + + //样品创建时间 + @TableField(exist = false) + private LocalDateTime baseSampleCreateTime; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java new file mode 100644 index 0000000..81ff2e7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDO.java @@ -0,0 +1,169 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测任务分配业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_asy_tsk") +@KeySequence("t_bsn_asy_tsk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessAssayTaskDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 指派编号 + */ + @TableField("TSK_NO") + private String taskNo; + /** + * 指派单名称 + */ + @TableField("TSK_NAME") + private String taskName; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 任务单模板ID + */ + @TableField("CFG_RPT_TMPL_ID") + private Long configReportTemplateId; + /** + * 任务单模板key + */ + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; + /** + * 任务单来源,分配-task_assign、领取-task_claim + */ + @TableField("TSK_SRC_TP") + private String taskSourceType; + /** + * 任务单分配人 + */ + @TableField("TSK_ASN_OPTR") + private String taskAssignOperator; + /** + * 任务单分配时间 + */ + @TableField("TSK_ASN_TM") + private LocalDateTime taskAssignTime; + /** + * 任务单分配状态,进行中-in_progress、已提交-submitted、作废-void + */ + @TableField("TSK_ASN_STS") + private String taskAssignStatus; + /** + * 任务单分配提交时间 + */ + @TableField("TSK_ASN_SBM_TM") + private LocalDateTime taskAssignSubmitTime; + /** + * 是否配料,1-是,0-否 + */ + @TableField("IS_IGDT") + private Integer isIngredients; + /** + * 配料状态,初始状态-initial、等待配料-in_progress、可提交-allow_submit + */ + @TableField("IGDT_STS") + private String ingredientsStatus; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 分析时间 + */ + @TableField("ASY_TM") + private LocalDateTime assayTime; + /** + * 分析提交时间 + */ + @TableField("ASY_SBM_TM") + private LocalDateTime assaySubmitTime; + /** + * 任务单分析状态,未开始-not_start、已保存- saved、 已提交-submitted + */ + @TableField("TSK_ASY_STS") + private String taskAssayStatus; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 上报人 + */ + @TableField("RPT_OPTR") + private String reportOperator; + /** + * 任务单完成时间 + */ + @TableField("TSK_FIN_TM") + private LocalDateTime taskFinishTime; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private Long flowInstanceId; + /** + * 顶部字段数据集ID,T_DAT_COLT_FLD + */ + @TableField("FORM_DAT_COLT_ID") + private Long formDataCollectionId; + /** + * 顶部字段值 + */ + @TableField("FORM_VAL") + private String formValue; + /** + * 签名信息 + */ + @TableField("DOC_SIG") + private String documentSignature; + /** + * 完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved + */ + @TableField("FIN_STS") + private String finishStatus; + /** + * 流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java index 3a11816..2b8c07a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDataDO.java @@ -6,6 +6,7 @@ import java.util.*; import java.time.LocalDateTime; import java.time.LocalDateTime; import java.time.LocalDateTime; + import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** @@ -26,6 +27,8 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; */ public class BusinessAssayTaskDataDO extends BusinessBaseDO { + + /** * ID */ @@ -47,14 +50,14 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; /** - * 检测方法ID + * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** * 指派单ID */ - @TableField("BSN_ASY_TSK_ID") + @TableField(value = "BSN_ASY_TSK_ID", updateStrategy = FieldStrategy.ALWAYS) private Long businessAssayTaskId; /** * 任务类型,【字典】【jy_sample_task_type】常规、抽查... @@ -62,25 +65,40 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("TSK_TP") private String taskType; /** - * 分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行... + * 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel... */ @TableField("ASY_TP") private String assayType; /** + * 检测项目 + */ + @TableField("ASY_PRJ") + private String assayProject; + /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** * 分析人 */ - @TableField("ASY_OPTR") + @TableField(value = "ASY_OPTR", updateStrategy = FieldStrategy.ALWAYS) private String assayOperator; /** - * 任务指派时间 + * 分配任务时间 */ - @TableField("TSK_TM") - private LocalDateTime taskTime; + @TableField(value = "ASN_TSK_TM", updateStrategy = FieldStrategy.ALWAYS) + private LocalDateTime assignTaskTime; /** - * 是否已指派 + * 是否已分配任务 */ - @TableField("IS_TSKD") - private Integer isTasked; + @TableField("IS_ASN_TSKD") + private Integer isAssignTasked; /** * 是否已上报 */ @@ -97,15 +115,25 @@ public class BusinessAssayTaskDataDO extends BusinessBaseDO { @TableField("RPT_TM") private LocalDateTime reportTime; /** - * 流程节点 + * 样品流程配置ID */ - @TableField("FLW_NDE") - private String flowNode; + @TableField("CFG_SMP_FLW_ID") + private Long configSampleFlowId; /** - * 复检次数,0代表正常分析 + * 样品流程节点KEY */ - @TableField("RCHK_CNT") - private Integer recheckCount; + @TableField("SMP_FLW_NDE_KY") + private String sampleFlowNodeKey; + /** + * 样品流程节点时间 + */ + @TableField("SMP_FLW_NDE_TM") + private LocalDateTime sampleFlowNodeTime; + /** + * 分析次数,复检的累加次数 + */ + @TableField("ANL_CNT") + private Integer analysisCount; /** * 乐观锁 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDetailDO.java new file mode 100644 index 0000000..a15d76f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessAssayTaskDetailDO.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测任务分配明细 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_asy_tsk_dtl") +@KeySequence("t_bsn_asy_tsk_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessAssayTaskDetailDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 指派单ID + */ + @TableField("BSN_ASY_TSK_ID") + private Long businessAssayTaskId; + /** + * 检测任务ID + */ + @TableField("BSN_ASY_TSK_DAT_ID") + private Long businessAssayTaskDataId; + /** + * 样品id + */ + @TableField("SMP_ID") + private Long sampleId; + /** + * 指派编号 + */ + @TableField("TSK_NO") + private String taskNo; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 杯号 + */ + @TableField("CP_NUM") + private String cupNumber; + /** + * 数据来源类型,【字典】【jy_assay_task_data_source_type】正常,筛上,筛下 + */ + @TableField("DAT_SRC_TP") + private String dataSourceType; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 任务退回状态,【字典】【jy_assay_task_rollback_status】默认;审批中;已审批(已退回);取消退回 + */ + @TableField("RLBK_STS") + private String rollbackStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessBaseSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessBaseSampleDO.java index f683045..875760e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessBaseSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessBaseSampleDO.java @@ -40,6 +40,11 @@ public class BusinessBaseSampleDO extends BusinessBaseDO { @TableField("SMP_NAME") private String sampleName; /** + * 样品大类名称 + */ + @TableField("BSE_SMP_NAME") + private String baseSampleName; + /** * 样品编号 */ @TableField("SMP_CD") @@ -70,36 +75,36 @@ public class BusinessBaseSampleDO extends BusinessBaseDO { @TableField("PRNT_LST_TM") private LocalDateTime printLastTime; /** - * 样品流程ID + * 样品流程配置ID */ - @TableField("SMP_FLW_ID") - private Long sampleFlowId; + @TableField("CFG_SMP_FLW_ID") + private Long configSampleFlowId; /** - * 样品流程KEY + * 样品流程节点KEY */ - @TableField("SMP_FLW_KY") - private String sampleFlowKey; + @TableField("SMP_FLW_NDE_KY") + private String sampleFlowNodeKey; /** * 样品流程节点时间 */ - @TableField("SMP_FLW_TM") - private LocalDateTime sampleFlowTime; + @TableField("SMP_FLW_NDE_TM") + private LocalDateTime sampleFlowNodeTime; /** * 样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废 */ @TableField("SMP_STS") private String sampleStatus; /** + * 操作人 + */ + @TableField("OPTR") + private String operator; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") private String systemDepartmentCode; /** - * 创建人名称 - */ - @TableField("OPTR") - private String operator; - /** * 乐观锁 */ @TableField("UPD_CNT") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessHandoverRecordSubDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessHandoverRecordSubDO.java index 22906ba..44a1f9e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessHandoverRecordSubDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessHandoverRecordSubDO.java @@ -34,20 +34,20 @@ public class BusinessHandoverRecordSubDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 样品子样ID + * 分样子样ID */ @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; /** - * 样品流程ID + * 样品流程配置ID */ - @TableField("SMP_FLW_ID") - private Long sampleFlowId; + @TableField("CFG_SMP_FLW_ID") + private Long configSampleFlowId; /** - * 样品流程KEY + * 样品流程节点KEY */ - @TableField("SMP_FLW_KY") - private String sampleFlowKey; + @TableField("SMP_FLW_NDE_KY") + private String sampleFlowNodeKey; /** * 样品编号 */ @@ -59,6 +59,11 @@ public class BusinessHandoverRecordSubDO extends BusinessBaseDO { @TableField("SMP_WGT") private BigDecimal sampleWeight; /** + * 天平编号 + */ + @TableField("BAL_CD") + private String balanceCode; + /** * 操作时间 */ @TableField("OPTN_TM") @@ -84,6 +89,16 @@ public class BusinessHandoverRecordSubDO extends BusinessBaseDO { @TableField("RCV_SMP_OPTR") private String receiveSampleOperator; /** + * 上一个交接记录ID + */ + @TableField("UP_SMP_RCD_ID") + private Long upSampleRecordId; + /** + * 下一个交接记录ID + */ + @TableField("NXT_SMP_RCD_ID") + private Long nextSampleRecordId; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java new file mode 100644 index 0000000..76e5dc6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientDataDO.java @@ -0,0 +1,132 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测系数任务数据,空白样、标样 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_coef_dat") +@KeySequence("t_bsn_qc_coef_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCCoefficientDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 指派单ID + */ + @TableField("BSN_ASY_TSK_ID") + private Long businessAssayTaskId; + /** + * 定值样业务ID + */ + @TableField("BSN_STD_SMP_ID") + private Long businessStandardSampleId; + /** + * 质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 检测项目 + */ + @TableField("ASY_PRJ") + private String assayProject; + /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 分配任务时间 + */ + @TableField("ASN_TSK_TM") + private LocalDateTime assignTaskTime; + /** + * 是否已分配任务 + */ + @TableField("IS_ASN_TSKD") + private Integer isAssignTasked; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java new file mode 100644 index 0000000..5be6059 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCCoefficientParameterDataDO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测系数参数业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_coef_prm_dat") +@KeySequence("t_bsn_qc_coef_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCCoefficientParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测项目业务ID + */ + @TableField("BSN_QC_COEF_DAT_ID") + private Long businessQCCoefficientDataId; + /** + * 质控样检测方法参数配置ID + */ + @TableField("CFG_QC_SMP_MTHD_PRM_ID") + private Long configQCSampleMethodParameterId; + /** + * 参数ID,字典表【T_DIC_PRM】 + */ + @TableField("DIC_PRM_ID") + private Long dictionaryParameterId; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCDataDO.java new file mode 100644 index 0000000..679b187 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCDataDO.java @@ -0,0 +1,132 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_dat") +@KeySequence("t_bsn_qc_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 指派单ID + */ + @TableField("BSN_ASY_TSK_ID") + private Long businessAssayTaskId; + /** + * 定值样业务ID + */ + @TableField("BSN_STD_SMP_ID") + private Long businessStandardSampleId; + /** + * 质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 检测项目 + */ + @TableField("ASY_PRJ") + private String assayProject; + /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 分配任务时间 + */ + @TableField("ASN_TSK_TM") + private LocalDateTime assignTaskTime; + /** + * 是否已分配任务 + */ + @TableField("IS_ASN_TSKD") + private Integer isAssignTasked; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java new file mode 100644 index 0000000..3938b80 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementDataDO.java @@ -0,0 +1,132 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控管理样检测任务数据,管理样、标准样 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_mngt_dat") +@KeySequence("t_bsn_qc_mngt_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCManagementDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 指派单ID + */ + @TableField("BSN_ASY_TSK_ID") + private Long businessAssayTaskId; + /** + * 定值样业务ID + */ + @TableField("BSN_STD_SMP_ID") + private Long businessStandardSampleId; + /** + * 质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 检测项目 + */ + @TableField("ASY_PRJ") + private String assayProject; + /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 分配任务时间 + */ + @TableField("ASN_TSK_TM") + private LocalDateTime assignTaskTime; + /** + * 是否已分配任务 + */ + @TableField("IS_ASN_TSKD") + private Integer isAssignTasked; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java new file mode 100644 index 0000000..88d7026 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementParameterDataDO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测参数数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_mngt_prm_dat") +@KeySequence("t_bsn_qc_mngt_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCManagementParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测项目业务ID + */ + @TableField("BSN_QC_MNGT_PRJ_DAT_ID") + private Long businessQCManagementProjectDataId; + /** + * 检测方法分析项目参数配置表ID + */ + @TableField("CFG_ASY_MTHD_PRJ_PRM_ID") + private Long configAssayMethodProjectParameterId; + /** + * 参数ID,字典表【T_DIC_PRM】 + */ + @TableField("DIC_PRM_ID") + private Long dictionaryParameterId; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java new file mode 100644 index 0000000..c23a5b5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCManagementProjectDataDO.java @@ -0,0 +1,100 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测项目数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_mngt_prj_dat") +@KeySequence("t_bsn_qc_mngt_prj_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCManagementProjectDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测任务ID + */ + @TableField("BSN_QC_MNGT_DAT_ID") + private Long businessQCManagementDataId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测项目字典ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 是否不参与超差判定 + */ + @TableField("IS_NT_ASMT") + private Integer isNotAssessment; + /** + * 是否启用 + */ + @TableField("IS_ENBD") + private Integer isEnabled; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCParameterDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCParameterDataDO.java new file mode 100644 index 0000000..0637b2f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCParameterDataDO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测参数数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_prm_dat") +@KeySequence("t_bsn_qc_prm_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCParameterDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测项目业务ID + */ + @TableField("BSN_QC_PRJ_DAT_ID") + private Long businessQCProjectDataId; + /** + * 检测方法分析项目参数配置表ID + */ + @TableField("CFG_ASY_MTHD_PRJ_PRM_ID") + private Long configAssayMethodProjectParameterId; + /** + * 参数ID,字典表【T_DIC_PRM】 + */ + @TableField("DIC_PRM_ID") + private Long dictionaryParameterId; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCProjectDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCProjectDataDO.java new file mode 100644 index 0000000..6810e36 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQCProjectDataDO.java @@ -0,0 +1,100 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测项目数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qc_prj_dat") +@KeySequence("t_bsn_qc_prj_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQCProjectDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测任务ID + */ + @TableField("BSN_QC_DAT_ID") + private Long businessQCDataId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测项目字典ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出、quality_control-品质控制 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** + * 值 + */ + @TableField("VAL") + private String value; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 是否不参与超差判定 + */ + @TableField("IS_NT_ASMT") + private Integer isNotAssessment; + /** + * 是否启用 + */ + @TableField("IS_ENBD") + private Integer isEnabled; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQualityControlSampleProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQualityControlSampleProjectDO.java new file mode 100644 index 0000000..c3bc5b7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessQualityControlSampleProjectDO.java @@ -0,0 +1,105 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测项目业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_qlt_ctrl_smp_prj") +@KeySequence("t_bsn_qlt_ctrl_smp_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessQualityControlSampleProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 指派单ID + */ + @TableField("BSN_ASY_TSK_ID") + private Long businessAssayTaskId; + /** + * 标准样元素配置ID + */ + @TableField("CFG_STD_SMP_PRJ_ID") + private Long configStandardSampleProjectId; + /** + * 检测项目ID,字典表:【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目名称,字典表:【UNT】 + */ + @TableField("DIC_PRJ_NAME") + private String dictionaryProjectName; + /** + * 检测项目单位 + */ + @TableField("DIC_PRJ_UNT") + private String dictionaryProjectUnit; + /** + * 标准值 + */ + @TableField("STD_VAL") + private String standardValue; + /** + * 允差值 + */ + @TableField("TLC_VAL") + private String toleraanceValue; + /** + * 质控样值 + */ + @TableField("QLT_CTRL_VAL") + private String qualityControlValue; + /** + * 数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleAssayResultDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleAssayResultDO.java index 857cd98..61d5f82 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleAssayResultDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleAssayResultDO.java @@ -42,7 +42,7 @@ public class BusinessSampleAssayResultDO extends BusinessBaseDO { @TableField("BSN_BSE_SMP_ID") private Long businessBaseSampleId; /** - * 来样品位 + * 来样品位(JSON数据) */ @TableField("DAT") private String data; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java new file mode 100644 index 0000000..c75ade9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDO.java @@ -0,0 +1,122 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 样品调拨 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_smp_dst") +@KeySequence("t_bsn_smp_dst_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSampleDispatchDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 主管部门id + */ + @TableField("MAIN_DEPT_ID") + private Long mainDepartmentId; + /** + * 主管部门名称 + */ + @TableField("MAIN_DEPT_NAME") + private String mainDepartmentName; + /** + * 申请人 + */ + @TableField("APL_USER") + private String applyUser; + /** + * 申请人id + */ + @TableField("APL_USER_ID") + private Long applyUserId; + /** + * 申请部门 + */ + @TableField("APL_DEPT") + private String applyDepartment; + /** + * 申请部门id + */ + @TableField("APL_DEPT_ID") + private Long applyDepartmentId; + /** + * 申请时间 + */ + @TableField("APL_TM") + private LocalDateTime applyTime; + + /** + * 申请原因 + */ + @TableField("APL_CNTT") + private LocalDateTime applyContent; + + /** + * 库管员 + */ + @TableField("WRH_USER") + private String warehouseUser; + /** + * 库管员ID + */ + @TableField("WRH_USER_ID") + private Long warehouseUserId; + /** + * 提交状态,用于无申请调拨,0-未提交;1-已提交 + */ + @TableField("SBM_STS") + private String submitStatus; + /** + * 流程实例id + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 流程审批状态 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 完成状态 + */ + @TableField("FIN_STS") + private String finishStatus; + /** + * 取消状态 + */ + @TableField("CNL_STS") + private String cancelStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDetailDO.java new file mode 100644 index 0000000..954fcd6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleDispatchDetailDO.java @@ -0,0 +1,99 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; + +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 样品调拨明细 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_smp_dst_dtl") +@KeySequence("t_bsn_smp_dst_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSampleDispatchDetailDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + @TableField("PRN_ID") + private Long parentId; + + /** + * 子样数据ID + */ + @TableField("BSN_SB_SMP_ID") + private Long businessSubSampleId; + /** + * 领用人 + */ + @TableField("BRW_USER") + private String borrowUser; + /** + * 领用人id + */ + @TableField("BRW_USER_ID") + private Long borrowUserId; + /** + * 领用时间 + */ + @TableField("BRW_TM") + private LocalDateTime borrowTime; + /** + * 领用状态,0-未领用;1-已领用 + */ + @TableField("BRW_STS") + private String borrowStatus; + /** + * 归还人 + */ + @TableField("GIV_USER") + private String givebackUser; + /** + * 归还人id + */ + @TableField("GIV_USER_ID") + private Long givebackUserId; + /** + * 归还时间 + */ + @TableField("GIV_TM") + private LocalDateTime givebackTime; + /** + * 归还状态,0-未归还;1-已归还 + */ + @TableField("GIV_STS") + private String givebackStatus; + /** + * 使用状态 + */ + @TableField("USE_STS") + private String useStatus; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustDetailDO.java index 9e856fc..44c4081 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustDetailDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustDetailDO.java @@ -47,10 +47,10 @@ public class BusinessSampleEntrustDetailDO extends BusinessBaseDO { @TableField("BSE_SMP_ID") private Long baseSampleId; /** - * 样品类型ID,字典表:【T_DIC_BSN】结算样、委检样、生产样等 + * 样品类型ID,字典表:【T_DIC_SMP_TP】西南铜委托样、商检委托样、内部委托样、抽查委托样、内审委托样等 */ - @TableField("DIC_BSN_ID") - private Long dictionaryBusinessId; + @TableField("SMP_TP_DIC_BSN_ID") + private Long sampleTypeDictionaryBusinessId; /** * 样品名称 */ @@ -72,11 +72,6 @@ public class BusinessSampleEntrustDetailDO extends BusinessBaseDO { @TableField("ENTT_SMP_CD") private String entrustSampleCode; /** - * 排序 - */ - @TableField("SRT") - private Integer sort; - /** * 检测项目 */ @TableField("ASY_PRJ") @@ -87,6 +82,11 @@ public class BusinessSampleEntrustDetailDO extends BusinessBaseDO { @TableField("FRCST_RSLT") private String forecastResult; /** + * 排序 + */ + @TableField("SRT") + private Integer sort; + /** * 是否称重,1-启用,0-不启用 */ @TableField("IS_WG") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustProjectDO.java index 410bad0..bf7eece 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustProjectDO.java @@ -7,7 +7,7 @@ import java.util.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 委检样品检测项目业务 DO +* 委检登记样品检测项目 DO * * @author 后台管理 */ @@ -32,7 +32,7 @@ public class BusinessSampleEntrustProjectDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 样品检验委托明细ID + * 委托登记样品明细ID */ @TableField("BSN_SMP_ENTT_DTL_ID") private Long businessSampleEntrustDetailId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustRegistrationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustRegistrationDO.java index 23ea807..c0d67a2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustRegistrationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleEntrustRegistrationDO.java @@ -8,6 +8,7 @@ import java.util.*; import java.time.LocalDateTime; import java.time.LocalDateTime; import java.time.LocalDateTime; + import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** @@ -76,11 +77,66 @@ public class BusinessSampleEntrustRegistrationDO extends BusinessBaseDO { @TableField("RMNE_SMP_REQM") private String remaineSampleRequirement; /** + * 创建方式,手动创建-manual、外部系统创建-interface + */ + @TableField("CRT_WY") + private String createWay; + /** + * 委托类型,委托登记-entrust_registration、检验委托-entrust_inspection + */ + @TableField("ENTT_TP") + private String entrustType; + /** + * 委托时间 + */ + @TableField("ENTT_TM") + private LocalDateTime entrustTime; + /** + * 送样人 + */ + @TableField("SMP_SNDR") + private String sampleSender; + /** + * 送样日期 + */ + @TableField("SMP_SND_DT") + private LocalDateTime sampleSendDate; + /** + * 收样人 + */ + @TableField("SMP_RCVR") + private String sampleReceiver; + /** + * 收样日期 + */ + @TableField("SMP_RCV_DT") + private LocalDateTime sampleReceiveDate; + /** * 样品状态,【字典】【jy_sample_entrust_status】块状、粉末、颗粒、液体 */ @TableField("SMP_STS") private String sampleStatus; /** + * 扩展信息数据集ID,T_DAT_COLT_FLD + */ + @TableField("EXT_INF_DAT_COLT_ID") + private Long externalInfomationDataCollectionId; + /** + * 扩展信息 + */ + @TableField("EXT_INF") + private String externalInfomation; + /** + * 委托单模板ID + */ + @TableField("CFG_RPT_TMPL_ID") + private Long configReportTemplateId; + /** + * 委托单模板key + */ + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; + /** * 电话 */ @TableField("TEL") @@ -131,27 +187,7 @@ public class BusinessSampleEntrustRegistrationDO extends BusinessBaseDO { @TableField("ASY_MTHD") private String assayMethod; /** - * 送样人 - */ - @TableField("SMP_SNDR") - private String sampleSender; - /** - * 送样日期 - */ - @TableField("SMP_SND_DT") - private LocalDateTime sampleSendDate; - /** - * 收样人 - */ - @TableField("SMP_RCVR") - private String sampleReceiver; - /** - * 收样日期 - */ - @TableField("SMP_RCV_DT") - private LocalDateTime sampleReceiveDate; - /** - * 登记状态,register-登记中、submitted-已提交 + * 登记状态,in_progress-登记中、submit-已提交 */ @TableField("REG_STS") private String registrationStatus; @@ -215,35 +251,11 @@ public class BusinessSampleEntrustRegistrationDO extends BusinessBaseDO { */ @TableField("RMK") private String remark; - /** - * 扩展信息 - */ - @TableField("EXT_INF") - private String externalInfomation; - /** - * 数据集key,T_DAT_COLT_FLD - */ - @TableField("DAT_COLT_ID") - private Long dataCollectionId; - /** - * 创建方式,手动创建-manual、外部系统创建-interface - */ - @TableField("CRT_WY") - private String createWay; - /** - * 创建人 - */ - @TableField("CRT_OPTR") - private String createOperator; - /** - * 委托类型:委托登记-entrust_registration、检验委托-entrust_inspection - */ - @TableField("ENTT_TP") - private String entrustType; - /** - * 委托时间 - */ - @TableField("ENTT_TM") - private LocalDateTime entrustTime; + + + //================扩展字段==================== + //委托来源 + @TableField(exist = false) + private String configEntrustSourceName; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDO.java index 620481f..4d8cff5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDO.java @@ -43,20 +43,25 @@ public class BusinessSampleHandoverDO extends BusinessBaseDO { @TableField("NAME") private String name; /** - * 交接单模版Key + * 交接单模板ID */ - @TableField("TMPL_KY") - private String templateKey; + @TableField("CFG_RPT_TMPL_ID") + private Long configReportTemplateId; /** - * 样品流程ID + * 交接单模板key */ - @TableField("SMP_FLW_ID") - private String sampleFlowId; + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; /** - * 样品流程code + * 样品流程配置ID */ - @TableField("SMP_FLW_CD") - private String sampleFlowCode; + @TableField("CFG_SMP_FLW_ID") + private Long configSampleFlowId; + /** + * 样品流程节点KEY + */ + @TableField("SMP_FLW_NDE_KY") + private String sampleFlowNodeKey; /** * 操作类型,【字典】【jy_sample_handover_biz type】归库、调拨、下架、销毁 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDetailDO.java index 04a1138..645cfcc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDetailDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSampleHandoverDetailDO.java @@ -4,6 +4,7 @@ import lombok.*; import java.util.*; import java.math.BigDecimal; import java.time.LocalDateTime; + import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** @@ -37,7 +38,7 @@ public class BusinessSampleHandoverDetailDO extends BusinessBaseDO { @TableField("BSN_SMP_HND_ID") private Long businessSampleHandoverId; /** - * 样品子样ID + * 分样子样ID */ @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleDO.java new file mode 100644 index 0000000..66f45a3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleDO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 定值样业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_std_smp") +@KeySequence("t_bsn_std_smp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessStandardSampleDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * ID路径 + */ + @TableField("ID_PATH") + private String idPath; + /** + * 上级ID + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 名称,一级:管理样、标准样、标样;二级:具体定值样 + */ + @TableField("NAME") + private String name; + /** + * 编号 + */ + @TableField("CD") + private String code; + /** + * 是否启用,1-启用,0-不启用 + */ + @TableField("IS_USE") + private Integer isUse; + /** + * 是否发布,1-是,0-否 + */ + @TableField("IS_PUB") + private Integer isPublish; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleProjectDO.java new file mode 100644 index 0000000..327f7db --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessStandardSampleProjectDO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 定值样检测项目业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_std_smp_prj") +@KeySequence("t_bsn_std_smp_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessStandardSampleProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 定值样ID + */ + @TableField("BSN_STD_SMP_ID") + private Long businessStandardSampleId; + /** + * 定值样元素配置ID + */ + @TableField("CFG_STD_SMP_PRJ_ID") + private Long configStandardSampleProjectId; + /** + * 检测项目ID + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目名称 + */ + @TableField("DIC_PRJ_NAME") + private String dictionaryProjectName; + /** + * 检测项目单位 + */ + @TableField("DIC_PRJ_UNT") + private String dictionaryProjectUnit; + /** + * 标准值 + */ + @TableField("STD_VAL") + private String standardValue; + /** + * 标准允差值 + */ + @TableField("STD_TLC_VAL") + private String standardToleraanceValue; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java new file mode 100644 index 0000000..4db2d23 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleAssessmentDO.java @@ -0,0 +1,131 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 班组判定数据业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_sb_prn_smp_asmt") +@KeySequence("t_bsn_sb_prn_smp_asmt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** + * 任务类型,【字典】【jy_sample_task_type】常规、抽查... + */ + @TableField("TSK_TP") + private String taskType; + /** + * 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel... + */ + @TableField("ASY_TP") + private String assayType; + /** + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 判定值 + */ + @TableField("ASMT_VAL") + private String assessmentValue; + /** + * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 + */ + @TableField("ASMT_STS") + private String assessmentStatus; + /** + * 方法检出下限值 + */ + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleDO.java index 200dfc4..922ded1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubParentSampleDO.java @@ -91,7 +91,7 @@ public class BusinessSubParentSampleDO extends BusinessBaseDO { * 超差标注 */ @TableField("ASMT_STS") - private Integer assessmentStatus; + private String assessmentStatus; /** * 样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java new file mode 100644 index 0000000..5e8876a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAnalysisGroupDO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 子样分析班组业务 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_sb_smp_anl_grp") +@KeySequence("t_bsn_sb_smp_anl_grp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSubSampleAnalysisGroupDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 分样子样ID + */ + @TableField("BSN_SB_SMP_ID") + private Long businessSubSampleId; + /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** + * 样品状态 + */ + @TableField("SMP_STS") + private String sampleStatus; + /** + * 收样人 + */ + @TableField("SMP_RCVR") + private String sampleReceiver; + /** + * 收样时间 + */ + @TableField("SMP_RCV_TM") + private LocalDateTime sampleReceiveTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java index 543e8e2..a8df1b7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleAssessmentDO.java @@ -33,7 +33,12 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 子样样ID + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 分样子样ID */ @TableField("BSN_SB_SMP_ID") private Long businessSubSampleId; @@ -53,17 +58,27 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** + * 用途,ingredient-配料、report-报出、ingredient_report-配料及报出 + */ + @TableField("USG") + private String usage; + /** + * 符号,=、>、<、等 + */ + @TableField("SMB") + private String symbol; + /** * 任务类型,【字典】【jy_sample_task_type】常规、抽查... */ @TableField("TSK_TP") - private Long taskType; + private String taskType; /** - * 分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行... + * 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel... */ @TableField("ASY_TP") - private Long assayType; + private String assayType; /** - * 数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 */ @TableField("DAT_TP") private String dataType; @@ -75,14 +90,19 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { /** * 判定值 */ - @TableField("ASMT_VAL") + @TableField(value = "ASMT_VAL", updateStrategy = FieldStrategy.ALWAYS) private String assessmentValue; /** - * 超差标注 + * 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差 */ @TableField("ASMT_STS") private String assessmentStatus; /** + * 方法检出下限值 + */ + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** * 是否已上报 */ @TableField("IS_RPOD") @@ -98,11 +118,6 @@ public class BusinessSubSampleAssessmentDO extends BusinessBaseDO { @TableField("RPT_TM") private LocalDateTime reportTime; /** - * 复检次数 - */ - @TableField("RCHK_CNT") - private Integer recheckCount; - /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java index dc8df80..e49b280 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleDO.java @@ -2,8 +2,8 @@ package com.zt.plat.module.qms.business.bus.dal.dataobject; import lombok.*; import java.util.*; -import java.math.BigDecimal; -import java.time.LocalDateTime; + import java.math.BigDecimal; + import java.time.LocalDateTime; import java.time.LocalDateTime; import java.time.LocalDateTime; import java.time.LocalDateTime; @@ -98,45 +98,55 @@ public class BusinessSubSampleDO extends BusinessBaseDO { @TableField("IS_WG") private Integer isWeighing; /** - * 末次样品重量 + * 末次重量,末次样品重量 */ @TableField("LST_SMP_WGT") private BigDecimal lastSampleWeight; /** - * 样品流程ID + * 末次称重天平编号 */ - @TableField("SMP_FLW_ID") - private Long sampleFlowId; + @TableField("LST_BAL_CD") + private String lastBalanceCode; /** - * 样品流程KEY + * 样品流程配置ID */ - @TableField("SMP_FLW_KY") - private String sampleFlowKey; + @TableField("CFG_SMP_FLW_ID") + private Long configSampleFlowId; /** - * 下一步样品流程名称 + * 样品流程节点KEY */ - @TableField("NXT_SMP_FLW") - private String nextSampleFlow; + @TableField("SMP_FLW_NDE_KY") + private String sampleFlowNodeKey; /** - * 是否已生成归库码 + * 样品流程节点时间 */ - @TableField("IS_GEN_RTN_CD") - private Integer isGenerateReturnCode; + @TableField("SMP_FLW_NDE_TM") + private LocalDateTime sampleFlowNodeTime; /** - * 任务指派给分析人 + * 下一步样品流程节点名称 + */ + @TableField("NXT_SMP_FLW_NDE") + private String nextSampleFlowNode; + /** + * 样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废 + */ + @TableField("SMP_STS") + private String sampleStatus; + /** + * 分析人 */ @TableField("ASY_OPTR") private String assayOperator; /** - * 是否已指派 + * 是否已分配任务 */ - @TableField("IS_TSKD") - private Integer isTasked; + @TableField("IS_ASN_TSKD") + private Integer isAssignTasked; /** - * 指派时间 + * 分配任务时间 */ - @TableField("TSK_TM") - private LocalDateTime taskTime; + @TableField("ASN_TSK_TM") + private LocalDateTime assignTaskTime; /** * 是否已上报 */ @@ -161,7 +171,12 @@ public class BusinessSubSampleDO extends BusinessBaseDO { * 归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁 */ @TableField("RTN_STS") - private Integer returnStatus; + private String returnStatus; + + //调拨状态 + @TableField("DST_STS") + private String dispatchStatus; + /** * 打印次数 */ @@ -173,26 +188,21 @@ public class BusinessSubSampleDO extends BusinessBaseDO { @TableField("PRNT_LST_TM") private LocalDateTime printLastTime; /** - * 样品流程节点时间 + * 上一个交接记录ID */ - @TableField("SMP_FLW_TM") - private LocalDateTime sampleFlowTime; - /** - * 样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废 - */ - @TableField("SMP_STS") - private String sampleStatus; - /** - * 是否启用,1-启用,0-不启用 - */ - @TableField("IS_ENBD") - private Integer isEnabled; + @TableField("UP_SMP_RCD_ID") + private Long upSampleRecordId; /** * 分析元素备注 */ @TableField("ANL_RMK") private String analysisRemark; /** + * 是否启用,1-启用,0-不启用 + */ + @TableField("IS_ENBD") + private Integer isEnabled; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java new file mode 100644 index 0000000..0d4e22d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessSubSampleParentRecheckDO.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 分样复检业务数据 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_sb_smp_prn_rchk") +@KeySequence("t_bsn_sb_smp_prn_rchk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessSubSampleParentRecheckDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 样品ID + */ + @TableField("SMP_ID") + private Long sampleId; + /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 复检样品主样ID + */ + @TableField("RCHK_BSN_BSE_SMP_ID") + private Long recheckBusinessBaseSampleId; + /** + * 复检样品分样ID + */ + @TableField("RCHK_BSN_SB_PRN_SMP_ID") + private Long recheckBusinessSubParentSampleId; + /** + * 复检检测方法配置ID + */ + @TableField("RCHK_CFG_ASY_MTHD_ID") + private Long recheckConfigAssayMethodId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java new file mode 100644 index 0000000..a503aef --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/dataobject/BusinessXRFDataDO.java @@ -0,0 +1,137 @@ +package com.zt.plat.module.qms.business.bus.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 荧光采集记录 DO +* +* @author 后台管理 +*/ +@TableName("t_bsn_xrf_dat") +@KeySequence("t_bsn_xrf_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class BusinessXRFDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private String deviceNo; + /** + * 荧光线名称 + */ + @TableField("LINE_NAME") + private String lineName; + /** + * 荧光样品id + */ + @TableField("XRF_SMP_ID") + private String xRFSampleId; + /** + * 样品编号 + */ + @TableField("SMP_CD") + private String sampleCode; + /** + * 样品名称 + */ + @TableField("SMP_NAME") + private String sampleName; + /** + * 样品时间 + */ + @TableField("SMP_TM") + private LocalDateTime sampleTime; + /** + * 分析人 + */ + @TableField("ASY_OPTR") + private String assayOperator; + /** + * 样品主样ID + */ + @TableField("BSN_BSE_SMP_ID") + private Long businessBaseSampleId; + /** + * 样品分样ID + */ + @TableField("BSN_SB_PRN_SMP_ID") + private Long businessSubParentSampleId; + /** + * 分样子样ID + */ + @TableField("BSN_SB_SMP_ID") + private Long businessSubSampleId; + /** + * 检测任务ID + */ + @TableField("BSN_ASY_TSK_DAT_ID") + private Long businessAssayTaskDataId; + /** + * 检测数据 + */ + @TableField("ASY_DAT") + private String assayData; + /** + * 是否为检查创建数据 + */ + @TableField("IS_CHK_CRT") + private Integer isCheckCreate; + /** + * 是否已匹配 + */ + @TableField("IS_MATD") + private Integer isMatched; + /** + * 是否已上报 + */ + @TableField("IS_RPOD") + private Integer isReported; + /** + * 上报人 + */ + @TableField("RPTR") + private String reporter; + /** + * 上报时间 + */ + @TableField("RPT_TM") + private LocalDateTime reportTime; + /** + * 乐观锁 + */ + @TableField("UPD_CNT") + private Integer updateCount; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java index ed8acac..d5b2ddc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java @@ -4,8 +4,15 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -17,6 +24,41 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BusinessAssayParameterDataMapper extends BaseMapperX { + default List selectProjectAndParameterBy(BusinessAssayParameterDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId) + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId) + .selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessAssayParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessAssayParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessAssayParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessAssayParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + .selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .eqIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataId()) + .eqIfPresent(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId()) + .eqIfPresent(BusinessAssayParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessAssayParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessAssayParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessAssayParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessAssayParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayParameterDataDO::getRemark, reqVO.getRemark()) + .orderByAsc(ConfigAssayMethodProjectParameterDO::getSortNo)); + } + default PageResult selectPage(BusinessAssayParameterDataPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataId()) @@ -31,5 +73,15 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX selectByBusinessAssayProjectDataId(Long businessAssayProjectDataId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataId)); + } + + default List selectByBusinessAssayProjectDataIds(List businessAssayProjectDataIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java index bd5b0e2..ce6ef99 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayProjectDataMapper.java @@ -4,8 +4,17 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -16,12 +25,53 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface BusinessAssayProjectDataMapper extends BaseMapperX { + + default List selectProjectAndParameterBy(BusinessAssayProjectDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId) + .selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessAssayProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + //.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(BusinessAssayProjectDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessAssayProjectDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessAssayProjectDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodProjectDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + .selectAs(ConfigAssayMethodProjectDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodProjectDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'project'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .eqIfPresent(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessAssayProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessAssayProjectDataDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessAssayProjectDataDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessAssayProjectDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessAssayProjectDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessAssayProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessAssayProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment()) + .eqIfPresent(BusinessAssayProjectDataDO::getIsEnabled, reqVO.getIsEnabled()) + .eqIfPresent(BusinessAssayProjectDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayProjectDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayProjectDataDO::getRemark, reqVO.getRemark()) + .orderByAsc(ConfigAssayMethodProjectDO::getSortNo)); + } default PageResult selectPage(BusinessAssayProjectDataPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) .eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(BusinessAssayProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessAssayProjectDataDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessAssayProjectDataDO::getSymbol, reqVO.getSymbol()) .eqIfPresent(BusinessAssayProjectDataDO::getValue, reqVO.getValue()) .eqIfPresent(BusinessAssayProjectDataDO::getDataType, reqVO.getDataType()) .eqIfPresent(BusinessAssayProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition()) @@ -33,5 +83,50 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX selectByBusinessAssayTaskDataId(Long businessAssayTaskDataId) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .eq(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataId)); + } + + default List selectByBusinessAssayTaskDataIds(List businessAssayTaskDataIds) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIds)); + } + + default List selectAnalysisBy(BusinessAssayProjectDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayProjectDataExtendRespVO::getAssayOperator) + .selectAs(BusinessAssayTaskDataDO::getAnalysisCount, BusinessAssayProjectDataExtendRespVO::getAnalysisCount) + .selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessBaseSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubParentSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubSampleId) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayProjectDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayProjectDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayProjectDataExtendRespVO::getSampleAssayCode) + .selectAs(BusinessSubSampleDO::getSampleReturnCode, BusinessAssayProjectDataExtendRespVO::getSampleReturnCode) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java new file mode 100644 index 0000000..bb5434e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 检测报表数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessAssayReportDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessAssayReportDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayReportDataDO::getConfigReportTypeId, reqVO.getConfigReportTypeId()) + .eqIfPresent(BusinessAssayReportDataDO::getConfigSampleReportId, reqVO.getConfigSampleReportId()) + .eqIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessAssayReportDataDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessAssayReportDataDO::getDataSource, reqVO.getDataSource()) + .eqIfPresent(BusinessAssayReportDataDO::getAssayData, reqVO.getAssayData()) + .eqIfPresent(BusinessAssayReportDataDO::getIsAllReported, reqVO.getIsAllReported()) + .eqIfPresent(BusinessAssayReportDataDO::getReportedSource, reqVO.getReportedSource()) + .eqIfPresent(BusinessAssayReportDataDO::getReportFlowCode, reqVO.getReportFlowCode()) + .eqIfPresent(BusinessAssayReportDataDO::getDocumentDataId, reqVO.getDocumentDataId()) + .eqIfPresent(BusinessAssayReportDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayReportDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayReportDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayReportDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayReportDataDO::getId)); + } + + default List selectBytBusinessBaseSampleId(Long businessBaseSampleId) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleId)); + } + + //查询报告待编制数据 + Page queryWaitingDataForReport(IPage page, @Param("param") BusinessAssayReportDataPageReqVO param); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java index 819695c..3aa916b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java @@ -2,16 +2,31 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; import java.util.*; +import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl.On; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; -import jakarta.validation.Valid; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; + import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 子样检测任务业务 Mapper @@ -21,9 +36,6 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BusinessAssayTaskDataMapper extends BaseMapperX { - - List> selectUnAssayTaskGroupList(); - default List selectList(BusinessAssayTaskDataReqVO reqVO) { return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) @@ -40,14 +52,19 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX() + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .eq(BusinessAssayTaskDataDO::getId, businessAssayTaskDataId)); + } + + default BusinessAssayTaskDataExtendRespVO selectBySampleCode(String sampleCode) { + return selectJoinOne(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .eq(BusinessSubSampleDO::getSampleAssayCode, sampleCode) + .eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO)); + } + + default List selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) { + MPJLambdaWrapper mpjLambdaWrapper = new MPJLambdaWrapper() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on + .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId)) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getConfigReportTemplateKey, BusinessAssayTaskDataExtendRespVO::getConfigReportTemplateKey) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) + .selectAs(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, BusinessAssayTaskDataExtendRespVO::getSampleReceiver) + .selectAs(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, BusinessAssayTaskDataExtendRespVO::getSampleReceiveTime); + if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()); + } + if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) { + mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()); + } + mpjLambdaWrapper.ne(BusinessSubSampleAnalysisGroupDO::getSampleStatus, "待收样"); + mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getBusinessSubSampleId).orderByAsc(BusinessAssayTaskDataDO::getReportTime); + + return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper); + + +// return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() +// .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) +// .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) +// .selectAll(BusinessAssayTaskDataDO.class) +// .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) +// .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) +// .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) +// .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) +// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()) +// .eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()) +// .eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()) +// .eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) +// .likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) +// .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()) +// .betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) +// .eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) +// .eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()) +// .eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()) +// .betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()) +// .eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) +// .eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) +// .betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) +// .eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount()) +// .eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()) +// .eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) +// .betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()) +// .eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()) +// .orderByAsc(BusinessAssayTaskDataDO::getBusinessSubSampleId) +// .orderByAsc(BusinessAssayTaskDataDO::getReportTime)); + } + + /** + * 查询未指派的分析任务分组 + * @param reqVO + * @return + */ + List selectUnAssayTaskGroupList(@Param("reqVO") BusinessAssayTaskDataReqVO reqVO); + + /** + * 查询未审核的分析任务分组 + * @param reqVO + * @return + */ + List selectUnAuditTaskGroupList(@Param("reqVO") BusinessAssayTaskDataReqVO reqVO); + + /** + * 根据任务分配单id查询分析任务 + * @param businessAssayTaskId 任务分配单id + * @return + */ + default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId)); + } + + /** + * 根据子样查询分析任务 + * @param businessSubSampleId 子样id + * @return + */ + default List selectByBusinessSubSampleId(Long businessSubSampleId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)); + } + + /** + * 根据子样查询分析任务 + * @param businessSubSampleId 子样id + * @param configAssayMethodId 分析方法 + * @return + */ + default List selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId)); + } + + /** + * 根据分样查询分析任务 + * @param businessSubParentSampleId 分样样id + * @param configAssayMethodId 分析方法 + * @return + */ + default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId)); + } + + /** + * 根据分样查询分析任务 + * @param businessSubParentSampleIds 分样样id + * @param configAssayMethodId 分析方法 + * @return + */ + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId)); + } + + /** + * 查询是否上报的分析任务 + * @param excludeIds 排除的id列表 + * @param businessSubSampleId 子样id + * @param configAssayMethodId 分析方法id + * @param isReported 是否上报 + * @return + */ + default List selectIsReportedList(List excludeIds, Long businessSubSampleId, Long configAssayMethodId, Integer isReported) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapperX(); + if (CollUtil.isNotEmpty(excludeIds)) { + queryWrapper.notIn(BusinessAssayTaskDataDO::getId, excludeIds); + } + queryWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDataDO::getIsReported, isReported); + return selectList(queryWrapper); + } + + /** + * 查询双杯样是否上报的分析任务 + * @param excludeIds 排除的id列表 + * @param businessSubParentSampleId 分样id + * @param configAssayMethodId 分析方法id + * @param isReported 是否上报 + * @return + */ + default List selectDoubleCupIsReportedList(List excludeIds, Long businessSubParentSampleId, Long configAssayMethodId, Integer isReported) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapperX(); + if (CollUtil.isNotEmpty(excludeIds)) { + queryWrapper.notIn(BusinessAssayTaskDataDO::getId, excludeIds); + } + queryWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDataDO::getIsReported, isReported); + return selectList(queryWrapper); + } + + /** + * 查询最大分析次数的检测任务数据 + * @param businessSubSampleId 子样id + * @param configAssayMethodId 分析方法 + * @return + */ + default List selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + BusinessAssayTaskDataDO maxAnalysisCount = selectOne(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .orderByDesc(BusinessAssayTaskDataDO::getAnalysisCount) + .last("LIMIT 1")); + + return selectList(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDataDO::getAnalysisCount, maxAnalysisCount.getAnalysisCount())); + + + } + + /** + * 查询未指派的子样 + * @return + */ + List selectUnAssignTaskedSubSample(); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java new file mode 100644 index 0000000..4c73ff9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.java @@ -0,0 +1,97 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 检测任务分配明细 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessAssayTaskDetailMapper extends BaseMapperX { + + default PageResult selectPage(BusinessAssayTaskDetailPageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessAssayTaskDetailExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayTaskDetailDO::getBusinessAssayTaskDataId) + .selectAll(BusinessAssayTaskDetailDO.class) + .selectAs(BusinessAssayTaskDetailDO::getSampleCode, BusinessAssayTaskDetailExtendRespVO::getSampleAssayCode) + .selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessBaseSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessSubParentSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessSubSampleId) + .selectAs(BusinessAssayTaskDataDO::getConfigAssayMethodId, BusinessAssayTaskDetailExtendRespVO::getConfigAssayMethodId) + .selectAs(BusinessAssayTaskDataDO::getTaskType, BusinessAssayTaskDetailExtendRespVO::getTaskType) + .selectAs(BusinessAssayTaskDataDO::getAssayType, BusinessAssayTaskDetailExtendRespVO::getAssayType) + .selectAs(BusinessAssayTaskDataDO::getAssayProject, BusinessAssayTaskDetailExtendRespVO::getAssayProject) + .selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayTaskDetailExtendRespVO::getAssayOperator) + .selectAs(BusinessAssayTaskDataDO::getAssayDepartmentId, BusinessAssayTaskDetailExtendRespVO::getAssayDepartmentId) + .selectAs(BusinessAssayTaskDataDO::getAssayDepartmentName, BusinessAssayTaskDetailExtendRespVO::getAssayDepartmentName) + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSampleId, reqVO.getSampleId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getTaskNo, reqVO.getTaskNo()) + .likeIfPresent(BusinessAssayTaskDetailDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessAssayTaskDetailDO::getCupNumber, reqVO.getCupNumber()) + .eqIfPresent(BusinessAssayTaskDetailDO::getDataSourceType, reqVO.getDataSourceType()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(BusinessAssayTaskDetailDO::getRollbackStatus, reqVO.getRollbackStatus()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskDetailDO::getId)); + } + + default List selectList(BusinessAssayTaskDetailReqVO reqVO) { + return selectJoinList(BusinessAssayTaskDetailExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayTaskDetailDO::getBusinessAssayTaskDataId) + .selectAll(BusinessAssayTaskDetailDO.class) + .selectAs(BusinessAssayTaskDetailDO::getSampleCode, BusinessAssayTaskDetailExtendRespVO::getSampleAssayCode) + .selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessBaseSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessSubParentSampleId) + .selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayTaskDetailExtendRespVO::getBusinessSubSampleId) + .selectAs(BusinessAssayTaskDataDO::getConfigAssayMethodId, BusinessAssayTaskDetailExtendRespVO::getConfigAssayMethodId) + .selectAs(BusinessAssayTaskDataDO::getTaskType, BusinessAssayTaskDetailExtendRespVO::getTaskType) + .selectAs(BusinessAssayTaskDataDO::getAssayType, BusinessAssayTaskDetailExtendRespVO::getAssayType) + .selectAs(BusinessAssayTaskDataDO::getAssayProject, BusinessAssayTaskDetailExtendRespVO::getAssayProject) + .selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayTaskDetailExtendRespVO::getAssayOperator) + .selectAs(BusinessAssayTaskDataDO::getAssayDepartmentId, BusinessAssayTaskDetailExtendRespVO::getAssayDepartmentId) + .selectAs(BusinessAssayTaskDataDO::getAssayDepartmentName, BusinessAssayTaskDetailExtendRespVO::getAssayDepartmentName) + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSampleId, reqVO.getSampleId()) + .eqIfPresent(BusinessAssayTaskDetailDO::getTaskNo, reqVO.getTaskNo()) + .likeIfPresent(BusinessAssayTaskDetailDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessAssayTaskDetailDO::getCupNumber, reqVO.getCupNumber()) + .eqIfPresent(BusinessAssayTaskDetailDO::getDataSourceType, reqVO.getDataSourceType()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(BusinessAssayTaskDetailDO::getRollbackStatus, reqVO.getRollbackStatus()) + .eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskDetailDO::getId)); + } + + default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); + } + + /** + * 物理批量删除删除 + * @param idList + * @return + */ + int physicalDeleteByIds(@Param("idList") List idList); +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java new file mode 100644 index 0000000..8ceec27 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskMapper.java @@ -0,0 +1,134 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import jakarta.validation.Valid; + +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测任务分配业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessAssayTaskMapper extends BaseMapperX { + + default PageResult selectPage(BusinessAssayTaskPageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessAssayTaskExtendRespVO.class, new MPJLambdaWrapperX() + .selectSub(BusinessAssayTaskDetailDO.class, s -> s.selectCount(BusinessAssayTaskDetailDO::getId).eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, BusinessAssayTaskDO::getId), BusinessAssayTaskExtendRespVO::getAssayTaskCount) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId) + .selectAll(BusinessAssayTaskDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName) + .eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo()) + .likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName()) + .eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessAssayTaskDO::getConfigReportTemplateId, reqVO.getConfigReportTemplateId()) + .eqIfPresent(BusinessAssayTaskDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) + .eqIfPresent(BusinessAssayTaskDO::getTaskSourceType, reqVO.getTaskSourceType()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssignOperator, reqVO.getTaskAssignOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskAssignTime, reqVO.getTaskAssignTime()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssignStatus, reqVO.getTaskAssignStatus()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskAssignSubmitTime, reqVO.getTaskAssignSubmitTime()) + .eqIfPresent(BusinessAssayTaskDO::getIsIngredients, reqVO.getIsIngredients()) + .eqIfPresent(BusinessAssayTaskDO::getIngredientsStatus, reqVO.getIngredientsStatus()) + .eqIfPresent(BusinessAssayTaskDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getAssayTime, reqVO.getAssayTime()) + .betweenIfPresent(BusinessAssayTaskDO::getAssaySubmitTime, reqVO.getAssaySubmitTime()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssayStatus, reqVO.getTaskAssayStatus()) + .inIfPresent(BusinessAssayTaskDO::getTaskAssayStatus, reqVO.getTaskAssayStatusList()) + .betweenIfPresent(BusinessAssayTaskDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessAssayTaskDO::getReportOperator, reqVO.getReportOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskFinishTime, reqVO.getTaskFinishTime()) + .eqIfPresent(BusinessAssayTaskDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(BusinessAssayTaskDO::getFormDataCollectionId, reqVO.getFormDataCollectionId()) + .eqIfPresent(BusinessAssayTaskDO::getFormValue, reqVO.getFormValue()) + .eqIfPresent(BusinessAssayTaskDO::getDocumentSignature, reqVO.getDocumentSignature()) + .eqIfPresent(BusinessAssayTaskDO::getFinishStatus, reqVO.getFinishStatus()) + .eqIfPresent(BusinessAssayTaskDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(BusinessAssayTaskDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskDO::getId)); + } + + + default List selectList(BusinessAssayTaskPageReqVO reqVO) { + return selectJoinList(BusinessAssayTaskExtendRespVO.class, new MPJLambdaWrapperX() + .selectSub(BusinessAssayTaskDetailDO.class, s -> s.selectCount(BusinessAssayTaskDetailDO::getId).eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, BusinessAssayTaskDO::getId), BusinessAssayTaskExtendRespVO::getAssayTaskCount) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId) + .selectAll(BusinessAssayTaskDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName) + .eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo()) + .likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName()) + .eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessAssayTaskDO::getConfigReportTemplateId, reqVO.getConfigReportTemplateId()) + .eqIfPresent(BusinessAssayTaskDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) + .eqIfPresent(BusinessAssayTaskDO::getTaskSourceType, reqVO.getTaskSourceType()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssignOperator, reqVO.getTaskAssignOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskAssignTime, reqVO.getTaskAssignTime()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssignStatus, reqVO.getTaskAssignStatus()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskAssignSubmitTime, reqVO.getTaskAssignSubmitTime()) + .eqIfPresent(BusinessAssayTaskDO::getIsIngredients, reqVO.getIsIngredients()) + .eqIfPresent(BusinessAssayTaskDO::getIngredientsStatus, reqVO.getIngredientsStatus()) + .eqIfPresent(BusinessAssayTaskDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getAssayTime, reqVO.getAssayTime()) + .betweenIfPresent(BusinessAssayTaskDO::getAssaySubmitTime, reqVO.getAssaySubmitTime()) + .eqIfPresent(BusinessAssayTaskDO::getTaskAssayStatus, reqVO.getTaskAssayStatus()) + .inIfPresent(BusinessAssayTaskDO::getTaskAssayStatus, reqVO.getTaskAssayStatusList()) + .betweenIfPresent(BusinessAssayTaskDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessAssayTaskDO::getReportOperator, reqVO.getReportOperator()) + .betweenIfPresent(BusinessAssayTaskDO::getTaskFinishTime, reqVO.getTaskFinishTime()) + .eqIfPresent(BusinessAssayTaskDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(BusinessAssayTaskDO::getFormDataCollectionId, reqVO.getFormDataCollectionId()) + .eqIfPresent(BusinessAssayTaskDO::getFormValue, reqVO.getFormValue()) + .eqIfPresent(BusinessAssayTaskDO::getDocumentSignature, reqVO.getDocumentSignature()) + .eqIfPresent(BusinessAssayTaskDO::getFinishStatus, reqVO.getFinishStatus()) + .eqIfPresent(BusinessAssayTaskDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(BusinessAssayTaskDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskDO::getId)); + } + + + /** + * 根据分析方法、 分析人和分配人 查询进行中的任务分配单。 + * @param configAssayMethodId 分析方法 + * @param assayUser 分析人 + * @param assignUser 分配人 + * @return + */ + default BusinessAssayTaskDO selectAssignInProgressByAssayUserAndAssignUser(Long configAssayMethodId, String assayUser, String assignUser) { + return selectOne(new LambdaQueryWrapperX() + .eq(BusinessAssayTaskDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDO::getAssayOperator, assayUser) + .eq(BusinessAssayTaskDO::getTaskAssignOperator, assignUser) + .eq(BusinessAssayTaskDO::getTaskAssignStatus, QmsCommonConstant.IN_PROGRESS)); + } + + /** + * 根据id查询分配任务单 + * @param id + * @return + */ + default BusinessAssayTaskExtendRespVO selectBusinessAssayTaskById(Long id) { + return selectJoinOne(BusinessAssayTaskExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId) + .selectAll(BusinessAssayTaskDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName) + .eq(BusinessAssayTaskDO::getId, id)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessBaseSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessBaseSampleMapper.java index 15c324b..865ccfb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessBaseSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessBaseSampleMapper.java @@ -1,7 +1,5 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSamplePageReqVO; @@ -20,18 +18,19 @@ public interface BusinessBaseSampleMapper extends BaseMapperX selectPage(BusinessBaseSamplePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(BusinessBaseSampleDO::getSampleName, reqVO.getSampleName()) + .likeIfPresent(BusinessBaseSampleDO::getBaseSampleName, reqVO.getBaseSampleName()) .eqIfPresent(BusinessBaseSampleDO::getSampleCode, reqVO.getSampleCode()) .eqIfPresent(BusinessBaseSampleDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) .eqIfPresent(BusinessBaseSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) .betweenIfPresent(BusinessBaseSampleDO::getSampleTime, reqVO.getSampleTime()) .eqIfPresent(BusinessBaseSampleDO::getPrintCount, reqVO.getPrintCount()) .betweenIfPresent(BusinessBaseSampleDO::getPrintLastTime, reqVO.getPrintLastTime()) - .eqIfPresent(BusinessBaseSampleDO::getSampleFlowId, reqVO.getSampleFlowId()) - .eqIfPresent(BusinessBaseSampleDO::getSampleFlowKey, reqVO.getSampleFlowKey()) - .betweenIfPresent(BusinessBaseSampleDO::getSampleFlowTime, reqVO.getSampleFlowTime()) + .eqIfPresent(BusinessBaseSampleDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) + .eqIfPresent(BusinessBaseSampleDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) + .betweenIfPresent(BusinessBaseSampleDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) .eqIfPresent(BusinessBaseSampleDO::getSampleStatus, reqVO.getSampleStatus()) - .eqIfPresent(BusinessBaseSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(BusinessBaseSampleDO::getOperator, reqVO.getOperator()) + .eqIfPresent(BusinessBaseSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(BusinessBaseSampleDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(BusinessBaseSampleDO::getUpdateCount, reqVO.getUpdateCount()) .eqIfPresent(BusinessBaseSampleDO::getRemark, reqVO.getRemark()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java index 4d1dd98..2f54e7e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubExtendRespVO; @@ -8,6 +9,9 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecord import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -28,19 +32,34 @@ public interface BusinessHandoverRecordSubMapper extends BaseMapperX selectByBusinessSubSampleId(Long businessSubSampleId) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessHandoverRecordSubDO::getBusinessSubSampleId, businessSubSampleId) + .orderByDesc(BusinessHandoverRecordSubDO::getCreateTime)); + } + + default List selectByBusinessSubSampleIds(List businessSubSampleIds) { + return selectList(new LambdaQueryWrapper() + .in(BusinessHandoverRecordSubDO::getBusinessSubSampleId, businessSubSampleIds) + .orderByDesc(BusinessHandoverRecordSubDO::getCreateTime)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java new file mode 100644 index 0000000..95340f3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测系数任务数据,空白样、标样 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCCoefficientDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCCoefficientDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId)); + } + + default List selectList(BusinessQCCoefficientDataReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCCoefficientDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCCoefficientDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCCoefficientDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCCoefficientDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCCoefficientDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCCoefficientDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientDataDO::getId)); + } + + default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, businessAssayTaskId)); + } + + default List selectByBusinessAssayTaskIdAndDictionaryBusinessKey(Long businessAssayTaskId, String dictionaryBusinessKey) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCCoefficientDataDO::getBusinessAssayTaskId, businessAssayTaskId) + .eq(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, dictionaryBusinessKey)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java new file mode 100644 index 0000000..dea9438 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.java @@ -0,0 +1,86 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测系数参数业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCCoefficientParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, reqVO.getBusinessQCCoefficientDataId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, reqVO.getConfigQCSampleMethodParameterId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCCoefficientParameterDataDO::getId)); + } + + default List selectProjectAndParameterBy(BusinessQCCoefficientParameterDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId) + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCCoefficientParameterDataDO::getDictionaryParameterId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId) + .selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessQCCoefficientParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessQCCoefficientParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessQCCoefficientParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigQCSampleMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + .selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigQCSampleMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, reqVO.getBusinessQCCoefficientDataId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, reqVO.getConfigQCSampleMethodParameterId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCCoefficientParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCCoefficientParameterDataDO::getRemark, reqVO.getRemark()) + .orderByAsc(ConfigQCSampleMethodParameterDO::getSortNo)); + } + + default List selectByBusinessQCCoefficientDataId(Long businessQCCoefficientDataId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, businessQCCoefficientDataId)); + } + + default List selectByBusinessQCCoefficientDataIds(List businessQCCoefficientDataIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, businessQCCoefficientDataIds)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.java new file mode 100644 index 0000000..3e4912d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCDataPageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessQCDataExtendRespVO.class, new MPJLambdaWrapperX() + .eqIfPresent(BusinessQCDataDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessQCDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCDataDO::getId)); + } + + default List selectList(BusinessQCDataReqVO reqVO) { + return selectJoinList(BusinessQCDataExtendRespVO.class, new MPJLambdaWrapperX() + .eqIfPresent(BusinessQCDataDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessQCDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCDataDO::getId)); + } + + default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCDataDO::getBusinessAssayTaskId, businessAssayTaskId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java new file mode 100644 index 0000000..a001b5d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控管理样检测任务数据,管理样、标准样 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCManagementDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCManagementDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId)); + } + + default List selectList(BusinessQCManagementDataReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCManagementDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessQCManagementDataDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessQCManagementDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQCManagementDataDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessQCManagementDataDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessQCManagementDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessQCManagementDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessQCManagementDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessQCManagementDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessQCManagementDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessQCManagementDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessQCManagementDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessQCManagementDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementDataDO::getId)); + } + + default List selectByBusinessAssayTaskId(Long businessAssayTaskId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java new file mode 100644 index 0000000..42c7f8a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测参数数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCManagementParameterDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCManagementParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, reqVO.getBusinessQCManagementProjectDataId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementParameterDataDO::getId)); + } + + default List selectProjectAndParameterBy(BusinessQCManagementParameterDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId) + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCManagementParameterDataDO::getDictionaryParameterId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId) + .selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessQCManagementParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay) + .selectAs(BusinessQCManagementParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessQCManagementParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessQCManagementParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + .selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + .selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .eqIfPresent(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, reqVO.getBusinessQCManagementProjectDataId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementParameterDataDO::getRemark, reqVO.getRemark()) + .orderByAsc(ConfigAssayMethodProjectParameterDO::getSortNo)); + } + + default List selectByBusinessQCManagementProjectDataId(Long businessQCManagementProjectDataId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, businessQCManagementProjectDataId)); + } + + default List selectByBusinessQCManagementProjectDataIds(List businessQCManagementProjectDataIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, businessQCManagementProjectDataIds)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java new file mode 100644 index 0000000..9642585 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测项目数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCManagementProjectDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCManagementProjectDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getIsEnabled, reqVO.getIsEnabled()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementProjectDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCManagementProjectDataDO::getId)); + } + + default List selectProjectAndParameterBy(BusinessQCManagementProjectDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId) + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId) + .selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId) + .selectAs(BusinessQCManagementProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey) + //.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectAndParameterRespVO::getShowName) + .selectAs(BusinessQCManagementProjectDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType) + .selectAs(BusinessQCManagementProjectDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition) + .selectAs(BusinessQCManagementProjectDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessAssayProjectAndParameterRespVO::getUnit) + .selectAs(ConfigAssayMethodProjectDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull) + .selectAs(ConfigAssayMethodProjectDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula) + .selectAs(ConfigAssayMethodProjectDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo) + .selectAs("'project'", BusinessAssayProjectAndParameterRespVO::getType) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey) + .selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName) + .eqIfPresent(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getIsEnabled, reqVO.getIsEnabled()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCManagementProjectDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCManagementProjectDataDO::getRemark, reqVO.getRemark()) + .orderByAsc(ConfigAssayMethodProjectDO::getSortNo)); + } + + default List selectByBusinessQCManagementDataId(Long businessQCManagementDataId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, businessQCManagementDataId)); + } + + default List selectByBusinessQCManagementDataIds(List businessQCManagementDataIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, businessQCManagementDataIds)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.java new file mode 100644 index 0000000..bb2112f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测参数数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCParameterDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCParameterDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCParameterDataDO::getBusinessQCProjectDataId, reqVO.getBusinessQCProjectDataId()) + .eqIfPresent(BusinessQCParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId()) + .eqIfPresent(BusinessQCParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(BusinessQCParameterDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCParameterDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCParameterDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCParameterDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCParameterDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCParameterDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCParameterDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCParameterDataDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.java new file mode 100644 index 0000000..e06bcf1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测项目数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQCProjectDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQCProjectDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQCProjectDataDO::getBusinessQCDataId, reqVO.getBusinessQCDataId()) + .eqIfPresent(BusinessQCProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessQCProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessQCProjectDataDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessQCProjectDataDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessQCProjectDataDO::getValue, reqVO.getValue()) + .eqIfPresent(BusinessQCProjectDataDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQCProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQCProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment()) + .eqIfPresent(BusinessQCProjectDataDO::getIsEnabled, reqVO.getIsEnabled()) + .eqIfPresent(BusinessQCProjectDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQCProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQCProjectDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQCProjectDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQCProjectDataDO::getId)); + } + + default List selectByBusinessQCDataIds(List businessQCDataIds) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessQCProjectDataDO::getBusinessQCDataId, businessQCDataIds)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.java new file mode 100644 index 0000000..68843ee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQualityControlSampleProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测项目业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessQualityControlSampleProjectMapper extends BaseMapperX { + + default PageResult selectPage(BusinessQualityControlSampleProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessQualityControlSampleProjectDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getConfigStandardSampleProjectId, reqVO.getConfigStandardSampleProjectId()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .likeIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectName, reqVO.getDictionaryProjectName()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectUnit, reqVO.getDictionaryProjectUnit()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getStandardValue, reqVO.getStandardValue()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getToleraanceValue, reqVO.getToleraanceValue()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getQualityControlValue, reqVO.getQualityControlValue()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessQualityControlSampleProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessQualityControlSampleProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessQualityControlSampleProjectDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleAssayResultMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleAssayResultMapper.java index 2b16627..7894716 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleAssayResultMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleAssayResultMapper.java @@ -8,12 +8,9 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResu import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayResultDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - /** * 委检登记来样品位 Mapper * diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.java new file mode 100644 index 0000000..f171aba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO; +import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; +import org.apache.ibatis.annotations.Mapper; + +/** + * 样品调拨明细 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSampleDispatchDetailMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSampleDispatchDetailPageReqVO reqVO) { + MPJLambdaWrapperX wrapper = new MPJLambdaWrapperX<>(); + //子样表 + wrapper.leftJoin(BusinessSubSampleDO.class , BusinessSubSampleDO::getId, BusinessSampleDispatchDetailDO::getBusinessSubSampleId); + //库位 + wrapper.leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getId, BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, w->{ + w.eq(ConfigWarehouseLocationDO::getWarehouseType, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + }); + //仓库 + wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId); + wrapper.selectAll(BusinessSampleDispatchDetailDO.class) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessSampleDispatchDetailExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessSampleDispatchDetailExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleReturnCode, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnCode) + .selectAs(BusinessSubSampleDO::getReturnStatus, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnStatus) + .selectAs(BusinessSubSampleDO::getReturnTime, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnTime) + .selectAs(BusinessSubSampleDO::getDispatchStatus, BusinessSampleDispatchDetailExtendRespVO::getDispatchStatus) + .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSampleDispatchDetailExtendRespVO::getWarehouseLocationCode) + .selectAs(ConfigWarehouseLocationParDO::getName, BusinessSampleDispatchDetailExtendRespVO::getWarehouseName) + //查询条件 + .inIfPresent(BusinessSampleDispatchDetailDO::getId, reqVO.getIdList()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getParentId, reqVO.getParentId()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUser, reqVO.getBorrowUser()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUserId, reqVO.getBorrowUserId()) + .betweenIfPresent(BusinessSampleDispatchDetailDO::getBorrowTime, reqVO.getBorrowTime()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowStatus, reqVO.getBorrowStatus()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackUser, reqVO.getGivebackUser()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackUserId, reqVO.getGivebackUserId()) + .betweenIfPresent(BusinessSampleDispatchDetailDO::getGivebackTime, reqVO.getGivebackTime()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackStatus, reqVO.getGivebackStatus()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getUseStatus, reqVO.getUseStatus()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(BusinessSampleDispatchDetailDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(BusinessSampleDispatchDetailDO::getCreateTime, reqVO.getCreateTime()) + //排序 + .orderByDesc(BusinessSampleDispatchDetailDO::getId); + + return selectJoinPage(reqVO, BusinessSampleDispatchDetailExtendRespVO.class, wrapper); + + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.java new file mode 100644 index 0000000..ed578c4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 样品调拨 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSampleDispatchMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSampleDispatchPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSampleDispatchDO::getMainDepartmentId, reqVO.getMainDepartmentId()) + .likeIfPresent(BusinessSampleDispatchDO::getMainDepartmentName, reqVO.getMainDepartmentName()) + .eqIfPresent(BusinessSampleDispatchDO::getApplyUser, reqVO.getApplyUser()) + .eqIfPresent(BusinessSampleDispatchDO::getApplyUserId, reqVO.getApplyUserId()) + .eqIfPresent(BusinessSampleDispatchDO::getApplyDepartment, reqVO.getApplyDepartment()) + .eqIfPresent(BusinessSampleDispatchDO::getApplyDepartmentId, reqVO.getApplyDepartmentId()) + .betweenIfPresent(BusinessSampleDispatchDO::getApplyTime, reqVO.getApplyTime()) + .eqIfPresent(BusinessSampleDispatchDO::getWarehouseUser, reqVO.getWarehouseUser()) + .eqIfPresent(BusinessSampleDispatchDO::getWarehouseUserId, reqVO.getWarehouseUserId()) + .eqIfPresent(BusinessSampleDispatchDO::getSubmitStatus, reqVO.getSubmitStatus()) + .eqIfPresent(BusinessSampleDispatchDO::getFlowInstanceId, reqVO.getFlowInstanceId()) + .eqIfPresent(BusinessSampleDispatchDO::getFlowStatus, reqVO.getFlowStatus()) + .eqIfPresent(BusinessSampleDispatchDO::getFinishStatus, reqVO.getFinishStatus()) + .eqIfPresent(BusinessSampleDispatchDO::getCancelStatus, reqVO.getCancelStatus()) + .eqIfPresent(BusinessSampleDispatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(BusinessSampleDispatchDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(BusinessSampleDispatchDO::getCreateTime, reqVO.getCreateTime()) + .ne(BusinessSampleDispatchDO::getCancelStatus, "-1") + .orderByDesc(BusinessSampleDispatchDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java index 4c8c0ef..3103db7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustDetailMapper.java @@ -4,16 +4,17 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - /** * 委检登记样品明细 Mapper * @@ -22,12 +23,47 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @Mapper public interface BusinessSampleEntrustDetailMapper extends BaseMapperX { - default PageResult selectPage(BusinessSampleEntrustDetailPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() + default List selectList(BusinessSampleEntrustDetailReqVO reqVO) { + return selectJoinList(BusinessSampleEntrustDetailExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId) + .leftJoin(BusinessBaseSampleDO.class, BusinessBaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBusinessBaseSampleId) + .leftJoin(ConfigBaseSampleDO.class, ConfigBaseSampleDO::getId, BusinessBaseSampleDO::getConfigBaseSampleId) + .selectAll(BusinessSampleEntrustDetailDO.class) + .selectAs(BaseSampleDO::getName, BusinessSampleEntrustDetailExtendRespVO::getBaseSampleName) + .selectAs(BusinessBaseSampleDO::getConfigBaseSampleId, BusinessSampleEntrustDetailExtendRespVO::getConfigBaseSampleId) + .selectAs(ConfigBaseSampleDO::getPrintTemplate, BusinessSampleEntrustDetailExtendRespVO::getPrintTemplate) .eqIfPresent(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, reqVO.getBusinessSampleEntrustRegistrationId()) .eqIfPresent(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) .eqIfPresent(BusinessSampleEntrustDetailDO::getBaseSampleId, reqVO.getBaseSampleId()) - .eqIfPresent(BusinessSampleEntrustDetailDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getSampleTypeDictionaryBusinessId, reqVO.getSampleTypeDictionaryBusinessId()) + .likeIfPresent(BusinessSampleEntrustDetailDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessSampleEntrustDetailDO::getEntrustSampleName, reqVO.getEntrustSampleName()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getEntrustSampleCode, reqVO.getEntrustSampleCode()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getSort, reqVO.getSort()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getForecastResult, reqVO.getForecastResult()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getIsWeighing, reqVO.getIsWeighing()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSampleEntrustDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSampleEntrustDetailDO::getId)); + } + + default PageResult selectPage(BusinessSampleEntrustDetailPageReqVO reqVO) { + return selectJoinPage(reqVO, BusinessSampleEntrustDetailExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId) + .leftJoin(BusinessBaseSampleDO.class, BusinessBaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBusinessBaseSampleId) + .leftJoin(ConfigBaseSampleDO.class, ConfigBaseSampleDO::getId, BusinessBaseSampleDO::getConfigBaseSampleId) + .selectAll(BusinessSampleEntrustDetailDO.class) + .selectAs(BaseSampleDO::getName, BusinessSampleEntrustDetailExtendRespVO::getBaseSampleName) + .selectAs(BusinessBaseSampleDO::getConfigBaseSampleId, BusinessSampleEntrustDetailExtendRespVO::getConfigBaseSampleId) + .selectAs(ConfigBaseSampleDO::getPrintTemplate, BusinessSampleEntrustDetailExtendRespVO::getPrintTemplate) + .eqIfPresent(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, reqVO.getBusinessSampleEntrustRegistrationId()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getBaseSampleId, reqVO.getBaseSampleId()) + .eqIfPresent(BusinessSampleEntrustDetailDO::getSampleTypeDictionaryBusinessId, reqVO.getSampleTypeDictionaryBusinessId()) .likeIfPresent(BusinessSampleEntrustDetailDO::getSampleName, reqVO.getSampleName()) .eqIfPresent(BusinessSampleEntrustDetailDO::getSampleCode, reqVO.getSampleCode()) .likeIfPresent(BusinessSampleEntrustDetailDO::getEntrustSampleName, reqVO.getEntrustSampleName()) @@ -42,6 +78,10 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX selectByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) { + return selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId)); + } /** * 物理批量删除删除 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustProjectMapper.java index 8f3648c..3d983ab 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustProjectMapper.java @@ -4,18 +4,18 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectExtendRespVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - /** - * 委检样品检测项目业务 Mapper + * 委检登记样品检测项目 Mapper * * @author 后台管理 */ @@ -34,6 +34,17 @@ public interface BusinessSampleEntrustProjectMapper extends BaseMapperX selectByBusinessSampleEntrustDetailId(Long businessSampleEntrustDetailId) { + return selectJoinList(BusinessSampleEntrustProjectExtendRespVO.class, new MPJLambdaWrapperX() + .selectAll(BusinessSampleEntrustProjectDO.class) + .selectAs(DictionaryProjectDO::getCode, BusinessSampleEntrustProjectExtendRespVO::getProjectCode) + .selectAs(DictionaryProjectDO::getName, BusinessSampleEntrustProjectExtendRespVO::getProjectName) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSampleEntrustProjectExtendRespVO::getProjectSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSampleEntrustProjectExtendRespVO::getProjectShowName) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSampleEntrustProjectDO::getDictionaryProjectId) + .eq(BusinessSampleEntrustProjectDO::getBusinessSampleEntrustDetailId, businessSampleEntrustDetailId)); + } /** * 物理批量删除删除 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.java index bcd9e2d..42a76b5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.java @@ -1,7 +1,7 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; @@ -12,6 +12,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustR import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 委检登记业务 Mapper @@ -27,7 +28,6 @@ public interface BusinessSampleEntrustRegistrationMapper extends BaseMapperX queryWaitingDataForReport(IPage page, @Param("param") BusinessSampleEntrustRegistrationPageReqVO param); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverDetailMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverDetailMapper.java index 711d241..b07b3f9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverDetailMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverDetailMapper.java @@ -1,12 +1,14 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -32,5 +34,10 @@ public interface BusinessSampleHandoverDetailMapper extends BaseMapperX selectByBusinessSampleHandoverId(Long businessSampleHandoverId) { + return selectList(new LambdaQueryWrapperX() + .eq(BusinessSampleHandoverDetailDO::getBusinessSampleHandoverId, businessSampleHandoverId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverMapper.java index 0b335bb..5ac872f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleHandoverMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -21,9 +20,10 @@ public interface BusinessSampleHandoverMapper extends BaseMapperX() .eqIfPresent(BusinessSampleHandoverDO::getCode, reqVO.getCode()) .likeIfPresent(BusinessSampleHandoverDO::getName, reqVO.getName()) - .eqIfPresent(BusinessSampleHandoverDO::getTemplateKey, reqVO.getTemplateKey()) - .eqIfPresent(BusinessSampleHandoverDO::getSampleFlowId, reqVO.getSampleFlowId()) - .eqIfPresent(BusinessSampleHandoverDO::getSampleFlowCode, reqVO.getSampleFlowCode()) + .eqIfPresent(BusinessSampleHandoverDO::getConfigReportTemplateId, reqVO.getConfigReportTemplateId()) + .eqIfPresent(BusinessSampleHandoverDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) + .eqIfPresent(BusinessSampleHandoverDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) + .eqIfPresent(BusinessSampleHandoverDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) .eqIfPresent(BusinessSampleHandoverDO::getOperationType, reqVO.getOperationType()) .betweenIfPresent(BusinessSampleHandoverDO::getOperationTime, reqVO.getOperationTime()) .eqIfPresent(BusinessSampleHandoverDO::getOperator, reqVO.getOperator()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.java new file mode 100644 index 0000000..21d522f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 定值样业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessStandardSampleMapper extends BaseMapperX { + + default PageResult selectPage(BusinessStandardSamplePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessStandardSampleDO::getIdPath, reqVO.getIdPath()) + .eqIfPresent(BusinessStandardSampleDO::getParentId, reqVO.getParentId()) + .likeIfPresent(BusinessStandardSampleDO::getName, reqVO.getName()) + .eqIfPresent(BusinessStandardSampleDO::getCode, reqVO.getCode()) + .eqIfPresent(BusinessStandardSampleDO::getIsUse, reqVO.getIsUse()) + .eqIfPresent(BusinessStandardSampleDO::getIsPublish, reqVO.getIsPublish()) + .eqIfPresent(BusinessStandardSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessStandardSampleDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessStandardSampleDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessStandardSampleDO::getId)); + } + + +// default List selectByConfigQCSampleMethodId(Long configQCSampleMethodId) { +// return selectJoinList(BusinessStandardSampleExtendRespVO.class, new MPJLambdaWrapperX() +// .rightJoin(ConfigQCStandardSampleDO.class, ConfigQCStandardSampleDO::getBusinessStandardSampleId, BusinessStandardSampleDO::getId) +// .selectAll(BusinessStandardSampleDO.class) +// .selectAs(ConfigQCStandardSampleDO::getConfigQCSampleMethodId, BusinessStandardSampleExtendRespVO::getConfigQCSampleMethodId) +// .selectCollection(BusinessStandardSampleProjectDO.class, BusinessStandardSampleExtendRespVO::getStandardSampleProjectList) +// .leftJoin(BusinessStandardSampleProjectDO.class, BusinessStandardSampleProjectDO::getBusinessStandardSampleId, BusinessStandardSampleDO::getId) +// .eq(ConfigQCStandardSampleDO::getConfigQCSampleMethodId, configQCSampleMethodId) +// .eq(BusinessStandardSampleDO::getIsPublish, QmsCommonConstant.YES) +// .eq(BusinessStandardSampleDO::getIsUse, QmsCommonConstant.YES)); +// } + + + default List getBusinessStandardSampleLeafList() { + return selectJoinList(BusinessStandardSampleExtendRespVO.class, new MPJLambdaWrapperX() + .selectAll(BusinessStandardSampleDO.class) + .selectCollection(BusinessStandardSampleProjectDO.class, BusinessStandardSampleExtendRespVO::getStandardSampleProjectList) + .leftJoin(BusinessStandardSampleProjectDO.class, BusinessStandardSampleProjectDO::getBusinessStandardSampleId, BusinessStandardSampleDO::getId) + .ne(BusinessStandardSampleDO::getParentId, 0) + .eq(BusinessStandardSampleDO::getIsPublish, QmsCommonConstant.YES) + .eq(BusinessStandardSampleDO::getIsUse, QmsCommonConstant.YES)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.java new file mode 100644 index 0000000..8fdf5a6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标准样检测项目业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessStandardSampleProjectMapper extends BaseMapperX { + + default PageResult selectPage(BusinessStandardSampleProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessStandardSampleProjectDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(BusinessStandardSampleProjectDO::getConfigStandardSampleProjectId, reqVO.getConfigStandardSampleProjectId()) + .eqIfPresent(BusinessStandardSampleProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .likeIfPresent(BusinessStandardSampleProjectDO::getDictionaryProjectName, reqVO.getDictionaryProjectName()) + .eqIfPresent(BusinessStandardSampleProjectDO::getDictionaryProjectUnit, reqVO.getDictionaryProjectUnit()) + .eqIfPresent(BusinessStandardSampleProjectDO::getStandardValue, reqVO.getStandardValue()) + .eqIfPresent(BusinessStandardSampleProjectDO::getStandardToleraanceValue, reqVO.getStandardToleraanceValue()) + .eqIfPresent(BusinessStandardSampleProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessStandardSampleProjectDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(BusinessStandardSampleProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessStandardSampleProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessStandardSampleProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessStandardSampleProjectDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java new file mode 100644 index 0000000..d37bdab --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.java @@ -0,0 +1,77 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 班组判定数据业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX { + + List selectUnReportMethodGroupList(); + + default PageResult selectPage(BusinessSubParentSampleAssessmentPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getSymbol, reqVO.getSymbol()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getTaskType, reqVO.getTaskType()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssayType, reqVO.getAssayType()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDataType, reqVO.getDataType()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessSubParentSampleAssessmentDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubParentSampleAssessmentDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubParentSampleAssessmentDO::getId)); + } + + default List selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectJoinList(BusinessSubParentSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentDO::getDictionaryProjectId) + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId) + .selectAll(BusinessSubParentSampleAssessmentDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) + .in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + List selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId); + + List getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId); + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java index b2f72ea..3c68a90 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleMapper.java @@ -1,7 +1,5 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java new file mode 100644 index 0000000..af60761 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 子样分析班组业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSubSampleAnalysisGroupPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, reqVO.getSampleReceiver()) + .betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, reqVO.getSampleReceiveTime()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubSampleAnalysisGroupDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubSampleAnalysisGroupDO::getId)); + } + + default List selectByBusinessSubSampleIdsAndAssayDepartmentId(List businessSubSampleIds, Long assayDepartmentId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds) + .eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java index b96a992..a31f853 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java @@ -1,13 +1,21 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 子样判定数据业务 Mapper @@ -19,10 +27,13 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX selectPage(BusinessSubSampleAssessmentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) .eqIfPresent(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleAssessmentDO::getUsage, reqVO.getUsage()) + .eqIfPresent(BusinessSubSampleAssessmentDO::getSymbol, reqVO.getSymbol()) .eqIfPresent(BusinessSubSampleAssessmentDO::getTaskType, reqVO.getTaskType()) .eqIfPresent(BusinessSubSampleAssessmentDO::getAssayType, reqVO.getAssayType()) .eqIfPresent(BusinessSubSampleAssessmentDO::getDataType, reqVO.getDataType()) @@ -32,12 +43,62 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List businessSubParentSampleIds, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) + .in(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(Long businessSubSampleId, Long configAssayMethodId, Long configAssayMethodProjectId) { + return selectOne(new LambdaQueryWrapperX() + .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, configAssayMethodProjectId)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java index 9b4d8af..e8f612c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleMapper.java @@ -3,11 +3,19 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; -import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import jakarta.validation.Valid; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -22,9 +30,21 @@ public interface BusinessSubSampleMapper extends BaseMapperX selectPage(BusinessSubSamplePageReqVO reqVO) { return selectJoinPage(reqVO, BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() + .selectSub(BusinessAssayTaskDataDO.class, s -> s.selectCount(BusinessAssayTaskDataDO::getId).eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessSubSampleDO::getId), BusinessSubSampleExtendRespVO::getAssayTaskCount) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + //库位 + .leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getId, BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, w->{ + w.eq(ConfigWarehouseLocationDO::getWarehouseType, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + }) + //仓库 + .leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId) .selectAll(BusinessSubSampleDO.class) .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) + .selectAs(ConfigWarehouseLocationDO::getCode, BusinessSubSampleExtendRespVO::getWarehouseLocationCode) + .selectAs(ConfigWarehouseLocationParDO::getName, BusinessSubSampleExtendRespVO::getWarehouseName) .eqIfPresent(BusinessSubSampleDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) .eqIfPresent(BusinessSubSampleDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessSubSampleDO::getConfigSubSampleId, reqVO.getConfigSubSampleId()) @@ -36,36 +56,45 @@ public interface BusinessSubSampleMapper extends BaseMapperX selectlist(@Valid BusinessSubSampleReqVO reqVO) { + default List selectList(@Valid BusinessSubSampleReqVO reqVO) { return selectJoinList(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() + .selectSub(BusinessAssayTaskDataDO.class, s -> s.selectCount(BusinessAssayTaskDataDO::getId).eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessSubSampleDO::getId), BusinessSubSampleExtendRespVO::getAssayTaskCount) .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) .selectAll(BusinessSubSampleDO.class) .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) .eqIfPresent(BusinessSubSampleDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) .eqIfPresent(BusinessSubSampleDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) .eqIfPresent(BusinessSubSampleDO::getConfigSubSampleId, reqVO.getConfigSubSampleId()) @@ -77,40 +106,61 @@ public interface BusinessSubSampleMapper extends BaseMapperX() .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) .selectAll(BusinessSubSampleDO.class) .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) + .eq(BusinessSubSampleDO::getId, id) + .eq(BusinessSubSampleDO::getSampleStatus, QmsCommonConstant.NORMAL) + .eq(BusinessSubSampleDO::getIsEnabled, QmsCommonConstant.YES) + .orderByDesc(BusinessSubSampleDO::getId)); + } + + default BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(BusinessSubSampleReqVO reqVO) { + return selectJoinOne(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId) + .leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId) + .selectAll(BusinessSubSampleDO.class) + .selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName) + .selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint) + .selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate) .eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode()) - .eqIfPresent(BusinessSubSampleDO::getSampleFlowKey, reqVO.getSampleFlowKey()) - .eqIfPresent(BusinessSubSampleDO::getSampleStatus, "normal") - .eqIfPresent(BusinessSubSampleDO::getIsEnabled, 1) + .eqIfPresent(BusinessSubSampleDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) + .eqIfPresent(BusinessSubSampleDO::getSampleStatus, QmsCommonConstant.NORMAL) + .eqIfPresent(BusinessSubSampleDO::getIsEnabled, QmsCommonConstant.YES) .orderByDesc(BusinessSubSampleDO::getId)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java new file mode 100644 index 0000000..c7f396e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 分样复检业务数据 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessSubSampleParentRecheckMapper extends BaseMapperX { + + default PageResult selectPage(BusinessSubSampleParentRecheckPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessSubSampleParentRecheckDO::getSampleId, reqVO.getSampleId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessBaseSampleId, reqVO.getRecheckBusinessBaseSampleId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, reqVO.getRecheckBusinessSubParentSampleId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, reqVO.getRecheckConfigAssayMethodId()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessSubSampleParentRecheckDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessSubSampleParentRecheckDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessSubSampleParentRecheckDO::getId)); + } + + default List selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(List recheckBusinessSubParentSampleIds, Long recheckConfigAssayMethodId) { + return selectList(new LambdaQueryWrapperX() + .in(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, recheckBusinessSubParentSampleIds) + .eq(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, recheckConfigAssayMethodId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java new file mode 100644 index 0000000..fde1a91 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.java @@ -0,0 +1,73 @@ +package com.zt.plat.module.qms.business.bus.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +/** + * 荧光采集记录 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface BusinessXRFDataMapper extends BaseMapperX { + + default PageResult selectPage(BusinessXRFDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName()) + .eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId()) + .eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName()) + .betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime()) + .eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData()) + .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate()) + .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched()) + .eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessXRFDataDO::getId)); + } + + default List selectList(BusinessXRFDataReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName()) + .eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId()) + .inIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleIdList()) + .eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode()) + .likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName()) + .betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime()) + .eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator()) + .eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId()) + .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData()) + .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate()) + .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched()) + .eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessXRFDataDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustDetail.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustDetail.java index 940ca4a..54aee9f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustDetail.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustDetail.java @@ -22,7 +22,7 @@ public class SampleEntrustDetail { private Long businessBaseSampleId; /** 样品类型ID 字典表:【T_DIC_BSN】结算样、委检样、生产样等 **/ - private Long dictionaryBusinessId; + private Long sampleTypeDictionaryBusinessId; /** 样品名称 **/ private String sampleName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustParam.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustParam.java index 3fceceb..e449380 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustParam.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleEntrustParam.java @@ -49,6 +49,9 @@ public class SampleEntrustParam { /** 创建方式,手动创建-manual、外部系统创建-interface **/ private String createWay; + /** 委托来源key **/ + private String configEntrustSourceKey; + /** 委托类型:委托登记-entrust_registration、检验委托-entrust_inspection **/ private String entrustType; @@ -58,8 +61,8 @@ public class SampleEntrustParam { /** 备注 **/ private String remark; - /** 数据集id **/ - private Long dataCollectionId; + /** 扩展信息的数据集id **/ + private Long externalInfomationDataCollectionId; /** 扩展信息 **/ private String externalInfomation; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignManualParam.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignManualParam.java new file mode 100644 index 0000000..20adaa1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignManualParam.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.qms.business.bus.liteflow.param; + +import java.util.List; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 手动分配任务 + */ +@Data +@Accessors(chain = true) +public class SampleTaskAssignManualParam { + + /** 分析人员 **/ + private AssignAssayUser assignAssayUser; + + /** 检测任务id列表 **/ + private List assayTaskDataIdList; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignMethodParam.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignMethodParam.java new file mode 100644 index 0000000..baf4124 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignMethodParam.java @@ -0,0 +1,21 @@ +package com.zt.plat.module.qms.business.bus.liteflow.param; + +import java.util.List; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 按分析方法分配参数 + */ +@Data +@Accessors(chain = true) +public class SampleTaskAssignMethodParam { + + /** 分析方法id **/ + private Long configAssayMethodId; + + /** 接受分配任务的人员 **/ + private List assignAssayUserList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignSampleParam.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignSampleParam.java new file mode 100644 index 0000000..f891746 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/param/SampleTaskAssignSampleParam.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.business.bus.liteflow.param; + +import java.util.List; + +import lombok.Data; +import lombok.experimental.Accessors; + + +@Data +@Accessors(chain = true) +public class SampleTaskAssignSampleParam { + + /** 分析人员 **/ + private AssignAssayUser assignAssayUser; + + /** 待分析的样品id **/ + private List assignSampleIdList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/analysisaudit/SampleAnalysisProjectAssessmentCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/analysisaudit/SampleAnalysisProjectAssessmentCmp.java new file mode 100644 index 0000000..3492f76 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/analysisaudit/SampleAnalysisProjectAssessmentCmp.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.analysisaudit; + +import java.math.BigDecimal; +import java.util.List; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper; + +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleAnalysisProjectAssessmentCmp", name = "样品分析项目判定") +public class SampleAnalysisProjectAssessmentCmp extends NodeComponent { + + @Resource + private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper; + + @Override + public void process() throws Exception { + + List configAssayMethodProjectAssessmentList = configAssayMethodProjectAssessmentMapper.selectList(); + + BigDecimal min_yc = BigDecimal.ZERO;//最小允差 + BigDecimal max_yc = BigDecimal.ZERO;//最大允差 + BigDecimal min_va = BigDecimal.ZERO;//最小值 + BigDecimal max_va = BigDecimal.ZERO;//最大值 + BigDecimal k = BigDecimal.ZERO;//斜率k + BigDecimal b = BigDecimal.ZERO;//纵截距b + BigDecimal c = BigDecimal.ZERO;//调整参数 + BigDecimal yc_value = BigDecimal.ZERO;//允差值 + + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCheckCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCheckCmp.java index aa37c72..9400550 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCheckCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCheckCmp.java @@ -7,6 +7,7 @@ import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; /** * 样品委托检查 @@ -21,18 +22,16 @@ public class SampleEntrustCheckCmp extends NodeComponent { //获取样品委托单 BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = sampleEntrustContext.getSampleEntrustRegistration(); - if ("entrust_registration".equals(sampleEntrustRegistration.getEntrustType())) { - if (sampleEntrustRegistration.getConfigEntrustSourceId() == null) { - throw new ServiceException(500, "委托来源id不允许为空"); - } - ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId()); - if (configEntrustSource == null) { - throw new ServiceException(500, "委托来源id不正确"); - } - + + if (sampleEntrustRegistration.getConfigEntrustSourceId() == null) { + throw new ServiceException(1_032_100_000, "委托来源id不允许为空"); + } + ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId()); + if (configEntrustSource == null) { + throw new ServiceException(1_032_100_000, "委托来源id不正确"); } - sampleEntrustRegistration.setDataCheckStatus("success"); + sampleEntrustRegistration.setDataCheckStatus(QmsCommonConstant.SUCCESS); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustContextInitCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustContextInitCmp.java index 26e44dc..d8f960a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustContextInitCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustContextInitCmp.java @@ -3,6 +3,8 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import java.util.ArrayList; import java.util.List; +import org.apache.commons.lang3.StringUtils; + import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; @@ -62,7 +64,7 @@ public class SampleEntrustContextInitCmp extends NodeComponent { SampleEntrustParam sampleEntrustParam = this.getRequestData(); if (sampleEntrustParam == null) { - throw new ServiceException(500, "样品委托参数不允许为空"); + throw new ServiceException(1_032_100_000, "样品委托参数不允许为空"); } //获取样品委托上下文 @@ -79,7 +81,7 @@ public class SampleEntrustContextInitCmp extends NodeComponent { //委托来源配置 List configEntrustSourceList = configEntrustSourceMapper.selectList(); sampleEntrustContext.setConfigEntrustSourceList(configEntrustSourceList); - + //物料检验标准 List materialAssayStandardList = materialAssayStandardMapper.selectList(); sampleEntrustContext.setMaterialAssayStandardList(materialAssayStandardList); @@ -94,6 +96,22 @@ public class SampleEntrustContextInitCmp extends NodeComponent { //委托登记 BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = BeanUtil.copyProperties(sampleEntrustParam, BusinessSampleEntrustRegistrationDO.class); + + //委托来源id为空并且委托来源key也为空 + if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isBlank(sampleEntrustParam.getConfigEntrustSourceKey())) { + throw new ServiceException(1_032_100_000, "委托来源id或委托来源key为空"); + } + + //委托来源的id为空 + if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isNotBlank(sampleEntrustParam.getConfigEntrustSourceKey()) && StringUtils.isNotBlank(sampleEntrustParam.getEntrustType())) { + ConfigEntrustSourceDO configEntrustSourceDO = configEntrustSourceList.stream().filter(f -> f.getKey().equals(sampleEntrustParam.getConfigEntrustSourceKey()) && f.getEntrustType().equals(sampleEntrustParam.getEntrustType())).findFirst().orElse(null); + if (configEntrustSourceDO == null) { + throw new ServiceException(1_032_100_000, "样品委托来源不正确"); + } + sampleEntrustRegistration.setConfigEntrustSourceId(configEntrustSourceDO.getId()); + } + + //赋值委托来源id sampleEntrustContext.setSampleEntrustRegistration(sampleEntrustRegistration); List detailList = sampleEntrustParam.getSampleEntrustDetailList(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCreateDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCreateDataCmp.java index 736128e..6fd2513 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCreateDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustCreateDataCmp.java @@ -5,6 +5,8 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; @@ -20,7 +22,9 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustProje import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; import com.zt.plat.module.qms.core.code.SequenceUtil; import jakarta.annotation.Resource; @@ -30,6 +34,9 @@ public class SampleEntrustCreateDataCmp extends NodeComponent { @Resource private SequenceUtil sequenceUtil; + @Resource + private ConfigReportTemplateMapper configReportTemplateMapper; + @Resource private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper; @@ -50,22 +57,32 @@ public class SampleEntrustCreateDataCmp extends NodeComponent { BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = sampleEntrustContext.getSampleEntrustRegistration(); //获取委托来源配置 - String codeRule = "QMS_YTJY_ENTT_SRC_CD"; - if (sampleEntrustRegistration.getConfigEntrustSourceId() != null) { - ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId()); - codeRule = configEntrustSource.getCodeRule(); + ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId()); + ConfigReportTemplateDO configReportTemplate = configReportTemplateMapper.selectLatestConfigReportTemplateByKey(configEntrustSource.getConfigReportTemplateKey()); + + String entrustNumber = null; + if (StringUtils.isNotBlank(configEntrustSource.getCodeField())) { + String externalInfomation = sampleEntrustRegistration.getExternalInfomation(); + JSONObject extJsonObject = JSON.parseObject(externalInfomation); + entrustNumber = extJsonObject.getString(configEntrustSource.getCodeField()); + } else { + String codeRule = configEntrustSource.getCodeRule(); + entrustNumber = sequenceUtil.genCode(codeRule); } //赋值id sampleEntrustRegistration.setId(IdWorker.getId()); //设置委托单号 - sampleEntrustRegistration.setEntrustNumber(sequenceUtil.genCode(codeRule)); + sampleEntrustRegistration.setEntrustNumber(entrustNumber); + sampleEntrustRegistration.setRegistrationStatus("in_progress"); - sampleEntrustRegistration.setCreateOperator(sampleEntrustContext.getLoginRealname()); + sampleEntrustRegistration.setConfigReportTemplateId(configReportTemplate.getId()); + sampleEntrustRegistration.setConfigReportTemplateKey(configReportTemplate.getKey()); + + //sampleEntrustRegistration.setCreateOperator(sampleEntrustContext.getLoginRealname()); List sampleAssayResultList = new ArrayList<>(); - - + List sampleEntrustDetailList = sampleEntrustContext.getSampleEntrustDetailList(); for (BusinessSampleEntrustDetailDO businessSampleEntrustDetail : sampleEntrustDetailList) { businessSampleEntrustDetail.setBusinessSampleEntrustRegistrationId(sampleEntrustRegistration.getId()); @@ -87,12 +104,12 @@ public class SampleEntrustCreateDataCmp extends NodeComponent { //保存样品委托登记 businessSampleEntrustRegistrationMapper.insert(sampleEntrustRegistration); - //保存样品明细 + //保存委托样品明细 if (CollUtil.isNotEmpty(sampleEntrustDetailList)) { businessSampleEntrustDetailMapper.insertBatch(sampleEntrustDetailList); } - //保存检测项目 + //保存检测检测项目 if (CollUtil.isNotEmpty(sampleEntrustProjectList)) { businessSampleEntrustProjectMapper.insertBatch(sampleEntrustProjectList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java index aa8cdd1..6390054 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustGenSampleDataCmp.java @@ -12,8 +12,10 @@ import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayResultDO; @@ -21,9 +23,11 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustD import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleAssayResultMapper; @@ -31,28 +35,38 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetai import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigBaseSampleMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleFlowMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.MaterialAssayStandardMethodMapper; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.business.dic.dal.mapper.DictionaryProjectMapper; import com.zt.plat.module.qms.core.code.SequenceUtil; import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据") @@ -61,6 +75,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private SequenceUtil sequenceUtil; + @Resource + private BaseSampleMapper baseSampleMapper; + @Resource private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper; @@ -91,6 +108,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private BusinessSubSampleMapper businessSubSampleMapper; + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + @Resource private ConfigAssayMethodMapper configAssayMethodMapper; @@ -111,9 +131,21 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { @Resource private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Resource + private DictionaryProjectMapper dictionaryProjectMapper; @Resource private ConfigSampleFlowMapper configSampleFlowMapper; + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Resource + private ConfigSampleReportMapper configSampleReportMapper; + + @Resource + private MaterialAssayStandardMethodMapper materialAssayStandardMethodMapper; @Override public void process() throws Exception { @@ -133,7 +165,27 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { //样品来样品位 List sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList(); + //金银检测项目字典id列表 + List auAgDictionaryProjectIdList = new ArrayList<>() { + private static final long serialVersionUID = 1L; + + { + add(1000000000000000002L); + add(1000000000000000003L); + }}; + //硫的检测项目字典id + Long sDictionaryProjectId = 1000000000000000004L; + //商检样品来源id + List sjEntrustSourceIdList = new ArrayList<>() { + private static final long serialVersionUID = 1L; + + { + add(1000000000000000002L);//中铜国贸 + }}; + + //样品大类列表 + List baseSampleList = baseSampleMapper.selectList(); //主样配置 List configBaseSampleList = configBaseSampleMapper.selectList(); @@ -149,111 +201,250 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { List configAssayMethodProjectList = configAssayMethodProjectMapper.selectList(); //分析方法检测项目参数配置 List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectList(); - //样品流程配置 - List configSampleFlowList = configSampleFlowMapper.selectList(); + //检测项目字典 + List dictionaryProjectList = dictionaryProjectMapper.selectList(); + //主样报表配置 + List configSampleReportList = configSampleReportMapper.selectList(); + + //样品流程配置 + List configSampleFlowKeyList = new ArrayList<>(); + List configBaseSampleFlowKeyList = configBaseSampleList.stream().map(m -> m.getFlowKey()).distinct().collect(Collectors.toList()); + configSampleFlowKeyList.addAll(configBaseSampleFlowKeyList); + List configSubSampleFlowKeyList = configSubSampleList.stream().map(m -> m.getFlowKey()).distinct().collect(Collectors.toList()); + configSampleFlowKeyList.addAll(configSubSampleFlowKeyList); + List configSampleFlowList = configSampleFlowMapper.selectLatestConfigSampleFlowListByKeys(configSampleFlowKeyList); + + //主样 List businessBaseSampleDOList = new ArrayList<>(); + //分样 List businessSubParentSampleDOList = new ArrayList<>(); + //分样子样 List businessSubSampleDOList = new ArrayList<>(); + //分样子样分析班组 + List businessSubSampleAnalysisGroupDOList = new ArrayList<>(); + //子样检测任务 List businessAssayTaskDataDOList = new ArrayList<>(); + //检测任务的分析项目 List businessAssayProjectDataDOList = new ArrayList<>(); + //分析项目对应的分析参数 List businessAssayParameterDataDOList = new ArrayList<>(); + //分析报表数据 + List businessAssayReportDataDOList = new ArrayList<>(); + + //是否为商检委托 + Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId()); + //是否分析金银 + Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId())); + //是否分析硫 + Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId)); + + //子样流转信息列表 + List sampleFlowInfoList = new ArrayList<>(); + //委托明细排序 List sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList()); + //主样 BusinessBaseSampleDO businessBaseSampleDO = null; + int sort = 0;//委托明细顺序 for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细 + + //样品大类 + BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null); + //获取当前样品的检测项目 List sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList()); - for (BusinessSampleEntrustProjectDO businessSampleEntrustProjectDO : sampleEntrustProjectDOList) {//循环检测项目 - //获取默认的分析方法对应的检测项目 - MaterialAssayStandardMethodDO materialAssayStandardMethodDefault = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailId(businessSampleEntrustProjectDO.getMaterialAssayStandardDetailId()); -// if (materialAssayStandardMethodDefault == null) { -// throw new ServiceException(500, "未找到对应的检测项目方法"); -// } - //获取检测方法id - Long configAssayMethodId = materialAssayStandardMethodDefault.getConfigAssayMethodId(); - //通过方法id在子样分析方法配置中查找子样配置 - ConfigSubSampleMethodDO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> configAssayMethodId.equals(f.getConfigAssayMethodId())).findFirst().orElse(null); - //获取到子样配置id - Long configSubSampleId = configSubSampleMethod.getConfigSubSampleId(); - //获取到子样配置 - ConfigSubSampleDO configSubSample = configSubSampleList.stream().filter(f -> configSubSampleId.equals(f.getId())).findFirst().orElse(null); - Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId(); - ConfigSubSampleParentDO configSubSampleParent = configSubSampleParentList.stream().filter(f -> configSubSampleParentId.equals(f.getId())).findFirst().orElse(null); - Long configBaseSampleId = configSubSampleParent.getConfigBaseSampleId(); - ConfigBaseSampleDO configBaseSample = configBaseSampleList.stream().filter(f -> configBaseSampleId.equals(f.getId())).findFirst().orElse(null); + + //当前样品检测项目字典id列表 + List dictionaryProjectIdList = sampleEntrustProjectDOList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + + //获取物料检测标准检测项目id列表 + List materialAssayStandardDetailIdList = sampleEntrustProjectDOList.stream().map(m -> m.getMaterialAssayStandardDetailId()).collect(Collectors.toList()); + + //当前样品检测标准方法 + List materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList); + + //获取检测方法 + List configAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + + //查找子样配置 + List configSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && configAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); + + //查询当前委托样品对应的子样 + List entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList()); + if (entrustConfigSubSampleList.size() != 1) { + throw new ServiceException(1_032_100_000, "子样配置不正确"); + } + - //子样检测任务 + //是否创建综合样S分析 + Boolean isCreateZhy = false; + //综合样分析方法 + ConfigAssayMethodDO configAssayMethodZhy = null; + + //是商检样品,分析金银,第一个样品 + if (isSjEntrust && isAssayAuAg && sort == 0) { + //是否分析硫 + isAssayS = dictionaryProjectIdList.contains(sDictionaryProjectId); + if (isAssayS) { + isCreateZhy = false; + } else { + isCreateZhy = true; + MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId); + if (materialAssayStandardMethodDO == null) { + throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置"); + } + configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId()); + } + + } + + + + //获取到子样配置 + ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0); + Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId(); + //获取到分样配置 + ConfigSubSampleParentDO configSubSampleParent = configSubSampleParentList.stream().filter(f -> configSubSampleParentId.equals(f.getId())).findFirst().orElse(null); + Long configBaseSampleId = configSubSampleParent.getConfigBaseSampleId(); + //获取到主样配置 + ConfigBaseSampleDO configBaseSample = configBaseSampleList.stream().filter(f -> configBaseSampleId.equals(f.getId())).findFirst().orElse(null); + + //主样流程 + ConfigSampleFlowDO configSampleFlowBase = configSampleFlowList.stream().filter(f -> f.getKey().equals(configBaseSample.getFlowKey())).findFirst().orElse(null); + //样品流程定义 + SampleFlowDefinition sampleFlowDefinitionBase = JSON.parseObject(configSampleFlowBase.getContent(), SampleFlowDefinition.class); + List flowNodeBaseList = sampleFlowDefinitionBase.getFlowNodeList().stream().sorted(Comparator.comparing(SampleFlowNode::getSort)).collect(Collectors.toList()); + SampleFlowNode sampleFlowNodeBase = flowNodeBaseList.get(0); + + //=======================主样========================== + businessBaseSampleDO = new BusinessBaseSampleDO(); + businessBaseSampleDO.setId(IdWorker.getId()); + //设置配置id + businessBaseSampleDO.setConfigBaseSampleId(configBaseSampleId); + //样品名称为委托登记来的样品名称 + businessBaseSampleDO.setSampleName(businessSampleEntrustDetailDO.getSampleName()); + //样品大类名称 + businessBaseSampleDO.setBaseSampleName(baseSampleDO.getName()); + //样品类型字典与委托一致 + businessBaseSampleDO.setDictionaryBusinessId(businessSampleEntrustDetailDO.getSampleTypeDictionaryBusinessId()); + //生成样品编号 + String sampleCode = sequenceUtil.genCode(configBaseSample.getCodeRule()); + businessBaseSampleDO.setSampleCode(sampleCode); + //样品生成时间为当前时间 + businessBaseSampleDO.setSampleTime(currentDateTime); + //样品状态正常 + businessBaseSampleDO.setSampleStatus(QmsCommonConstant.NORMAL); + //主样流程配置id + businessBaseSampleDO.setConfigSampleFlowId(configSampleFlowBase.getId()); + //主样当前流程节点key + businessBaseSampleDO.setSampleFlowNodeKey(sampleFlowNodeBase.getNodeKey()); + //主样当前流程节点时间 + businessBaseSampleDO.setSampleFlowNodeTime(currentDateTime); + //操作人 + businessBaseSampleDO.setOperator(loginRealname); + + //添加到列表 + businessBaseSampleDOList.add(businessBaseSampleDO); + + //=======================报表========================== + List configSampleReportDOList = configSampleReportList.stream().filter(f -> f.getConfigBaseSampleId().equals(configBaseSampleId)).collect(Collectors.toList()); + for (ConfigSampleReportDO configSampleReport : configSampleReportDOList) { + BusinessAssayReportDataDO businessAssayReportDataDO = new BusinessAssayReportDataDO(); + businessAssayReportDataDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); + businessAssayReportDataDO.setDataSource(configSampleReport.getDataSource()); + businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId()); + businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId()); + businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + + businessAssayReportDataDOList.add(businessAssayReportDataDO); + } + //=====================委托明细====================== + //设置主样id + businessSampleEntrustDetailDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); + //设置主样编号 + businessSampleEntrustDetailDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + + //=======================分样========================= + BusinessSubParentSampleDO businessSubParentSampleDO = new BusinessSubParentSampleDO(); + businessSubParentSampleDO.setId(IdWorker.getId()); + businessSubParentSampleDO.setDictionaryBusinessId(configSubSampleParent.getDictionaryBusinessId()); + businessSubParentSampleDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); + businessSubParentSampleDO.setConfigSubSampleParentId(configSubSampleParentId); + businessSubParentSampleDO.setSampleName(businessBaseSampleDO.getSampleName()); + businessSubParentSampleDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + businessSubParentSampleDO.setSubSampleCode(businessBaseSampleDO.getSampleCode()); + businessSubParentSampleDO.setSampleStatus(QmsCommonConstant.NORMAL); + businessSubParentSampleDOList.add(businessSubParentSampleDO); + + //=======================子样======================= + ConfigSampleFlowDO configSampleFlowSub = configSampleFlowList.stream().filter(f -> f.getKey().equals(configSubSample.getFlowKey())).findFirst().orElse(null); + //样品流程定义 + SampleFlowDefinition sampleFlowDefinitionSub = JSON.parseObject(configSampleFlowSub.getContent(), SampleFlowDefinition.class); + List flowNodeSubList = sampleFlowDefinitionSub.getFlowNodeList().stream().sorted(Comparator.comparing(SampleFlowNode::getSort)).collect(Collectors.toList()); + SampleFlowNode sampleFlowNodeSub = flowNodeSubList.get(0); + + BusinessSubSampleDO businessSubSampleDO = new BusinessSubSampleDO(); + businessSubSampleDO.setId(IdWorker.getId()); + businessSubSampleDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); + businessSubSampleDO.setBusinessSubParentSampleId(businessSubParentSampleDO.getId()); + businessSubSampleDO.setConfigSubSampleId(configSubSample.getId()); + businessSubSampleDO.setDictionaryBusinessId(configSubSample.getDictionaryBusinessId()); + businessSubSampleDO.setSampleName(businessBaseSampleDO.getSampleName()); + businessSubSampleDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + businessSubSampleDO.setSampleAssayCode(businessBaseSampleDO.getSampleCode()); + businessSubSampleDO.setSampleReturnCode(businessBaseSampleDO.getSampleCode()); + businessSubSampleDO.setIsWeighing(businessSampleEntrustDetailDO.getIsWeighing()); + businessSubSampleDO.setSampleStatus(QmsCommonConstant.NORMAL); + businessSubSampleDO.setConfigSampleFlowId(configSampleFlowSub.getId()); + businessSubSampleDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); + businessSubSampleDO.setSampleFlowNodeTime(currentDateTime); + businessSubSampleDO.setNextSampleFlowNode(sampleFlowNodeSub.getNextFlowNodeName()); + + businessSubSampleDOList.add(businessSubSampleDO); + + //子样样品流转信息 + SampleFlowInfo sampleFlowInfo = new SampleFlowInfo(); + sampleFlowInfo.setId(businessSubSampleDO.getId()); + sampleFlowInfo.setSampleName(businessSubSampleDO.getSampleName()); + sampleFlowInfo.setSampleCode(businessSubSampleDO.getSampleCode()); + sampleFlowInfo.setIsWeighing(businessSubSampleDO.getIsWeighing()); + sampleFlowInfo.setSampleWeight(businessSubSampleDO.getLastSampleWeight()); + + sampleFlowInfoList.add(sampleFlowInfo); + + //子样对应的分析班组 + BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null; + + for (Long configAssayMethodId : configAssayMethodIdList) { + //查询分析方法 + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null); + + //查询子样对应的分析方法 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); + + businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null); + if (businessSubSampleAnalysisGroupDO == null) { + businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO(); + businessSubSampleAnalysisGroupDO.setId(IdWorker.getId()); + businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessSubSampleAnalysisGroupDO.setSampleStatus("待收样"); + + businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); + } + + //根据检测方法循环 BusinessAssayTaskDataDO businessAssayTaskDataDO = null; - if (businessSampleEntrustDetailDO.getBusinessBaseSampleId() == null) { - - //主样流程 - ConfigSampleFlowDO configSampleFlowBase = configSampleFlowList.stream().filter(f -> f.getKey().equals(configBaseSample.getFlowKey())).findFirst().orElse(null); - //样品流程定义 - SampleFlowDefinition sampleFlowDefinitionBase = JSON.parseObject(configSampleFlowBase.getContent(), SampleFlowDefinition.class); - List flowNodeBaseList = sampleFlowDefinitionBase.getFlowNodeList().stream().sorted(Comparator.comparing(SampleFlowNode::getSort)).collect(Collectors.toList()); - SampleFlowNode sampleFlowNodeBase = flowNodeBaseList.get(0); - - //主样 - businessBaseSampleDO = new BusinessBaseSampleDO(); - businessBaseSampleDO.setId(IdWorker.getId()); - //设置配置id - businessBaseSampleDO.setConfigBaseSampleId(configBaseSampleId); - //样品名称为委托登记来的样品名称 - businessBaseSampleDO.setSampleName(businessSampleEntrustDetailDO.getSampleName()); - //样品类型字典与委托一致 - businessBaseSampleDO.setDictionaryBusinessId(businessSampleEntrustDetailDO.getDictionaryBusinessId()); - //生成样品编号 - String sampleCode = sequenceUtil.genCode(configBaseSample.getCodeRule()); - businessBaseSampleDO.setSampleCode(sampleCode); - //样品生成时间为当前时间 - businessBaseSampleDO.setSampleTime(currentDateTime); - //样品状态正常 - businessBaseSampleDO.setSampleStatus("normal"); - - businessBaseSampleDO.setSampleFlowKey(sampleFlowNodeBase.getNodeKey()); - businessBaseSampleDO.setSampleFlowTime(currentDateTime); - - businessBaseSampleDO.setOperator(loginRealname); - - //添加到列表 - businessBaseSampleDOList.add(businessBaseSampleDO); - - //分样 - BusinessSubParentSampleDO businessSubParentSampleDO = new BusinessSubParentSampleDO(); - businessSubParentSampleDO.setId(IdWorker.getId()); - businessSubParentSampleDO.setDictionaryBusinessId(configSubSampleParent.getDictionaryBusinessId()); - businessSubParentSampleDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); - businessSubParentSampleDO.setConfigSubSampleParentId(configSubSampleParentId); - businessSubParentSampleDO.setSampleName(businessBaseSampleDO.getSampleName()); - businessSubParentSampleDO.setSampleCode(businessBaseSampleDO.getSampleCode()); - businessSubParentSampleDO.setSubSampleCode(businessBaseSampleDO.getSampleCode()); - businessSubParentSampleDO.setSampleStatus("normal"); - businessSubParentSampleDOList.add(businessSubParentSampleDO); - - //子样 - ConfigSampleFlowDO configSampleFlowSub = configSampleFlowList.stream().filter(f -> f.getKey().equals(configSubSample.getFlowKey())).findFirst().orElse(null); - //样品流程定义 - SampleFlowDefinition sampleFlowDefinitionSub = JSON.parseObject(configSampleFlowSub.getContent(), SampleFlowDefinition.class); - List flowNodeSubList = sampleFlowDefinitionSub.getFlowNodeList().stream().sorted(Comparator.comparing(SampleFlowNode::getSort)).collect(Collectors.toList()); - SampleFlowNode sampleFlowNodeSub = flowNodeSubList.get(0); - - BusinessSubSampleDO businessSubSampleDO = new BusinessSubSampleDO(); - businessSubSampleDO.setId(IdWorker.getId()); - businessSubSampleDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); - businessSubSampleDO.setBusinessSubParentSampleId(businessSubParentSampleDO.getId()); - businessSubSampleDO.setConfigSubSampleId(configSubSampleId); - businessSubSampleDO.setDictionaryBusinessId(configSubSample.getDictionaryBusinessId()); - businessSubSampleDO.setSampleName(businessBaseSampleDO.getSampleName()); - businessSubSampleDO.setSampleCode(businessBaseSampleDO.getSampleCode()); - businessSubSampleDO.setIsWeighing(businessSampleEntrustDetailDO.getIsWeighing()); - businessSubSampleDO.setSampleStatus("normal"); - businessSubSampleDO.setSampleFlowKey(sampleFlowNodeSub.getNodeKey()); - businessSubSampleDO.setSampleFlowTime(currentDateTime); - - businessSubSampleDOList.add(businessSubSampleDO); - + //根据任务数判断是平行还是 + String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //根据任务数循环 + for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { //子样检测任务 businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); businessAssayTaskDataDO.setId(IdWorker.getId()); @@ -261,58 +452,160 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); - businessAssayTaskDataDO.setAssayType("单杯"); + businessAssayTaskDataDO.setAssayType(assayType); businessAssayTaskDataDO.setTaskType("常规"); + businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + + List configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList()); + + StringBuilder assayProjectBuilder = new StringBuilder(); + + for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + + //如果当前分析方法的项目不在当前检测项目中,则跳出循环继续 + if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) { + continue; + } + + DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null); + assayProjectBuilder.append(dictionaryProject.getShowName()).append(","); + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT); + if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值 + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT); + } + + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + + businessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + + } + + assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); + businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); businessAssayTaskDataDOList.add(businessAssayTaskDataDO); - - //设置主样id - businessSampleEntrustDetailDO.setBusinessBaseSampleId(businessBaseSampleDO.getId()); - //设置主样编号 - businessSampleEntrustDetailDO.setSampleCode(businessBaseSampleDO.getSampleCode()); } - - if (businessAssayTaskDataDO == null) { - businessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> f.getBusinessBaseSampleId().equals(businessSampleEntrustDetailDO.getBusinessBaseSampleId()) && f.getConfigAssayMethodId().equals(configAssayMethodId) ).findFirst().orElse(null); - } - - ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getDictionaryProjectId().equals(businessSampleEntrustProjectDO.getDictionaryProjectId())).findFirst().orElse(null); - - //检测项目 - BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); - businessAssayProjectDataDO.setId(IdWorker.getId()); - businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); - businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); - businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); - businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); - businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); - businessAssayProjectDataDO.setIsEnabled(1); - businessAssayProjectDataDO.setIsNotAssessment(0); - - businessAssayProjectDataDOList.add(businessAssayProjectDataDO); - - List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); - for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { - BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); - businessAssayParameterDataDO.setId(IdWorker.getId()); - businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); - businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); - businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); - businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); - businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); - - - businessAssayParameterDataDOList.add(businessAssayParameterDataDO); - } - + } - + if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) { + Long configAssayMethodIdZhy = configAssayMethodZhy.getId(); + Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId(); + + //查询子样对应的分析方法 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null); + + businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(assayDepartmentIdZhy)).findFirst().orElse(null); + if (businessSubSampleAnalysisGroupDO == null) { + businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO(); + businessSubSampleAnalysisGroupDO.setId(IdWorker.getId()); + businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId()); + businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName()); + businessSubSampleAnalysisGroupDO.setSampleStatus("待收样"); + + businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO); + } + + //根据检测方法循环 + BusinessAssayTaskDataDO businessAssayTaskDataDO = null; + + //根据任务数判断是平行还是 + String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //根据任务数循环 + for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { + //子样检测任务 + businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + businessAssayTaskDataDO.setId(IdWorker.getId()); + businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId()); + businessAssayTaskDataDO.setAssayType(assayType); + businessAssayTaskDataDO.setTaskType("常规"); + businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName()); + + + //查询S检测项目 + ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getDictionaryProjectId().equals(sDictionaryProjectId)).findFirst().orElse(null); + + + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT); + businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + + businessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + businessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + + businessAssayTaskDataDO.setAssayProject("S"); + businessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + } + sort++; } + sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED); - - sampleEntrustRegistration.setRegistrationStatus("submit"); + sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList); businessSampleEntrustRegistrationMapper.updateById(sampleEntrustRegistration); if (CollUtil.isNotEmpty(sampleEntrustDetailList)) { @@ -333,6 +626,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { if (CollUtil.isNotEmpty(businessSubSampleDOList)) { businessSubSampleMapper.insertBatch(businessSubSampleDOList); } + if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { + businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList); + } if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList); } @@ -342,6 +638,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent { if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) { businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList); } + if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) { + businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList); + } } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java index 3f8a088..01b04ba 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java @@ -2,15 +2,27 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; - +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.bus.service.SampleFlowService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleEntrustReceiveDataCmp", name = "中心接收样品委托的样品数据") public class SampleEntrustReceiveDataCmp extends NodeComponent { + + @Resource + private SampleFlowService sampleFlowService; @Override public void process() throws Exception { - + SampleEntrustContext sampleEntrustContext = this.getContextBean(SampleEntrustContext.class); + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_RECEIVE); + sampleFlowParam.setSampleSourceType(2); + sampleFlowParam.setSampleFlowInfoList(sampleEntrustContext.getSampleFlowInfoList()); + sampleFlowService.sampleFlow(sampleFlowParam); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java index df01ef9..f84bf50 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java @@ -2,15 +2,27 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; - +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.bus.service.SampleFlowService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleEntrustSendDataCmp", name = "中心送样品委托的样品数据到分析室") public class SampleEntrustSendDataCmp extends NodeComponent { + + @Resource + private SampleFlowService sampleFlowService; @Override public void process() throws Exception { - + SampleEntrustContext sampleEntrustContext = this.getContextBean(SampleEntrustContext.class); + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_SEND); + sampleFlowParam.setSampleSourceType(2); + sampleFlowParam.setSampleFlowInfoList(sampleEntrustContext.getSampleFlowInfoList()); + sampleFlowService.sampleFlow(sampleFlowParam); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustUpdateDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustUpdateDataCmp.java index 4be70a5..9e559f2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustUpdateDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustUpdateDataCmp.java @@ -6,6 +6,8 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; @@ -20,6 +22,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetai import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustProjectMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; import jakarta.annotation.Resource; @@ -44,6 +47,15 @@ public class SampleEntrustUpdateDataCmp extends NodeComponent { SampleEntrustContext sampleEntrustContext = this.getContextBean(SampleEntrustContext.class); //样品委托 BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = sampleEntrustContext.getSampleEntrustRegistration(); + + //获取委托来源配置 + ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId()); + if (StringUtils.isNotBlank(configEntrustSource.getCodeField())) {//如果委托单号来源于字段,则重新获取更新下 + String externalInfomation = sampleEntrustRegistration.getExternalInfomation(); + JSONObject extJsonObject = JSON.parseObject(externalInfomation); + String entrustNumber = extJsonObject.getString(configEntrustSource.getCodeField()); + sampleEntrustRegistration.setEntrustNumber(entrustNumber); + } //先删除旧的 List sampleEntrustDetailOldList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, sampleEntrustRegistration.getId())); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleDataSaveOrUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleDataSaveOrUpdateCmp.java index f078c00..f0401cc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleDataSaveOrUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleDataSaveOrUpdateCmp.java @@ -6,17 +6,21 @@ import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessHandoverRecordSubMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; import jakarta.annotation.Resource; @@ -33,6 +37,12 @@ public class SampleDataSaveOrUpdateCmp extends NodeComponent { @Resource private BusinessSubSampleMapper businessSubSampleMapper; + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + @Resource private BusinessHandoverRecordSubMapper businessHandoverRecordSubMapper; @@ -60,11 +70,25 @@ public class SampleDataSaveOrUpdateCmp extends NodeComponent { if (CollUtil.isNotEmpty(busSubCsampleList)) { businessSubSampleMapper.updateBatch(busSubCsampleList); } + //子样任务 + List businessAssayTaskDataList = sampleFlowContext.getBusinessAssayTaskDataList(); + if (CollUtil.isNotEmpty(businessAssayTaskDataList)) { + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataList); + } + //子样分析班组 + List businessSubSampleAnalysisGroupList = sampleFlowContext.getBusinessSubSampleAnalysisGroupList(); + if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupList)) { + businessSubSampleAnalysisGroupMapper.updateBatch(businessSubSampleAnalysisGroupList); + } //交接记录 List busHandoverRecordSubList = sampleFlowContext.getBusinessHandoverRecordSubList(); if (CollUtil.isNotEmpty(busHandoverRecordSubList)) { businessHandoverRecordSubMapper.insertBatch(busHandoverRecordSubList); } + List updateBusinessHandoverRecordSubList = sampleFlowContext.getUpdateBusinessHandoverRecordSubList(); + if (CollUtil.isNotEmpty(updateBusinessHandoverRecordSubList)) { + businessHandoverRecordSubMapper.updateBatch(updateBusinessHandoverRecordSubList); + } //交接记录单 BusinessSampleHandoverDO businessSampleHandover = sampleFlowContext.getBusinessSampleHandover(); if (businessSampleHandover != null) { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleFlowContextInitCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleFlowContextInitCmp.java index 2a60e84..d6d05ec 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleFlowContextInitCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleFlowContextInitCmp.java @@ -41,11 +41,11 @@ public class SampleFlowContextInitCmp extends NodeComponent { SampleFlowParam sampleFlowParam = this.getRequestData(); if (StringUtils.isBlank(sampleFlowParam.getCurrentSampleFlowKey())) { - new ServiceException(500, "样品流程节点currentSampleFlowKey不允许为空"); + new ServiceException(1_032_100_000, "样品流程节点currentSampleFlowKey不允许为空"); } List sampleFlowInfoList = sampleFlowParam.getSampleFlowInfoList(); if (CollUtil.isEmpty(sampleFlowInfoList)) { - new ServiceException(500, "样品流转列表不允许为空"); + new ServiceException(1_032_100_000, "样品流转列表不允许为空"); } List sampleIdList = sampleFlowInfoList.stream().map(m -> m.getId()).collect(Collectors.toList()); SampleFlowContext sampleFlowContext = this.getContextBean(SampleFlowContext.class); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleHandoverRecordSubCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleHandoverRecordSubCmp.java index 082193f..a0c8039 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleHandoverRecordSubCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleHandoverRecordSubCmp.java @@ -6,6 +6,7 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; @@ -32,12 +33,21 @@ public class SampleHandoverRecordSubCmp extends NodeComponent { BusinessHandoverRecordSubDO busHandoverRecordSub = null; for (BusinessSubSampleDO businessSubSample : busSubCsampleList) { busHandoverRecordSub = new BusinessHandoverRecordSubDO(); + busHandoverRecordSub.setId(IdWorker.getId()); busHandoverRecordSub.setBusinessSubSampleId(businessSubSample.getId()); - busHandoverRecordSub.setSampleCode(businessSubSample.getSampleCode()); - if (businessSubSample.getIsGenerateReturnCode().intValue() == 1) { - busHandoverRecordSub.setSampleCode(businessSubSample.getSampleReturnCode()); + busHandoverRecordSub.setSampleCode(businessSubSample.getSampleReturnCode());//由于样品编号、分析编号、归库编号、都是由前往后一致,所以这里取归库编号 + busHandoverRecordSub.setBalanceCode(businessSubSample.getLastBalanceCode()); + busHandoverRecordSub.setSampleWeight(businessSubSample.getLastSampleWeight()); + busHandoverRecordSub.setConfigSampleFlowId(businessSubSample.getConfigSampleFlowId()); + busHandoverRecordSub.setSampleFlowNodeKey(businessSubSample.getSampleFlowNodeKey()); + //上一个交接记录id + busHandoverRecordSub.setUpSampleRecordId(businessSubSample.getUpSampleRecordId()); + if (businessSubSample.getUpSampleRecordId() != null) { + BusinessHandoverRecordSubDO upHandoverRecordSub = sampleFlowContext.getBusinessHandoverRecordSubById(businessSubSample.getUpSampleRecordId()); + if (upHandoverRecordSub != null) { + upHandoverRecordSub.setNextSampleRecordId(busHandoverRecordSub.getId()); + } } - busHandoverRecordSub.setSampleFlowKey(businessSubSample.getSampleFlowKey()); if (StringUtils.isNotBlank(sendSampleOper)) { busHandoverRecordSub.setSendSampleOperator(sendSampleOper); @@ -53,6 +63,8 @@ public class SampleHandoverRecordSubCmp extends NodeComponent { busHandoverRecordSub.setOperationTime(currentDateTime); busHandoverRecordSubList.add(busHandoverRecordSub); + + businessSubSample.setUpSampleRecordId(busHandoverRecordSub.getId()); } sampleFlowContext.setBusinessHandoverRecordSubList(busHandoverRecordSubList); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java index 6113865..b476b1d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSimpleEncryptCmp.java @@ -9,6 +9,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleSimpleEncryptCmp", name = "简码编密") @@ -33,7 +35,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent { @Override public boolean isAccess() { SampleFlowContext sampleFlowContext = this.getContextBean(SampleFlowContext.class); - return "flw_ypbm".equals(sampleFlowContext.getCurrentSampleFlowKey()); + return QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(sampleFlowContext.getCurrentSampleFlowKey()); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubCheckCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubCheckCmp.java index 7adbbad..ad1abd9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubCheckCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubCheckCmp.java @@ -8,7 +8,12 @@ import com.yomahub.liteflow.core.NodeComponent; import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessHandoverRecordSubMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; @@ -22,6 +27,12 @@ public class SampleSubCheckCmp extends NodeComponent { @Resource private BusinessSubSampleMapper businessSubSampleMapper; + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessHandoverRecordSubMapper businessHandoverRecordSubMapper; + @Resource private ConfigSubSampleMapper configSubSampleMapper; @@ -31,7 +42,7 @@ public class SampleSubCheckCmp extends NodeComponent { String currentSampleFlowKey = sampleFlowContext.getCurrentSampleFlowKey(); List sampleIdList = sampleFlowContext.getSampleIdList(); if (CollUtil.isEmpty(sampleIdList)) { - throw new ServiceException(500, "样品ID列表不允许为空"); + throw new ServiceException(1_032_100_000, "样品ID列表不允许为空"); } List businessSubSampleDOList = businessSubSampleMapper.selectByIds(sampleIdList); @@ -43,15 +54,26 @@ public class SampleSubCheckCmp extends NodeComponent { } } - boolean isSampleFlowKeyFail = businessSubSampleDOList.stream().anyMatch(p -> !p.getSampleFlowKey().equals(currentSampleFlowKey)); + boolean isSampleFlowKeyFail = businessSubSampleDOList.stream().anyMatch(p -> !p.getSampleFlowNodeKey().equals(currentSampleFlowKey)); if (isSampleFlowKeyFail) { - throw new ServiceException(500, "样品列表与当前流程不符"); + throw new ServiceException(1_032_100_000, "样品列表与当前流程不符"); } List configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList()); List configSubSampleList = configSubSampleMapper.selectByIds(configSubSampleIdList); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayTaskDataDO::getBusinessSubSampleId, sampleIdList)); + + //上一次交接记录 + List upSampleRecordIdList = businessSubSampleDOList.stream().filter(f -> f.getUpSampleRecordId() != null).map(m -> m.getUpSampleRecordId()).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(upSampleRecordIdList)) { + List businessHandoverRecordSubList = businessHandoverRecordSubMapper.selectByIds(upSampleRecordIdList); + sampleFlowContext.setUpdateBusinessHandoverRecordSubList(businessHandoverRecordSubList); + } + + sampleFlowContext.setBusinessSubSampleList(businessSubSampleDOList); + sampleFlowContext.setBusinessAssayTaskDataList(businessAssayTaskDataList); sampleFlowContext.setConfigSubSampleList(configSubSampleList); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubHandoverCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubHandoverCmp.java index 61f87e2..dc47e20 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubHandoverCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubHandoverCmp.java @@ -1,22 +1,24 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.flow; -import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; -import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleHandoverDO; -import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleHandoverMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper; import com.zt.plat.module.qms.core.code.SequenceUtil; import jakarta.annotation.Resource; @@ -26,6 +28,12 @@ public class SampleSubHandoverCmp extends NodeComponent { @Resource private SequenceUtil sequenceUtil; + @Resource + private ConfigReportTemplateMapper configReportTemplateMapper; + + @Resource + private DictionaryBusinessMapper dictionaryBusinessMapper; + @Override public void process() throws Exception { @@ -37,31 +45,42 @@ public class SampleSubHandoverCmp extends NodeComponent { List busSubCsampleList = sampleFlowContext.getBusinessSubSampleList(); ConfigSampleHandoverDO configSampleHandover = sampleFlowContext.getConfigSampleHandoverByFlowNodeKey(currentSampleFlowKey); + List dictionaryBusinessIdList = busSubCsampleList.stream().map(m -> m.getDictionaryBusinessId()).distinct().collect(Collectors.toList()); + List dictionaryBusinessList = dictionaryBusinessMapper.selectByIds(dictionaryBusinessIdList); + + BusinessSubSampleDO businessSubSampleDOFirst = busSubCsampleList.get(0); + BusinessSampleHandoverDO businessSampleHandoverDO = new BusinessSampleHandoverDO(); businessSampleHandoverDO.setId(IdWorker.getId()); String handoverCode = sequenceUtil.genCode(configSampleHandover.getCodeRule()); businessSampleHandoverDO.setCode(handoverCode); businessSampleHandoverDO.setName(configSampleHandover.getName()); - businessSampleHandoverDO.setTemplateKey(configSampleHandover.getTemplateKey()); + businessSampleHandoverDO.setConfigReportTemplateKey(configSampleHandover.getConfigReportTemplateKey()); + ConfigReportTemplateDO latestConfigSampleReportTemplate = configReportTemplateMapper.selectLatestConfigReportTemplateByKey(configSampleHandover.getConfigReportTemplateKey()); + businessSampleHandoverDO.setConfigReportTemplateId(latestConfigSampleReportTemplate.getId()); businessSampleHandoverDO.setOperatorId(loginUser.getId()); businessSampleHandoverDO.setOperator(loginRealname); businessSampleHandoverDO.setOperationTime(currentDateTime); - businessSampleHandoverDO.setSampleFlowCode(currentSampleFlowKey); + businessSampleHandoverDO.setConfigSampleFlowId(businessSubSampleDOFirst.getConfigSampleFlowId()); + businessSampleHandoverDO.setSampleFlowNodeKey(currentSampleFlowKey); sampleFlowContext.setBusinessSampleHandover(businessSampleHandoverDO); List businessSampleHandoverDetailList = new ArrayList<>(); BusinessSampleHandoverDetailDO businessSampleHandoverDetailDO = null; for (BusinessSubSampleDO businessSubSample : busSubCsampleList) { + DictionaryBusinessDO dictionaryBusiness = dictionaryBusinessList.stream().filter(f -> f.getId().equals(businessSubSample.getDictionaryBusinessId())).findFirst().orElse(null); + businessSampleHandoverDetailDO = new BusinessSampleHandoverDetailDO(); businessSampleHandoverDetailDO.setId(IdWorker.getId()); businessSampleHandoverDetailDO.setBusinessSampleHandoverId(businessSampleHandoverDO.getId()); businessSampleHandoverDetailDO.setBusinessSubSampleId(businessSubSample.getId()); businessSampleHandoverDetailDO.setSampleName(businessSubSample.getSampleName()); - businessSampleHandoverDetailDO.setBalanceCode(""); + businessSampleHandoverDetailDO.setSampleCode(businessSubSample.getSampleReturnCode()); + businessSampleHandoverDetailDO.setBalanceCode(businessSubSample.getLastBalanceCode()); businessSampleHandoverDetailDO.setSampleWeight(businessSubSample.getLastSampleWeight()); businessSampleHandoverDetailDO.setDictionaryBusinessId(businessSubSample.getDictionaryBusinessId()); - + businessSampleHandoverDetailDO.setDictionaryBusinessName(dictionaryBusiness.getName()); businessSampleHandoverDetailList.add(businessSampleHandoverDetailDO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java index 0191d80..073c9cb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java @@ -1,55 +1,133 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.flow; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; import com.alibaba.fastjson2.JSON; +import com.ql.util.express.DefaultContext; +import com.ql.util.express.ExpressRunner; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; - +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessHandoverRecordSubMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigRuleMapper; import com.zt.plat.module.qms.business.config.service.ConfigSampleFlowService; -import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; +//import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleSubProcessUpdateCmp", name = "子样流程节点更新") public class SampleSubProcessUpdateCmp extends NodeComponent { +// @Resource +// private ConfigSubSampleService configSubSampleService; + @Resource - private ConfigSubSampleService configSubSampleService; + private ExpressRunner expressRunner; + + @Resource + private ConfigRuleMapper configRuleMapper; @Resource private ConfigSampleFlowService configSampleFlowService; + + @Resource + private BusinessHandoverRecordSubMapper businessHandoverRecordSubMapper; + + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; @Override public void process() throws Exception { SampleFlowContext sampleFlowContext = this.getContextBean(SampleFlowContext.class); String currentSampleFlowKey = sampleFlowContext.getCurrentSampleFlowKey(); -// LoginUser loginUser = sampleFlowContext.getLoginUser(); -// String loginRealname = sampleFlowContext.getLoginRealname(); + LoginUser loginUser = sampleFlowContext.getLoginUser(); + String loginRealname = sampleFlowContext.getLoginRealname(); LocalDateTime currentDateTime = sampleFlowContext.getCurrentDateTime(); + List sampleIdList = sampleFlowContext.getSampleIdList(); List busSubCsampleList = sampleFlowContext.getBusinessSubSampleList(); + List businessAssayTaskDataList = sampleFlowContext.getBusinessAssayTaskDataList(); + //查询历史交接记录 + List businessHandoverRecordSubDOList = businessHandoverRecordSubMapper.selectByBusinessSubSampleIds(sampleIdList); for (BusinessSubSampleDO businessSubSample : busSubCsampleList) { - Long configSubSampleId = businessSubSample.getConfigSubSampleId(); - ConfigSubSampleDO configSubSample = configSubSampleService.getConfigSubSample(configSubSampleId); - String sampleFlowKey = configSubSample.getFlowKey(); - ConfigSampleFlowDO configSampleFlow = configSampleFlowService.getConfigSampleFlowByKey(sampleFlowKey); + ConfigSampleFlowDO configSampleFlow = configSampleFlowService.getConfigSampleFlow(businessSubSample.getConfigSampleFlowId()); String configSampleFlowContent = configSampleFlow.getContent(); //样品流程定义 SampleFlowDefinition sampleFlowDefinition = JSON.parseObject(configSampleFlowContent, SampleFlowDefinition.class); + //获取流程列表 List flowNodeList = sampleFlowDefinition.getFlowNodeList(); - SampleFlowNode flowNode = flowNodeList.stream().filter(f -> f.getNodeKey().equals(currentSampleFlowKey)).findFirst().orElse(null); - List nextFlowNodeList = flowNode.getNextFlowNodeList(); - SampleFlowNode nextFlowNode = nextFlowNodeList.stream().filter(f -> f.getIsDefault()).findFirst().orElse(null); - businessSubSample.setSampleFlowKey(nextFlowNode.getNodeKey()); - businessSubSample.setSampleFlowTime(currentDateTime); + //查询当前流程节点 + SampleFlowNode currFlowNode = flowNodeList.stream().filter(f -> f.getNodeKey().equals(currentSampleFlowKey)).findFirst().orElse(null); + //获取下一个流程节点列表 + List nextFlowNodeList = currFlowNode.getNextFlowNodeList(); + //查询默认节点 + SampleFlowNode nextFlowNode = nextFlowNodeList.stream().filter(f -> f.getIsDefault() != null && f.getIsDefault()).findFirst().orElse(null); + //未找到默认节点 + if (nextFlowNode == null) { + //循环下一个流程节点列表,根据条件判断 + for (SampleFlowNode flowNode : nextFlowNodeList) { + ConfigRuleDO conditionRule = configRuleMapper.selectLatestConfigRuleByCode(flowNode.getCondition()); + Boolean isMeetCondition = false; + DefaultContext context = new DefaultContext<>(); + ConfigSubSampleDO configSubSample = sampleFlowContext.getConfigSubSampleById(businessSubSample.getConfigSubSampleId()); + Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule()); + Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey())); + + context.put("hasSubSimpleCodeRule", hasSubSimpleCodeRule); + context.put("hasSubSampleEncrypt", hasSubSampleEncrypt); + try { + isMeetCondition = (Boolean) expressRunner.execute(conditionRule.getExpression(), context, null, false, false); + } catch (Exception e) { + e.printStackTrace(); + throw new ServiceException(1_032_100_000, e.getMessage()); + } + //满足条件,赋值下一个流程节点,跳出循环 + if (isMeetCondition) { + nextFlowNode = flowNode; + break; + } + + } + } + + businessSubSample.setSampleFlowNodeKey(nextFlowNode.getNodeKey()); + businessSubSample.setSampleFlowNodeTime(currentDateTime); + + List subSampleAssayTaskDataList = businessAssayTaskDataList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList()); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : subSampleAssayTaskDataList) { + businessAssayTaskDataDO.setSampleFlowNodeKey(nextFlowNode.getNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime); + + } } + //如果是班组收样,需要更新分析班组表 + if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(currentSampleFlowKey)) { + List businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIdsAndAssayDepartmentId(sampleIdList, loginUser.getVisitDeptId()); + for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : businessSubSampleAnalysisGroupDOList) { + businessSubSampleAnalysisGroupDO.setSampleReceiveTime(currentDateTime); + businessSubSampleAnalysisGroupDO.setSampleReceiver(loginRealname); + businessSubSampleAnalysisGroupDO.setSampleStatus("已收样"); + } + sampleFlowContext.setBusinessSubSampleAnalysisGroupList(businessSubSampleAnalysisGroupDOList); + } } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignContextInitCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignContextInitCmp.java new file mode 100644 index 0000000..74ca652 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignContextInitCmp.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignTypeEnum; + +@LiteflowComponent(id = "sampleTaskAssignContextInitCmp", name = "任务分配上下文初始化") +public class SampleTaskAssignContextInitCmp extends NodeComponent { + + @Override + public void process() throws Exception { + //租户id + Long tenantId = TenantContextHolder.getRequiredTenantId(); + + //当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + sampleTaskAssignContext.setTenantId(tenantId); + sampleTaskAssignContext.setLoginUser(loginUser); + sampleTaskAssignContext.setLoginRealname(nickName); + + if (this.getRequestData() instanceof SampleTaskAssignMethodParam) { + SampleTaskAssignMethodParam sampleTaskAssignMethodParam = this.getRequestData(); + sampleTaskAssignContext.setSampleTaskAssignType(SampleTaskAssignTypeEnum.ASSAY_METHOD); + sampleTaskAssignContext.setAssignConfigAssayMethodId(sampleTaskAssignMethodParam.getConfigAssayMethodId()); + sampleTaskAssignContext.setAssignAssayUserList(sampleTaskAssignMethodParam.getAssignAssayUserList()); + } + + if (this.getRequestData() instanceof SampleTaskAssignSampleParam) { + SampleTaskAssignSampleParam sampleTaskAssignSampleParam = this.getRequestData(); + sampleTaskAssignContext.setSampleTaskAssignType(SampleTaskAssignTypeEnum.SAMPLE); + sampleTaskAssignContext.setAssignAssayUser(sampleTaskAssignSampleParam.getAssignAssayUser()); + sampleTaskAssignContext.setAssignSampleIdList(sampleTaskAssignSampleParam.getAssignSampleIdList()); + } + + if (this.getRequestData() instanceof SampleTaskAssignManualParam) { + SampleTaskAssignManualParam sampleTaskAssignManualParam = this.getRequestData(); + sampleTaskAssignContext.setSampleTaskAssignType(SampleTaskAssignTypeEnum.MANUAL); + sampleTaskAssignContext.setAssignAssayUser(sampleTaskAssignManualParam.getAssignAssayUser()); + sampleTaskAssignContext.setAssayTaskDataIdList(sampleTaskAssignManualParam.getAssayTaskDataIdList()); + + } + + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java new file mode 100644 index 0000000..c8a6723 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignDataSaveOrUpdateCmp.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import java.util.List; + +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleTaskAssignDataSaveOrUpdateCmp", name = "样品任务分配数据保存或更新") +public class SampleTaskAssignDataSaveOrUpdateCmp extends NodeComponent { + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Override + public void process() throws Exception { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + + List savebusinessAssayTaskList = sampleTaskAssignContext.getSaveBusinessAssayTaskList(); + + List updateBusinessAssayTaskList = sampleTaskAssignContext.getUpdateBusinessAssayTaskList(); + + List businessAssayTaskDetailList = sampleTaskAssignContext.getBusinessAssayTaskDetailList(); + + List businessAssayTaskDataList = sampleTaskAssignContext.getBusinessAssayTaskDataList(); + + List businessQCCoefficientDataList = sampleTaskAssignContext.getBusinessQCCoefficientDataList(); + + List businessQCCoefficientParameterDataList = sampleTaskAssignContext.getBusinessQCCoefficientParameterDataList(); + + if (CollUtil.isNotEmpty(savebusinessAssayTaskList)) { + this.businessAssayTaskMapper.insertBatch(savebusinessAssayTaskList); + } + + if (CollUtil.isNotEmpty(updateBusinessAssayTaskList)) { + this.businessAssayTaskMapper.updateBatch(updateBusinessAssayTaskList); + } + + if (CollUtil.isNotEmpty(businessAssayTaskDetailList)) { + this.businessAssayTaskDetailMapper.insertBatch(businessAssayTaskDetailList); + } + + if (CollUtil.isNotEmpty(businessAssayTaskDataList)) { + this.businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataList); + } + + if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) { + this.businessQCCoefficientDataMapper.insertBatch(businessQCCoefficientDataList); + } + + if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) { + this.businessQCCoefficientParameterDataMapper.insertBatch(businessQCCoefficientParameterDataList); + } + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java new file mode 100644 index 0000000..b8ebddd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignManualCmp.java @@ -0,0 +1,151 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignTypeEnum; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleTaskAssignManualCmp", name = "手动分配") +public class SampleTaskAssignManualCmp extends NodeComponent { + + @Resource + private SequenceUtil sequenceUtil; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigReportTemplateMapper configReportTemplateMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Override + public void process() throws Exception { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); + AssignAssayUser assignAssayUser = sampleTaskAssignContext.getAssignAssayUser(); + List assayTaskDataIdList = sampleTaskAssignContext.getAssayTaskDataIdList(); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectByIds(assayTaskDataIdList); + List businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + List configAssayMethodIdList = businessAssayTaskDataList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + List configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList); + sampleTaskAssignContext.setConfigAssayMethodList(configAssayMethodList); + + //查询子样 + List businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + sampleTaskAssignContext.setBusinessSubSampleList(businessSubSampleList); + + //保存任务分配单 + List saveBusinessAssayTaskList = new ArrayList<>(); + //更新任务分配单 + List updateBusinessAssayTaskList = new ArrayList<>(); + //任务分配单明细 + List businessAssayTaskDetailList = new ArrayList<>(); + + //按分析方法分组 + Map> groupBusinessAssayTaskDataListMap = businessAssayTaskDataList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId)); + for (Map.Entry> entry : groupBusinessAssayTaskDataListMap.entrySet()) { + long key = entry.getKey(); + ConfigAssayMethodDO configAssayMethod = sampleTaskAssignContext.getConfigAssayMethodById(key); + //查询报表模板 + ConfigReportTemplateDO configReportTemplate = configReportTemplateMapper.selectLatestConfigReportTemplateByKey(configAssayMethod.getConfigReportTemplateKey()); + + //根据分配 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectAssignInProgressByAssayUserAndAssignUser(configAssayMethod.getId(), assignAssayUser.getRealName(), loginRealname); + if (businessAssayTaskDO == null) { + String taskNo = sequenceUtil.genCode(configAssayMethod.getCodeRule()); + + businessAssayTaskDO = new BusinessAssayTaskDO(); + businessAssayTaskDO.setId(IdWorker.getId()); + businessAssayTaskDO.setTaskNo(taskNo); + businessAssayTaskDO.setTaskName(configAssayMethod.getName()); + businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDO.setConfigAssayMethodId(key); + businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); + businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); + businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); + + businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignTime(currentDateTime); + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + + saveBusinessAssayTaskList.add(businessAssayTaskDO); + } else { + updateBusinessAssayTaskList.add(businessAssayTaskDO); + } + + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = null; + List valList = entry.getValue(); + + int sort = 1; + for (BusinessAssayTaskDataDO val : valList) { + val.setIsAssignTasked(QmsCommonConstant.YES); + val.setAssignTaskTime(currentDateTime); + val.setAssayOperator(assignAssayUser.getRealName()); + val.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + + BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(val.getBusinessSubSampleId()); + + businessAssayTaskDetailDO = new BusinessAssayTaskDetailDO(); + businessAssayTaskDetailDO.setBusinessAssayTaskDataId(val.getId()); + businessAssayTaskDetailDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessAssayTaskDetailDO.setTaskNo(businessAssayTaskDO.getTaskNo()); + businessAssayTaskDetailDO.setSampleId(val.getBusinessSubSampleId()); + businessAssayTaskDetailDO.setSampleCode(businessSubSampleDO.getSampleAssayCode()); + businessAssayTaskDetailDO.setSampleName(businessSubSampleDO.getSampleName()); + businessAssayTaskDetailDO.setDataSourceType(QmsCommonConstant.NORMAL); + businessAssayTaskDetailDO.setSortNo(sort); + sort++; + + + businessAssayTaskDetailList.add(businessAssayTaskDetailDO); + } + + } + + sampleTaskAssignContext.setSaveBusinessAssayTaskList(saveBusinessAssayTaskList); + sampleTaskAssignContext.setUpdateBusinessAssayTaskList(updateBusinessAssayTaskList); + sampleTaskAssignContext.setBusinessAssayTaskDataList(businessAssayTaskDataList); + sampleTaskAssignContext.setBusinessAssayTaskDetailList(businessAssayTaskDetailList); + } + + @Override + public boolean isAccess() { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + return sampleTaskAssignContext.getSampleTaskAssignType().equals(SampleTaskAssignTypeEnum.MANUAL); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java new file mode 100644 index 0000000..0b274ae --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignMethodCmp.java @@ -0,0 +1,160 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignTypeEnum; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleTaskAssignMethodCmp", name = "按分析方法分配") +public class SampleTaskAssignMethodCmp extends NodeComponent { + + @Resource + private SequenceUtil sequenceUtil; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigReportTemplateMapper configReportTemplateMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Override + public void process() throws Exception { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); + Long assignConfigAssayMethodId = sampleTaskAssignContext.getAssignConfigAssayMethodId(); + List assignAssayUserList = sampleTaskAssignContext.getAssignAssayUserList(); + //查询分析方法配置 + ConfigAssayMethodDO configAssayMethod = configAssayMethodMapper.selectById(assignConfigAssayMethodId); + List configAssayMethodList = sampleTaskAssignContext.getConfigAssayMethodList(); + if (CollUtil.isEmpty(configAssayMethodList)) { + configAssayMethodList = new ArrayList<>(); + configAssayMethodList.add(configAssayMethod); + } + //查询报表模板 + ConfigReportTemplateDO configReportTemplate = configReportTemplateMapper.selectLatestConfigReportTemplateByKey(configAssayMethod.getConfigReportTemplateKey()); + + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, assignConfigAssayMethodId).eq(BusinessAssayTaskDataDO::getIsAssignTasked, QmsCommonConstant.NO)); + + List businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).collect(Collectors.toList()); + List businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList); + sampleTaskAssignContext.setBusinessSubSampleList(businessSubSampleList); + + List businessAssayTaskDataList = new ArrayList<>(); + + //保存任务分配单 + List saveBusinessAssayTaskList = new ArrayList<>(); + //更新任务分配单 + List updateBusinessAssayTaskList = new ArrayList<>(); + //任务分配单明细 + List businessAssayTaskDetailList = new ArrayList<>(); + + //循环分析人员分配任务 + for (AssignAssayUser assignAssayUser : assignAssayUserList) { + Integer sampleNum = assignAssayUser.getSampleNum(); + + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectAssignInProgressByAssayUserAndAssignUser(assignConfigAssayMethodId, assignAssayUser.getRealName(), loginRealname); + + if (businessAssayTaskDO == null) { + String taskNo = sequenceUtil.genCode(configAssayMethod.getCodeRule()); + + businessAssayTaskDO = new BusinessAssayTaskDO(); + businessAssayTaskDO.setId(IdWorker.getId()); + businessAssayTaskDO.setTaskNo(taskNo); + businessAssayTaskDO.setTaskName(configAssayMethod.getName()); + businessAssayTaskDO.setConfigAssayMethodId(assignConfigAssayMethodId); + businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); + businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); + businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); + businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + + businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignTime(currentDateTime); + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + + saveBusinessAssayTaskList.add(businessAssayTaskDO); + } else { + updateBusinessAssayTaskList.add(businessAssayTaskDO); + } + + + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = null; + for (int i = 0; i < sampleNum; i++) { + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataDOList.get(0); + businessAssayTaskDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessAssayTaskDataDO.setAssignTaskTime(currentDateTime); + businessAssayTaskDataDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + + BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(businessAssayTaskDataDO.getBusinessSubSampleId()); + + businessAssayTaskDetailDO = new BusinessAssayTaskDetailDO(); + businessAssayTaskDetailDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayTaskDetailDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessAssayTaskDetailDO.setTaskNo(businessAssayTaskDO.getTaskNo()); + businessAssayTaskDetailDO.setSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessAssayTaskDetailDO.setSampleCode(businessSubSampleDO.getSampleAssayCode()); + businessAssayTaskDetailDO.setSampleName(businessSubSampleDO.getSampleName()); + businessAssayTaskDetailDO.setDataSourceType(QmsCommonConstant.NORMAL); + businessAssayTaskDetailDO.setSortNo(i+1); + + + businessAssayTaskDetailList.add(businessAssayTaskDetailDO); + + businessAssayTaskDataList.add(businessAssayTaskDataDO); + + //移除当前对象 + businessAssayTaskDataDOList.remove(businessAssayTaskDataDO); + + } + } + sampleTaskAssignContext.setSaveBusinessAssayTaskList(saveBusinessAssayTaskList); + sampleTaskAssignContext.setUpdateBusinessAssayTaskList(updateBusinessAssayTaskList); + sampleTaskAssignContext.setBusinessAssayTaskDetailList(businessAssayTaskDetailList); + sampleTaskAssignContext.setBusinessAssayTaskDataList(businessAssayTaskDataList); + + } + + @Override + public boolean isAccess() { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + return sampleTaskAssignContext.getSampleTaskAssignType().equals(SampleTaskAssignTypeEnum.ASSAY_METHOD); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java new file mode 100644 index 0000000..cc2f4e8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignQCSampleCmp.java @@ -0,0 +1,147 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodParameterMapper; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.collection.CollUtil; +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleTaskAssignQCSampleCmp", name = "任务分配质量控制样品") +public class SampleTaskAssignQCSampleCmp extends NodeComponent { + + @Resource + private SequenceUtil sequenceUtil; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigQCSampleMethodMapper configQCSampleMethodMapper; + + @Resource + private ConfigQCSampleMethodParameterMapper configQCSampleMethodParameterMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + @Resource + private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Override + public void process() throws Exception { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + + List businessQCCoefficientDataDOList = new ArrayList<>(); + List businessQCCoefficientParameterDataDOList = new ArrayList<>(); + + //分配任务 + List businessAssayTaskList = new ArrayList<>(); + //获取需要保存的分配任务 + List saveBusinessAssayTaskList = sampleTaskAssignContext.getSaveBusinessAssayTaskList(); + //获取需要修改的分配任务 + List updateBusinessAssayTaskList = sampleTaskAssignContext.getUpdateBusinessAssayTaskList(); + businessAssayTaskList.addAll(saveBusinessAssayTaskList); + businessAssayTaskList.addAll(updateBusinessAssayTaskList); + + //获取分配任务的分析方法id列表 + List configAssayMethodIdList = businessAssayTaskList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + + //获取分析方法对应的质控分析配置 + List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodIds(configAssayMethodIdList); + if (CollUtil.isEmpty(configQCSampleMethodList)) {//如果未配置质控样品方法,则直接返回 + return; + } + //质控id + List configQCSampleMethodIdList = configQCSampleMethodList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //质控样分析参数 + List configQcSampleMethodParameterList = configQCSampleMethodParameterMapper.selectByConfigQCSampleMethodIds(configQCSampleMethodIdList); + + //循环分配任务 + for (BusinessAssayTaskDO businessAssayTaskDO : businessAssayTaskList) { + ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && "kby".equals(f.getDictionaryBusinessKey())).findFirst().orElse(null); + //不存在空白样,直接跳出 + if (configQCSampleMethodExtendRespVO == null) { + break; + } + + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + + //查询下质控数据,如果存在则跳出循环 + List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + //如果存在则跳出循环 + if (CollUtil.isNotEmpty(businessQCCoefficientDataList)) { + break; + } + + //根据默认配置的个数生成空白样 + for (int i = 0; i < configQCSampleMethodExtendRespVO.getDefaultCount(); i++) { + + BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); + businessQCCoefficientDataDO.setId(IdWorker.getId()); + businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethodExtendRespVO.getConfigAssayMethodId()); + businessQCCoefficientDataDO.setSampleName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName()); + if (StringUtils.isNotBlank(configQCSampleMethodExtendRespVO.getCodeRule())) { + String codeSample = sequenceUtil.genCode(configQCSampleMethodExtendRespVO.getCodeRule()); + businessQCCoefficientDataDO.setSampleCode(codeSample); + } + businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethodExtendRespVO.getDictionaryBusinessId()); + businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); + businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCCoefficientDataDO.setAssayProject(""); + businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); + businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO); + + businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO); + + List configQCSampleMethodParameterExtendRespVOs = configQcSampleMethodParameterList.stream().filter(f -> f.getConfigQCSampleMethodId().equals(configQCSampleMethodExtendRespVO.getId())).collect(Collectors.toList()); + for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) { + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO(); + businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); + businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId()); + businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId()); + businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType()); + businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition()); + businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue()); + + businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); + } + } + } + sampleTaskAssignContext.setBusinessQCCoefficientDataList(businessQCCoefficientDataDOList); + sampleTaskAssignContext.setBusinessQCCoefficientParameterDataList(businessQCCoefficientParameterDataDOList); + + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java new file mode 100644 index 0000000..8fe4b6d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/taskassign/SampleTaskAssignSampleCmp.java @@ -0,0 +1,152 @@ +package com.zt.plat.module.qms.business.bus.liteflow.sample.taskassign; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.yomahub.liteflow.annotation.LiteflowComponent; +import com.yomahub.liteflow.core.NodeComponent; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignTypeEnum; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import jakarta.annotation.Resource; + +@LiteflowComponent(id = "sampleTaskAssignSampleCmp", name = "按样品分配") +public class SampleTaskAssignSampleCmp extends NodeComponent { + + @Resource + private SequenceUtil sequenceUtil; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigReportTemplateMapper configReportTemplateMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Override + public void process() throws Exception { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + String loginRealname = sampleTaskAssignContext.getLoginRealname(); + LocalDateTime currentDateTime = sampleTaskAssignContext.getCurrentDateTime(); + AssignAssayUser assignAssayUser = sampleTaskAssignContext.getAssignAssayUser(); + List assignSampleIdList = sampleTaskAssignContext.getAssignSampleIdList(); + //根据分配的样品id查询分析任务数据 + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayTaskDataDO::getBusinessSubSampleId, assignSampleIdList).eq(BusinessAssayTaskDataDO::getIsAssignTasked, QmsCommonConstant.NO)); + List configAssayMethodIdList = businessAssayTaskDataList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList()); + List configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList); + sampleTaskAssignContext.setConfigAssayMethodList(configAssayMethodList); + + //查询子样 + List businessSubSampleList = businessSubSampleMapper.selectByIds(assignSampleIdList); + sampleTaskAssignContext.setBusinessSubSampleList(businessSubSampleList); + + //保存任务分配单 + List saveBusinessAssayTaskList = new ArrayList<>(); + //更新任务分配单 + List updateBusinessAssayTaskList = new ArrayList<>(); + //任务分配单明细 + List businessAssayTaskDetailList = new ArrayList<>(); + + //按分析方法分组 + Map> groupBusinessAssayTaskDataListMap = businessAssayTaskDataList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId)); + for (Map.Entry> entry : groupBusinessAssayTaskDataListMap.entrySet()) { + long key = entry.getKey(); + ConfigAssayMethodDO configAssayMethod = sampleTaskAssignContext.getConfigAssayMethodById(key); + //查询报表模板 + ConfigReportTemplateDO configReportTemplate = configReportTemplateMapper.selectLatestConfigReportTemplateByKey(configAssayMethod.getConfigReportTemplateKey()); + + //根据分配 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectAssignInProgressByAssayUserAndAssignUser(configAssayMethod.getId(), assignAssayUser.getRealName(), loginRealname); + if (businessAssayTaskDO == null) { + String taskNo = sequenceUtil.genCode(configAssayMethod.getCodeRule()); + + businessAssayTaskDO = new BusinessAssayTaskDO(); + businessAssayTaskDO.setId(IdWorker.getId()); + businessAssayTaskDO.setTaskNo(taskNo); + businessAssayTaskDO.setTaskName(configAssayMethod.getName()); + businessAssayTaskDO.setAssayOperator(assignAssayUser.getRealName()); + businessAssayTaskDO.setConfigAssayMethodId(key); + businessAssayTaskDO.setTaskSourceType(QmsCommonConstant.TASK_ASSIGN); + businessAssayTaskDO.setConfigReportTemplateId(configReportTemplate.getId()); + businessAssayTaskDO.setConfigReportTemplateKey(configReportTemplate.getKey()); + + businessAssayTaskDO.setTaskAssignOperator(loginRealname); + businessAssayTaskDO.setTaskAssignTime(currentDateTime); + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.IN_PROGRESS); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + + saveBusinessAssayTaskList.add(businessAssayTaskDO); + } else { + updateBusinessAssayTaskList.add(businessAssayTaskDO); + } + + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = null; + List valList = entry.getValue(); + + int sort = 1; + for (BusinessAssayTaskDataDO val : valList) { + val.setIsAssignTasked(QmsCommonConstant.YES); + val.setAssignTaskTime(currentDateTime); + val.setAssayOperator(assignAssayUser.getRealName()); + val.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + + BusinessSubSampleDO businessSubSampleDO = sampleTaskAssignContext.getBusinessSubSampleById(val.getBusinessSubSampleId()); + + businessAssayTaskDetailDO = new BusinessAssayTaskDetailDO(); + businessAssayTaskDetailDO.setBusinessAssayTaskDataId(val.getId()); + businessAssayTaskDetailDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessAssayTaskDetailDO.setTaskNo(businessAssayTaskDO.getTaskNo()); + businessAssayTaskDetailDO.setSampleId(val.getBusinessSubSampleId()); + businessAssayTaskDetailDO.setSampleCode(businessSubSampleDO.getSampleAssayCode()); + businessAssayTaskDetailDO.setSampleName(businessSubSampleDO.getSampleName()); + businessAssayTaskDetailDO.setDataSourceType(QmsCommonConstant.NORMAL); + businessAssayTaskDetailDO.setSortNo(sort); + sort++; + + + businessAssayTaskDetailList.add(businessAssayTaskDetailDO); + } + + } + + sampleTaskAssignContext.setSaveBusinessAssayTaskList(saveBusinessAssayTaskList); + sampleTaskAssignContext.setUpdateBusinessAssayTaskList(updateBusinessAssayTaskList); + sampleTaskAssignContext.setBusinessAssayTaskDataList(businessAssayTaskDataList); + sampleTaskAssignContext.setBusinessAssayTaskDetailList(businessAssayTaskDetailList); + } + + @Override + public boolean isAccess() { + SampleTaskAssignContext sampleTaskAssignContext = this.getContextBean(SampleTaskAssignContext.class); + return sampleTaskAssignContext.getSampleTaskAssignType().equals(SampleTaskAssignTypeEnum.SAMPLE); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleEntrustContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleEntrustContext.java index eb55f5d..da551e3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleEntrustContext.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleEntrustContext.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.liteflow.slot; import java.time.LocalDateTime; import java.util.List; +import java.util.stream.Collectors; import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.security.core.LoginUser; @@ -9,6 +10,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleAssayRes import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustProjectDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; @@ -80,6 +82,15 @@ public class SampleEntrustContext { return materialAssayStandardMethod; } + /** 通过检测标准项目id获取默认的检测方法列表 **/ + public List getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(List materialAssayStandardDetailIdList) { + List materialAssayStandardMethodList = null; + if (CollUtil.isNotEmpty(this.materialAssayStandardMethodList)) { + materialAssayStandardMethodList = this.materialAssayStandardMethodList.stream().filter(f -> materialAssayStandardDetailIdList.contains(f.getMaterialAssayStandardDetailId()) && f.getIsDefault().equals(1)).collect(Collectors.toList()); + } + return materialAssayStandardMethodList; + } + /** 委托登记单 **/ private BusinessSampleEntrustRegistrationDO sampleEntrustRegistration; @@ -92,4 +103,7 @@ public class SampleEntrustContext { /** 样品委托来样品位 **/ private List sampleAssayResultList; + + /** 样品流转信息列表 **/ + private List sampleFlowInfoList; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleFlowContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleFlowContext.java index 76ad1ce..fdc8f35 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleFlowContext.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleFlowContext.java @@ -5,11 +5,13 @@ import java.util.List; import cn.hutool.core.collection.CollUtil; import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleHandoverDO; @@ -86,9 +88,26 @@ public class SampleFlowContext { /** 分样子样信息 **/ private List businessSubSampleList; + /** 分样子样任务信息 **/ + private List businessAssayTaskDataList; + + /** 分样子样分析班组 **/ + private List businessSubSampleAnalysisGroupList; + /** 交接记录信息 **/ private List businessHandoverRecordSubList; + /** 需要更新的交接记录 **/ + private List updateBusinessHandoverRecordSubList; + + public BusinessHandoverRecordSubDO getBusinessHandoverRecordSubById(Long id) { + BusinessHandoverRecordSubDO businessHandoverRecordSub = null; + if (CollUtil.isNotEmpty(this.updateBusinessHandoverRecordSubList)) { + businessHandoverRecordSub = this.updateBusinessHandoverRecordSubList.stream().filter(f -> f.getId().equals(id)).findFirst().orElse(null); + } + return businessHandoverRecordSub; + } + /** 交接单主表 **/ private BusinessSampleHandoverDO businessSampleHandover; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java new file mode 100644 index 0000000..8c00403 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignContext.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.bus.liteflow.slot; + +import java.time.LocalDateTime; +import java.util.List; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.liteflow.param.AssignAssayUser; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +public class SampleTaskAssignContext { + + /** 租户id **/ + private Long tenantId; + + /** 当前时间 **/ + private LocalDateTime currentDateTime = LocalDateTime.now(); + + /** 当前登录用户 **/ + private LoginUser loginUser; + + /** 当前登录人 **/ + private String loginRealname; + + /** 指派类型 **/ + private SampleTaskAssignTypeEnum SampleTaskAssignType; + + /** 分析方法id **/ + private Long assignConfigAssayMethodId; + + /** 接受分配任务的人员 **/ + private List assignAssayUserList; + + /** 分析人员 **/ + private AssignAssayUser assignAssayUser; + + /** 待分析的样品id **/ + private List assignSampleIdList; + + /** 分析方法配置 **/ + private List configAssayMethodList; + + /** 检测任务id列表 **/ + private List assayTaskDataIdList; + + public ConfigAssayMethodDO getConfigAssayMethodById(Long id) { + ConfigAssayMethodDO configAssayMethod = null; + if (CollUtil.isNotEmpty(this.configAssayMethodList)) { + configAssayMethod = this.configAssayMethodList.stream().filter(f -> f.getId().equals(id)).findFirst().orElse(null); + } + return configAssayMethod; + } + + private List businessSubSampleList; + + public BusinessSubSampleDO getBusinessSubSampleById(Long id) { + BusinessSubSampleDO businessSubSample = null; + if (CollUtil.isNotEmpty(this.businessSubSampleList)) { + businessSubSample = this.businessSubSampleList.stream().filter(f -> f.getId().equals(id)).findFirst().orElse(null); + } + + return businessSubSample; + } + + /** 子样检测任务 **/ + private List businessAssayTaskDataList; + + /** 保存任务指派单列表 **/ + private List saveBusinessAssayTaskList; + + /** 更新任务指派单列表 **/ + private List updateBusinessAssayTaskList; + + /** 任务指派的明细列表 **/ + private List businessAssayTaskDetailList; + + /** 质控样-(空白、标准) **/ + private List businessQCCoefficientDataList; + + /** 质控样-(空白、标准)检测参数数据 **/ + private List businessQCCoefficientParameterDataList; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignTypeEnum.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignTypeEnum.java new file mode 100644 index 0000000..a1368d3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/slot/SampleTaskAssignTypeEnum.java @@ -0,0 +1,12 @@ +package com.zt.plat.module.qms.business.bus.liteflow.slot; + +public enum SampleTaskAssignTypeEnum { + + //分析方法指派 + ASSAY_METHOD, + //样品指派 + SAMPLE, + //手动指派 + MANUAL + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataService.java index f6a4c73..9531f57 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataServiceImpl.java index c0ff20d..a78b973 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayParameterDataServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataService.java index dda0078..2ad2d16 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataServiceImpl.java index 2269ddc..c8b4fd9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayProjectDataServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataService.java new file mode 100644 index 0000000..b39a6b6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataService.java @@ -0,0 +1,74 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测报表数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessAssayReportDataService { + + /** + * 创建检测报表数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessAssayReportDataRespVO createBusinessAssayReportData(@Valid BusinessAssayReportDataSaveReqVO createReqVO); + + /** + * 更新检测报表数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessAssayReportData(@Valid BusinessAssayReportDataSaveReqVO updateReqVO); + + /** + * 删除检测报表数据业务 + * + * @param id 编号 + */ + void deleteBusinessAssayReportData(Long id); + + /** + * 批量删除检测报表数据业务 + * + * @param ids 编号 + */ + void deleteBusinessAssayReportDataListByIds(List ids); + + /** + * 获得检测报表数据业务 + * + * @param id 编号 + * @return 检测报表数据业务 + */ + BusinessAssayReportDataDO getBusinessAssayReportData(Long id); + + /** + * 获得检测报表数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 检测报表数据业务分页 + */ + PageResult getBusinessAssayReportDataPage(BusinessAssayReportDataPageReqVO pageReqVO); + + + List listByIds(List ids); + + /** + * 查询待编制报告数据 + * */ + PageResult queryWaitingDataForReport(BusinessAssayReportDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataServiceImpl.java new file mode 100644 index 0000000..198273a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayReportDataServiceImpl.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测报表数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessAssayReportDataServiceImpl implements BusinessAssayReportDataService { + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Override + public BusinessAssayReportDataRespVO createBusinessAssayReportData(BusinessAssayReportDataSaveReqVO createReqVO) { + // 插入 + BusinessAssayReportDataDO businessAssayReportData = BeanUtils.toBean(createReqVO, BusinessAssayReportDataDO.class); + businessAssayReportDataMapper.insert(businessAssayReportData); + // 返回 + return BeanUtils.toBean(businessAssayReportData, BusinessAssayReportDataRespVO.class); + } + + @Override + public void updateBusinessAssayReportData(BusinessAssayReportDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessAssayReportDataExists(updateReqVO.getId()); + // 更新 + BusinessAssayReportDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAssayReportDataDO.class); + businessAssayReportDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessAssayReportData(Long id) { + // 校验存在 + validateBusinessAssayReportDataExists(id); + // 删除 + businessAssayReportDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessAssayReportDataListByIds(List ids) { + // 校验存在 + validateBusinessAssayReportDataExists(ids); + // 删除 + businessAssayReportDataMapper.deleteByIds(ids); + } + + private void validateBusinessAssayReportDataExists(List ids) { + List list = businessAssayReportDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_ASSAY_REPORT_DATA_NOT_EXISTS); + } + } + + private void validateBusinessAssayReportDataExists(Long id) { + if (businessAssayReportDataMapper.selectById(id) == null) { + throw exception(BUSINESS_ASSAY_REPORT_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessAssayReportDataDO getBusinessAssayReportData(Long id) { + return businessAssayReportDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessAssayReportDataPage(BusinessAssayReportDataPageReqVO pageReqVO) { + return businessAssayReportDataMapper.selectPage(pageReqVO); + } + + @Override + public List listByIds(List ids) { + return businessAssayReportDataMapper.selectByIds(ids); + } + + + @Override + public PageResult queryWaitingDataForReport(BusinessAssayReportDataPageReqVO pageReqVO) { + IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + Page pageList = businessAssayReportDataMapper.queryWaitingDataForReport(page, pageReqVO); + PageResult pageResult = new PageResult<>(pageList.getRecords(), pageList.getTotal()); + return pageResult; + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataService.java index 40ca301..50c46be 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataService.java @@ -1,6 +1,8 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.*; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -55,7 +57,14 @@ public interface BusinessAssayTaskDataService { * 获得未指派的子样检测任务业务分组列表 * @return */ - List> getUnAssayTaskGroupList(); + List getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO); + + /** + * 获得审核的子样检测任务业务分组列表 + * @param reqVO + * @return + */ + List getUnAuditTaskGroupList(BusinessAssayTaskDataReqVO reqVO); /** * 获得子样检测任务业务列表 @@ -72,4 +81,5 @@ public interface BusinessAssayTaskDataService { */ PageResult getBusinessAssayTaskDataPage(BusinessAssayTaskDataPageReqVO pageReqVO); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java index 2422233..9af6928 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDataServiceImpl.java @@ -1,12 +1,11 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; -import jakarta.validation.Valid; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -15,6 +14,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMappe import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; @@ -86,8 +87,17 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe } @Override - public List> getUnAssayTaskGroupList() { - return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(); + public List getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + //当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //设置当前登录用户的部门id + reqVO.setAssayDepartmentId(loginUser.getVisitDeptId()); + return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO); + } + + @Override + public List getUnAuditTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { + return businessAssayTaskDataMapper.selectUnAuditTaskGroupList(reqVO); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailService.java new file mode 100644 index 0000000..92fba85 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailService.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; + +/** + * 检测任务分配明细 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessAssayTaskDetailService { + + /** + * 创建检测任务分配明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessAssayTaskDetailRespVO createBusinessAssayTaskDetail(@Valid BusinessAssayTaskDetailSaveReqVO createReqVO); + + /** + * 更新检测任务分配明细 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessAssayTaskDetail(@Valid BusinessAssayTaskDetailSaveReqVO updateReqVO); + + /** + * 删除检测任务分配明细 + * + * @param id 编号 + */ + void deleteBusinessAssayTaskDetail(Long id); + + /** + * 批量删除检测任务分配明细 + * + * @param ids 编号 + */ + void deleteBusinessAssayTaskDetailListByIds(List ids); + + /** + * 获得检测任务分配明细 + * + * @param id 编号 + * @return 检测任务分配明细 + */ + BusinessAssayTaskDetailDO getBusinessAssayTaskDetail(Long id); + + /** + * 获得检测任务分配明细分页 + * + * @param pageReqVO 分页查询 + * @return 检测任务分配明细分页 + */ + PageResult getBusinessAssayTaskDetailPage(BusinessAssayTaskDetailPageReqVO pageReqVO); + + /** + * 获得检测任务分配明细列表 + * + * @param reqVO 分页查询 + * @return 检测任务分配明细列表 + */ + List getBusinessAssayTaskDetailList(BusinessAssayTaskDetailReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailServiceImpl.java new file mode 100644 index 0000000..e563d03 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskDetailServiceImpl.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; + +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测任务分配明细 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessAssayTaskDetailServiceImpl implements BusinessAssayTaskDetailService { + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Override + public BusinessAssayTaskDetailRespVO createBusinessAssayTaskDetail(BusinessAssayTaskDetailSaveReqVO createReqVO) { + // 插入 + BusinessAssayTaskDetailDO businessAssayTaskDetail = BeanUtils.toBean(createReqVO, BusinessAssayTaskDetailDO.class); + businessAssayTaskDetailMapper.insert(businessAssayTaskDetail); + // 返回 + return BeanUtils.toBean(businessAssayTaskDetail, BusinessAssayTaskDetailRespVO.class); + } + + @Override + public void updateBusinessAssayTaskDetail(BusinessAssayTaskDetailSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessAssayTaskDetailExists(updateReqVO.getId()); + // 更新 + BusinessAssayTaskDetailDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAssayTaskDetailDO.class); + businessAssayTaskDetailMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessAssayTaskDetail(Long id) { + // 校验存在 + validateBusinessAssayTaskDetailExists(id); + // 删除 + businessAssayTaskDetailMapper.deleteById(id); + } + + @Override + public void deleteBusinessAssayTaskDetailListByIds(List ids) { + // 校验存在 + validateBusinessAssayTaskDetailExists(ids); + // 删除 + businessAssayTaskDetailMapper.deleteByIds(ids); + } + + private void validateBusinessAssayTaskDetailExists(List ids) { + List list = businessAssayTaskDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_ASSAY_TASK_DETAIL_NOT_EXISTS); + } + } + + private void validateBusinessAssayTaskDetailExists(Long id) { + if (businessAssayTaskDetailMapper.selectById(id) == null) { + throw exception(BUSINESS_ASSAY_TASK_DETAIL_NOT_EXISTS); + } + } + + @Override + public BusinessAssayTaskDetailDO getBusinessAssayTaskDetail(Long id) { + return businessAssayTaskDetailMapper.selectById(id); + } + + @Override + public PageResult getBusinessAssayTaskDetailPage(BusinessAssayTaskDetailPageReqVO pageReqVO) { + return businessAssayTaskDetailMapper.selectPage(pageReqVO); + } + + @Override + public List getBusinessAssayTaskDetailList(BusinessAssayTaskDetailReqVO reqVO) { + return businessAssayTaskDetailMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskService.java new file mode 100644 index 0000000..de4ddc2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskService.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测任务分配业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessAssayTaskService { + + /** + * 创建检测任务分配业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessAssayTaskRespVO createBusinessAssayTask(@Valid BusinessAssayTaskSaveReqVO createReqVO); + + /** + * 更新检测任务分配业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessAssayTask(@Valid BusinessAssayTaskSaveReqVO updateReqVO); + + /** + * 删除检测任务分配业务 + * + * @param id 编号 + */ + void deleteBusinessAssayTask(Long id); + + /** + * 批量删除检测任务分配业务 + * + * @param ids 编号 + */ + void deleteBusinessAssayTaskListByIds(List ids); + + /** + * 获得检测任务分配业务 + * + * @param id 编号 + * @return 检测任务分配业务 + */ + BusinessAssayTaskExtendRespVO getBusinessAssayTask(Long id); + + /** + * 获得检测任务分配业务分页 + * + * @param pageReqVO 分页查询 + * @return 检测任务分配业务分页 + */ + PageResult getBusinessAssayTaskPage(BusinessAssayTaskPageReqVO pageReqVO); + + /** + * 获得检测任务分配业务列表 + * + * @param reqVO 查询 + * @return 检测任务分配业务列表 + */ + List getBusinessAssayTaskList(BusinessAssayTaskPageReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskServiceImpl.java new file mode 100644 index 0000000..de5833f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessAssayTaskServiceImpl.java @@ -0,0 +1,115 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import jakarta.validation.Valid; + +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import java.util.stream.Collectors; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测任务分配业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessAssayTaskServiceImpl implements BusinessAssayTaskService { + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + @Resource + private ConfigQCSampleMethodMapper configQCSampleMethodMapper; + + @Override + public BusinessAssayTaskRespVO createBusinessAssayTask(BusinessAssayTaskSaveReqVO createReqVO) { + // 插入 + BusinessAssayTaskDO businessAssayTask = BeanUtils.toBean(createReqVO, BusinessAssayTaskDO.class); + businessAssayTaskMapper.insert(businessAssayTask); + // 返回 + return BeanUtils.toBean(businessAssayTask, BusinessAssayTaskRespVO.class); + } + + @Override + public void updateBusinessAssayTask(BusinessAssayTaskSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessAssayTaskExists(updateReqVO.getId()); + // 更新 + BusinessAssayTaskDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAssayTaskDO.class); + businessAssayTaskMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessAssayTask(Long id) { + // 校验存在 + validateBusinessAssayTaskExists(id); + // 删除 + businessAssayTaskMapper.deleteById(id); + } + + @Override + public void deleteBusinessAssayTaskListByIds(List ids) { + // 校验存在 + validateBusinessAssayTaskExists(ids); + // 删除 + businessAssayTaskMapper.deleteByIds(ids); + } + + private void validateBusinessAssayTaskExists(List ids) { + List list = businessAssayTaskMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_ASSAY_TASK_NOT_EXISTS); + } + } + + private void validateBusinessAssayTaskExists(Long id) { + if (businessAssayTaskMapper.selectById(id) == null) { + throw exception(BUSINESS_ASSAY_TASK_NOT_EXISTS); + } + } + + @Override + public BusinessAssayTaskExtendRespVO getBusinessAssayTask(Long id) { + BusinessAssayTaskExtendRespVO businessAssayTaskExtendRespVO = businessAssayTaskMapper.selectBusinessAssayTaskById(id); + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskExtendRespVO.getConfigAssayMethodId()); + String assayProject = configAssayMethodProjectList.stream().map(m -> m.getShowName()).collect(Collectors.joining(",")); + businessAssayTaskExtendRespVO.setConfigAssayMethodProjectShowNames(assayProject); + List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskExtendRespVO.getConfigAssayMethodId()); + businessAssayTaskExtendRespVO.setConfigQCSampleMethodList(configQCSampleMethodList); + return businessAssayTaskExtendRespVO; + } + + @Override + public PageResult getBusinessAssayTaskPage(BusinessAssayTaskPageReqVO pageReqVO) { + return businessAssayTaskMapper.selectPage(pageReqVO); + } + + @Override + public List getBusinessAssayTaskList(BusinessAssayTaskPageReqVO reqVO) { + return businessAssayTaskMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleService.java index 7a35be5..5b06577 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleServiceImpl.java index 4e1ae9c..dc921fa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessBaseSampleServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessBaseSampleSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubService.java index bb3f0f7..30bfdd5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubService.java @@ -1,6 +1,11 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -59,4 +64,5 @@ public interface BusinessHandoverRecordSubService { */ PageResult getBusinessHandoverRecordSubPage(BusinessHandoverRecordSubPageReqVO pageReqVO); + void insertBatch(List list); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubServiceImpl.java index 05e98ba..ab73f52 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessHandoverRecordSubServiceImpl.java @@ -1,10 +1,14 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; @@ -88,4 +92,9 @@ public class BusinessHandoverRecordSubServiceImpl implements BusinessHandoverRec return businessHandoverRecordSubMapper.selectPage(pageReqVO); } + @Override + @Transactional(rollbackFor = Exception.class) + public void insertBatch(List list) { + businessHandoverRecordSubMapper.insertBatch(list); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java new file mode 100644 index 0000000..dc59a8b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测系数任务数据,空白样、标样 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCCoefficientDataService { + + /** + * 创建质控样检测系数任务数据,空白样、标样 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCCoefficientDataRespVO createBusinessQCCoefficientData(@Valid BusinessQCCoefficientDataSaveReqVO createReqVO); + + /** + * 更新质控样检测系数任务数据,空白样、标样 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCCoefficientData(@Valid BusinessQCCoefficientDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测系数任务数据,空白样、标样 + * + * @param id 编号 + */ + void deleteBusinessQCCoefficientData(Long id); + + /** + * 批量删除质控样检测系数任务数据,空白样、标样 + * + * @param ids 编号 + */ + void deleteBusinessQCCoefficientDataListByIds(List ids); + + /** + * 获得质控样检测系数任务数据,空白样、标样 + * + * @param id 编号 + * @return 质控样检测系数任务数据,空白样、标样 + */ + BusinessQCCoefficientDataDO getBusinessQCCoefficientData(Long id); + + /** + * 获得质控样检测系数任务数据,空白样、标样分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测系数任务数据,空白样、标样分页 + */ + PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO); + + List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java new file mode 100644 index 0000000..339ce33 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientDataServiceImpl.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测系数任务数据,空白样、标样 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCCoefficientDataServiceImpl implements BusinessQCCoefficientDataService { + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Override + public BusinessQCCoefficientDataRespVO createBusinessQCCoefficientData(BusinessQCCoefficientDataSaveReqVO createReqVO) { + // 插入 + BusinessQCCoefficientDataDO businessQCCoefficientData = BeanUtils.toBean(createReqVO, BusinessQCCoefficientDataDO.class); + businessQCCoefficientDataMapper.insert(businessQCCoefficientData); + // 返回 + return BeanUtils.toBean(businessQCCoefficientData, BusinessQCCoefficientDataRespVO.class); + } + + @Override + public void updateBusinessQCCoefficientData(BusinessQCCoefficientDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCCoefficientDataExists(updateReqVO.getId()); + // 更新 + BusinessQCCoefficientDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCCoefficientDataDO.class); + businessQCCoefficientDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCCoefficientData(Long id) { + // 校验存在 + validateBusinessQCCoefficientDataExists(id); + // 删除 + businessQCCoefficientDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCCoefficientDataListByIds(List ids) { + // 校验存在 + validateBusinessQCCoefficientDataExists(ids); + // 删除 + businessQCCoefficientDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCCoefficientDataExists(List ids) { + List list = businessQCCoefficientDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCCoefficientDataExists(Long id) { + if (businessQCCoefficientDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCCoefficientDataDO getBusinessQCCoefficientData(Long id) { + return businessQCCoefficientDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCCoefficientDataPage(BusinessQCCoefficientDataPageReqVO pageReqVO) { + return businessQCCoefficientDataMapper.selectPage(pageReqVO); + } + + @Override + public List getBusinessQCCoefficientDataList(BusinessQCCoefficientDataReqVO reqVO) { + return businessQCCoefficientDataMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataService.java new file mode 100644 index 0000000..833980a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测系数参数业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCCoefficientParameterDataService { + + /** + * 创建质控样检测系数参数业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCCoefficientParameterDataRespVO createBusinessQCCoefficientParameterData(@Valid BusinessQCCoefficientParameterDataSaveReqVO createReqVO); + + /** + * 更新质控样检测系数参数业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCCoefficientParameterData(@Valid BusinessQCCoefficientParameterDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测系数参数业务 + * + * @param id 编号 + */ + void deleteBusinessQCCoefficientParameterData(Long id); + + /** + * 批量删除质控样检测系数参数业务 + * + * @param ids 编号 + */ + void deleteBusinessQCCoefficientParameterDataListByIds(List ids); + + /** + * 获得质控样检测系数参数业务 + * + * @param id 编号 + * @return 质控样检测系数参数业务 + */ + BusinessQCCoefficientParameterDataDO getBusinessQCCoefficientParameterData(Long id); + + /** + * 获得质控样检测系数参数业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测系数参数业务分页 + */ + PageResult getBusinessQCCoefficientParameterDataPage(BusinessQCCoefficientParameterDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataServiceImpl.java new file mode 100644 index 0000000..e877443 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCCoefficientParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测系数参数业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCCoefficientParameterDataServiceImpl implements BusinessQCCoefficientParameterDataService { + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Override + public BusinessQCCoefficientParameterDataRespVO createBusinessQCCoefficientParameterData(BusinessQCCoefficientParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterData = BeanUtils.toBean(createReqVO, BusinessQCCoefficientParameterDataDO.class); + businessQCCoefficientParameterDataMapper.insert(businessQCCoefficientParameterData); + // 返回 + return BeanUtils.toBean(businessQCCoefficientParameterData, BusinessQCCoefficientParameterDataRespVO.class); + } + + @Override + public void updateBusinessQCCoefficientParameterData(BusinessQCCoefficientParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCCoefficientParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessQCCoefficientParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCCoefficientParameterDataDO.class); + businessQCCoefficientParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCCoefficientParameterData(Long id) { + // 校验存在 + validateBusinessQCCoefficientParameterDataExists(id); + // 删除 + businessQCCoefficientParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCCoefficientParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessQCCoefficientParameterDataExists(ids); + // 删除 + businessQCCoefficientParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCCoefficientParameterDataExists(List ids) { + List list = businessQCCoefficientParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCCoefficientParameterDataExists(Long id) { + if (businessQCCoefficientParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCCoefficientParameterDataDO getBusinessQCCoefficientParameterData(Long id) { + return businessQCCoefficientParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCCoefficientParameterDataPage(BusinessQCCoefficientParameterDataPageReqVO pageReqVO) { + return businessQCCoefficientParameterDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataService.java new file mode 100644 index 0000000..5d760c7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataService.java @@ -0,0 +1,69 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCDataService { + + /** + * 创建质控样业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCDataRespVO createBusinessQCData(@Valid BusinessQCDataSaveReqVO createReqVO); + + /** + * 更新质控样业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCData(@Valid BusinessQCDataSaveReqVO updateReqVO); + + /** + * 删除质控样业务 + * + * @param id 编号 + */ + void deleteBusinessQCData(Long id); + + /** + * 批量删除质控样业务 + * + * @param ids 编号 + */ + void deleteBusinessQCDataListByIds(List ids); + + /** + * 获得质控样业务 + * + * @param id 编号 + * @return 质控样业务 + */ + BusinessQCDataDO getBusinessQCData(Long id); + + /** + * 获得质控样业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样业务分页 + */ + PageResult getBusinessQCDataPage(BusinessQCDataPageReqVO pageReqVO); + + /** + * 获取质控样业务列表 + * @param reqVO + * @return + */ + List getBusinessQCDataList(BusinessQCDataReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataServiceImpl.java new file mode 100644 index 0000000..caf6561 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCDataServiceImpl.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCDataServiceImpl implements BusinessQCDataService { + + @Resource + private BusinessQCDataMapper businessQCDataMapper; + + @Override + public BusinessQCDataRespVO createBusinessQCData(BusinessQCDataSaveReqVO createReqVO) { + // 插入 + BusinessQCDataDO businessQCData = BeanUtils.toBean(createReqVO, BusinessQCDataDO.class); + businessQCDataMapper.insert(businessQCData); + // 返回 + return BeanUtils.toBean(businessQCData, BusinessQCDataRespVO.class); + } + + @Override + public void updateBusinessQCData(BusinessQCDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCDataExists(updateReqVO.getId()); + // 更新 + BusinessQCDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCDataDO.class); + businessQCDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCData(Long id) { + // 校验存在 + validateBusinessQCDataExists(id); + // 删除 + businessQCDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCDataListByIds(List ids) { + // 校验存在 + validateBusinessQCDataExists(ids); + // 删除 + businessQCDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCDataExists(List ids) { + List list = businessQCDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCDataExists(Long id) { + if (businessQCDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCDataDO getBusinessQCData(Long id) { + return businessQCDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCDataPage(BusinessQCDataPageReqVO pageReqVO) { + return businessQCDataMapper.selectPage(pageReqVO); + } + + @Override + public List getBusinessQCDataList(BusinessQCDataReqVO reqVO) { + return businessQCDataMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java new file mode 100644 index 0000000..9ab773f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataService.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控管理样检测任务数据,管理样、标准样 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCManagementDataService { + + /** + * 创建质控管理样检测任务数据,管理样、标准样 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCManagementDataRespVO createBusinessQCManagementData(@Valid BusinessQCManagementDataSaveReqVO createReqVO); + + /** + * 更新质控管理样检测任务数据,管理样、标准样 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCManagementData(@Valid BusinessQCManagementDataSaveReqVO updateReqVO); + + /** + * 删除质控管理样检测任务数据,管理样、标准样 + * + * @param id 编号 + */ + void deleteBusinessQCManagementData(Long id); + + /** + * 批量删除质控管理样检测任务数据,管理样、标准样 + * + * @param ids 编号 + */ + void deleteBusinessQCManagementDataListByIds(List ids); + + /** + * 获得质控管理样检测任务数据,管理样、标准样 + * + * @param id 编号 + * @return 质控管理样检测任务数据,管理样、标准样 + */ + BusinessQCManagementDataDO getBusinessQCManagementData(Long id); + + /** + * 获得质控管理样检测任务数据,管理样、标准样分页 + * + * @param pageReqVO 分页查询 + * @return 质控管理样检测任务数据,管理样、标准样分页 + */ + PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO); + + List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java new file mode 100644 index 0000000..7601b09 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementDataServiceImpl.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控管理样检测任务数据,管理样、标准样 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCManagementDataServiceImpl implements BusinessQCManagementDataService { + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Override + public BusinessQCManagementDataRespVO createBusinessQCManagementData(BusinessQCManagementDataSaveReqVO createReqVO) { + // 插入 + BusinessQCManagementDataDO businessQCManagementData = BeanUtils.toBean(createReqVO, BusinessQCManagementDataDO.class); + businessQCManagementDataMapper.insert(businessQCManagementData); + // 返回 + return BeanUtils.toBean(businessQCManagementData, BusinessQCManagementDataRespVO.class); + } + + @Override + public void updateBusinessQCManagementData(BusinessQCManagementDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCManagementDataExists(updateReqVO.getId()); + // 更新 + BusinessQCManagementDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCManagementDataDO.class); + businessQCManagementDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCManagementData(Long id) { + // 校验存在 + validateBusinessQCManagementDataExists(id); + // 删除 + businessQCManagementDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCManagementDataListByIds(List ids) { + // 校验存在 + validateBusinessQCManagementDataExists(ids); + // 删除 + businessQCManagementDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCManagementDataExists(List ids) { + List list = businessQCManagementDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_MANAGEMENT_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCManagementDataExists(Long id) { + if (businessQCManagementDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_MANAGEMENT_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCManagementDataDO getBusinessQCManagementData(Long id) { + return businessQCManagementDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCManagementDataPage(BusinessQCManagementDataPageReqVO pageReqVO) { + return businessQCManagementDataMapper.selectPage(pageReqVO); + } + + @Override + public List getBusinessQCManagementDataList(BusinessQCManagementDataReqVO reqVO) { + return businessQCManagementDataMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataService.java new file mode 100644 index 0000000..0d9b56f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测参数数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCManagementParameterDataService { + + /** + * 创建质控样检测参数数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCManagementParameterDataRespVO createBusinessQCManagementParameterData(@Valid BusinessQCManagementParameterDataSaveReqVO createReqVO); + + /** + * 更新质控样检测参数数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCManagementParameterData(@Valid BusinessQCManagementParameterDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测参数数据业务 + * + * @param id 编号 + */ + void deleteBusinessQCManagementParameterData(Long id); + + /** + * 批量删除质控样检测参数数据业务 + * + * @param ids 编号 + */ + void deleteBusinessQCManagementParameterDataListByIds(List ids); + + /** + * 获得质控样检测参数数据业务 + * + * @param id 编号 + * @return 质控样检测参数数据业务 + */ + BusinessQCManagementParameterDataDO getBusinessQCManagementParameterData(Long id); + + /** + * 获得质控样检测参数数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测参数数据业务分页 + */ + PageResult getBusinessQCManagementParameterDataPage(BusinessQCManagementParameterDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataServiceImpl.java new file mode 100644 index 0000000..832d04a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测参数数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCManagementParameterDataServiceImpl implements BusinessQCManagementParameterDataService { + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + + @Override + public BusinessQCManagementParameterDataRespVO createBusinessQCManagementParameterData(BusinessQCManagementParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessQCManagementParameterDataDO businessQCManagementParameterData = BeanUtils.toBean(createReqVO, BusinessQCManagementParameterDataDO.class); + businessQCManagementParameterDataMapper.insert(businessQCManagementParameterData); + // 返回 + return BeanUtils.toBean(businessQCManagementParameterData, BusinessQCManagementParameterDataRespVO.class); + } + + @Override + public void updateBusinessQCManagementParameterData(BusinessQCManagementParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCManagementParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessQCManagementParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCManagementParameterDataDO.class); + businessQCManagementParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCManagementParameterData(Long id) { + // 校验存在 + validateBusinessQCManagementParameterDataExists(id); + // 删除 + businessQCManagementParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCManagementParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessQCManagementParameterDataExists(ids); + // 删除 + businessQCManagementParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCManagementParameterDataExists(List ids) { + List list = businessQCManagementParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_MANAGEMENT_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCManagementParameterDataExists(Long id) { + if (businessQCManagementParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_MANAGEMENT_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCManagementParameterDataDO getBusinessQCManagementParameterData(Long id) { + return businessQCManagementParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCManagementParameterDataPage(BusinessQCManagementParameterDataPageReqVO pageReqVO) { + return businessQCManagementParameterDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataService.java new file mode 100644 index 0000000..ae2b5c7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测项目数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCManagementProjectDataService { + + /** + * 创建质控样检测项目数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCManagementProjectDataRespVO createBusinessQCManagementProjectData(@Valid BusinessQCManagementProjectDataSaveReqVO createReqVO); + + /** + * 更新质控样检测项目数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCManagementProjectData(@Valid BusinessQCManagementProjectDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测项目数据业务 + * + * @param id 编号 + */ + void deleteBusinessQCManagementProjectData(Long id); + + /** + * 批量删除质控样检测项目数据业务 + * + * @param ids 编号 + */ + void deleteBusinessQCManagementProjectDataListByIds(List ids); + + /** + * 获得质控样检测项目数据业务 + * + * @param id 编号 + * @return 质控样检测项目数据业务 + */ + BusinessQCManagementProjectDataDO getBusinessQCManagementProjectData(Long id); + + /** + * 获得质控样检测项目数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测项目数据业务分页 + */ + PageResult getBusinessQCManagementProjectDataPage(BusinessQCManagementProjectDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataServiceImpl.java new file mode 100644 index 0000000..38baa44 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCManagementProjectDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测项目数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCManagementProjectDataServiceImpl implements BusinessQCManagementProjectDataService { + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Override + public BusinessQCManagementProjectDataRespVO createBusinessQCManagementProjectData(BusinessQCManagementProjectDataSaveReqVO createReqVO) { + // 插入 + BusinessQCManagementProjectDataDO businessQCManagementProjectData = BeanUtils.toBean(createReqVO, BusinessQCManagementProjectDataDO.class); + businessQCManagementProjectDataMapper.insert(businessQCManagementProjectData); + // 返回 + return BeanUtils.toBean(businessQCManagementProjectData, BusinessQCManagementProjectDataRespVO.class); + } + + @Override + public void updateBusinessQCManagementProjectData(BusinessQCManagementProjectDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCManagementProjectDataExists(updateReqVO.getId()); + // 更新 + BusinessQCManagementProjectDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCManagementProjectDataDO.class); + businessQCManagementProjectDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCManagementProjectData(Long id) { + // 校验存在 + validateBusinessQCManagementProjectDataExists(id); + // 删除 + businessQCManagementProjectDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCManagementProjectDataListByIds(List ids) { + // 校验存在 + validateBusinessQCManagementProjectDataExists(ids); + // 删除 + businessQCManagementProjectDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCManagementProjectDataExists(List ids) { + List list = businessQCManagementProjectDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_MANAGEMENT_PROJECT_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCManagementProjectDataExists(Long id) { + if (businessQCManagementProjectDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_MANAGEMENT_PROJECT_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCManagementProjectDataDO getBusinessQCManagementProjectData(Long id) { + return businessQCManagementProjectDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCManagementProjectDataPage(BusinessQCManagementProjectDataPageReqVO pageReqVO) { + return businessQCManagementProjectDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataService.java new file mode 100644 index 0000000..1bb9ff1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测参数数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCParameterDataService { + + /** + * 创建质控样检测参数数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCParameterDataRespVO createBusinessQCParameterData(@Valid BusinessQCParameterDataSaveReqVO createReqVO); + + /** + * 更新质控样检测参数数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCParameterData(@Valid BusinessQCParameterDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测参数数据业务 + * + * @param id 编号 + */ + void deleteBusinessQCParameterData(Long id); + + /** + * 批量删除质控样检测参数数据业务 + * + * @param ids 编号 + */ + void deleteBusinessQCParameterDataListByIds(List ids); + + /** + * 获得质控样检测参数数据业务 + * + * @param id 编号 + * @return 质控样检测参数数据业务 + */ + BusinessQCParameterDataDO getBusinessQCParameterData(Long id); + + /** + * 获得质控样检测参数数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测参数数据业务分页 + */ + PageResult getBusinessQCParameterDataPage(BusinessQCParameterDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataServiceImpl.java new file mode 100644 index 0000000..205f252 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCParameterDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCParameterDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测参数数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCParameterDataServiceImpl implements BusinessQCParameterDataService { + + @Resource + private BusinessQCParameterDataMapper businessQCParameterDataMapper; + + @Override + public BusinessQCParameterDataRespVO createBusinessQCParameterData(BusinessQCParameterDataSaveReqVO createReqVO) { + // 插入 + BusinessQCParameterDataDO businessQCParameterData = BeanUtils.toBean(createReqVO, BusinessQCParameterDataDO.class); + businessQCParameterDataMapper.insert(businessQCParameterData); + // 返回 + return BeanUtils.toBean(businessQCParameterData, BusinessQCParameterDataRespVO.class); + } + + @Override + public void updateBusinessQCParameterData(BusinessQCParameterDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCParameterDataExists(updateReqVO.getId()); + // 更新 + BusinessQCParameterDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCParameterDataDO.class); + businessQCParameterDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCParameterData(Long id) { + // 校验存在 + validateBusinessQCParameterDataExists(id); + // 删除 + businessQCParameterDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCParameterDataListByIds(List ids) { + // 校验存在 + validateBusinessQCParameterDataExists(ids); + // 删除 + businessQCParameterDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCParameterDataExists(List ids) { + List list = businessQCParameterDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_PARAMETER_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCParameterDataExists(Long id) { + if (businessQCParameterDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_PARAMETER_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCParameterDataDO getBusinessQCParameterData(Long id) { + return businessQCParameterDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCParameterDataPage(BusinessQCParameterDataPageReqVO pageReqVO) { + return businessQCParameterDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataService.java new file mode 100644 index 0000000..e5480c9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测项目数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQCProjectDataService { + + /** + * 创建质控样检测项目数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQCProjectDataRespVO createBusinessQCProjectData(@Valid BusinessQCProjectDataSaveReqVO createReqVO); + + /** + * 更新质控样检测项目数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQCProjectData(@Valid BusinessQCProjectDataSaveReqVO updateReqVO); + + /** + * 删除质控样检测项目数据业务 + * + * @param id 编号 + */ + void deleteBusinessQCProjectData(Long id); + + /** + * 批量删除质控样检测项目数据业务 + * + * @param ids 编号 + */ + void deleteBusinessQCProjectDataListByIds(List ids); + + /** + * 获得质控样检测项目数据业务 + * + * @param id 编号 + * @return 质控样检测项目数据业务 + */ + BusinessQCProjectDataDO getBusinessQCProjectData(Long id); + + /** + * 获得质控样检测项目数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测项目数据业务分页 + */ + PageResult getBusinessQCProjectDataPage(BusinessQCProjectDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataServiceImpl.java new file mode 100644 index 0000000..9ee16b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQCProjectDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCProjectDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测项目数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQCProjectDataServiceImpl implements BusinessQCProjectDataService { + + @Resource + private BusinessQCProjectDataMapper businessQCProjectDataMapper; + + @Override + public BusinessQCProjectDataRespVO createBusinessQCProjectData(BusinessQCProjectDataSaveReqVO createReqVO) { + // 插入 + BusinessQCProjectDataDO businessQCProjectData = BeanUtils.toBean(createReqVO, BusinessQCProjectDataDO.class); + businessQCProjectDataMapper.insert(businessQCProjectData); + // 返回 + return BeanUtils.toBean(businessQCProjectData, BusinessQCProjectDataRespVO.class); + } + + @Override + public void updateBusinessQCProjectData(BusinessQCProjectDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQCProjectDataExists(updateReqVO.getId()); + // 更新 + BusinessQCProjectDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQCProjectDataDO.class); + businessQCProjectDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQCProjectData(Long id) { + // 校验存在 + validateBusinessQCProjectDataExists(id); + // 删除 + businessQCProjectDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessQCProjectDataListByIds(List ids) { + // 校验存在 + validateBusinessQCProjectDataExists(ids); + // 删除 + businessQCProjectDataMapper.deleteByIds(ids); + } + + private void validateBusinessQCProjectDataExists(List ids) { + List list = businessQCProjectDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QC_PROJECT_DATA_NOT_EXISTS); + } + } + + private void validateBusinessQCProjectDataExists(Long id) { + if (businessQCProjectDataMapper.selectById(id) == null) { + throw exception(BUSINESS_QC_PROJECT_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessQCProjectDataDO getBusinessQCProjectData(Long id) { + return businessQCProjectDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessQCProjectDataPage(BusinessQCProjectDataPageReqVO pageReqVO) { + return businessQCProjectDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectService.java new file mode 100644 index 0000000..84afe73 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQualityControlSampleProjectDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测项目业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessQualityControlSampleProjectService { + + /** + * 创建质控样检测项目业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessQualityControlSampleProjectRespVO createBusinessQualityControlSampleProject(@Valid BusinessQualityControlSampleProjectSaveReqVO createReqVO); + + /** + * 更新质控样检测项目业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessQualityControlSampleProject(@Valid BusinessQualityControlSampleProjectSaveReqVO updateReqVO); + + /** + * 删除质控样检测项目业务 + * + * @param id 编号 + */ + void deleteBusinessQualityControlSampleProject(Long id); + + /** + * 批量删除质控样检测项目业务 + * + * @param ids 编号 + */ + void deleteBusinessQualityControlSampleProjectListByIds(List ids); + + /** + * 获得质控样检测项目业务 + * + * @param id 编号 + * @return 质控样检测项目业务 + */ + BusinessQualityControlSampleProjectDO getBusinessQualityControlSampleProject(Long id); + + /** + * 获得质控样检测项目业务分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测项目业务分页 + */ + PageResult getBusinessQualityControlSampleProjectPage(BusinessQualityControlSampleProjectPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectServiceImpl.java new file mode 100644 index 0000000..085e11b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessQualityControlSampleProjectServiceImpl.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQualityControlSampleProjectSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQualityControlSampleProjectDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQualityControlSampleProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测项目业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessQualityControlSampleProjectServiceImpl implements BusinessQualityControlSampleProjectService { + + @Resource + private BusinessQualityControlSampleProjectMapper businessQualityControlSampleProjectMapper; + + @Override + public BusinessQualityControlSampleProjectRespVO createBusinessQualityControlSampleProject(BusinessQualityControlSampleProjectSaveReqVO createReqVO) { + // 插入 + BusinessQualityControlSampleProjectDO businessQualityControlSampleProject = BeanUtils.toBean(createReqVO, BusinessQualityControlSampleProjectDO.class); + businessQualityControlSampleProjectMapper.insert(businessQualityControlSampleProject); + // 返回 + return BeanUtils.toBean(businessQualityControlSampleProject, BusinessQualityControlSampleProjectRespVO.class); + } + + @Override + public void updateBusinessQualityControlSampleProject(BusinessQualityControlSampleProjectSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessQualityControlSampleProjectExists(updateReqVO.getId()); + // 更新 + BusinessQualityControlSampleProjectDO updateObj = BeanUtils.toBean(updateReqVO, BusinessQualityControlSampleProjectDO.class); + businessQualityControlSampleProjectMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessQualityControlSampleProject(Long id) { + // 校验存在 + validateBusinessQualityControlSampleProjectExists(id); + // 删除 + businessQualityControlSampleProjectMapper.deleteById(id); + } + + @Override + public void deleteBusinessQualityControlSampleProjectListByIds(List ids) { + // 校验存在 + validateBusinessQualityControlSampleProjectExists(ids); + // 删除 + businessQualityControlSampleProjectMapper.deleteByIds(ids); + } + + private void validateBusinessQualityControlSampleProjectExists(List ids) { + List list = businessQualityControlSampleProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_QUALITY_CONTROL_SAMPLE_PROJECT_NOT_EXISTS); + } + } + + private void validateBusinessQualityControlSampleProjectExists(Long id) { + if (businessQualityControlSampleProjectMapper.selectById(id) == null) { + throw exception(BUSINESS_QUALITY_CONTROL_SAMPLE_PROJECT_NOT_EXISTS); + } + } + + @Override + public BusinessQualityControlSampleProjectDO getBusinessQualityControlSampleProject(Long id) { + return businessQualityControlSampleProjectMapper.selectById(id); + } + + @Override + public PageResult getBusinessQualityControlSampleProjectPage(BusinessQualityControlSampleProjectPageReqVO pageReqVO) { + return businessQualityControlSampleProjectMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultService.java index 623f536..0b54901 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultServiceImpl.java index 7bb4e0d..73ea891 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleAssayResultServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleAssayResultSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailService.java new file mode 100644 index 0000000..83fe2f6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailService.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 样品调拨明细 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSampleDispatchDetailService { + + List listByParID(Long parID); + + void insertBatch(List list); + void updateBatch(List list); + + /** + * 创建样品调拨明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSampleDispatchDetailRespVO createBusinessSampleDispatchDetail(@Valid BusinessSampleDispatchDetailSaveReqVO createReqVO); + + /** + * 更新样品调拨明细 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSampleDispatchDetail(@Valid BusinessSampleDispatchDetailSaveReqVO updateReqVO); + + /** + * 删除样品调拨明细 + * + * @param id 编号 + */ + void deleteBusinessSampleDispatchDetail(Long id); + + /** + * 批量删除样品调拨明细 + * + * @param ids 编号 + */ + void deleteBusinessSampleDispatchDetailListByIds(List ids); + + /** + * 获得样品调拨明细 + * + * @param id 编号 + * @return 样品调拨明细 + */ + BusinessSampleDispatchDetailDO getBusinessSampleDispatchDetail(Long id); + + /** + * 获得样品调拨明细分页 + * + * @param pageReqVO 分页查询 + * @return 样品调拨明细分页 + */ + PageResult getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailServiceImpl.java new file mode 100644 index 0000000..f16fded --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchDetailServiceImpl.java @@ -0,0 +1,111 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleDispatchDetailMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 样品调拨明细 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSampleDispatchDetailServiceImpl implements BusinessSampleDispatchDetailService { + + @Resource + private BusinessSampleDispatchDetailMapper businessSampleDispatchDetailMapper; + + @Override + public List listByParID(Long parID) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(BusinessSampleDispatchDetailDO::getParentId, parID); + return businessSampleDispatchDetailMapper.selectList(query); + } + + @Override + public void insertBatch(List list) { + businessSampleDispatchDetailMapper.insertBatch(list); + } + + @Override + public void updateBatch(List list) { + businessSampleDispatchDetailMapper.updateBatch(list); + } + + @Override + public BusinessSampleDispatchDetailRespVO createBusinessSampleDispatchDetail(BusinessSampleDispatchDetailSaveReqVO createReqVO) { + // 插入 + BusinessSampleDispatchDetailDO businessSampleDispatchDetail = BeanUtils.toBean(createReqVO, BusinessSampleDispatchDetailDO.class); + businessSampleDispatchDetailMapper.insert(businessSampleDispatchDetail); + // 返回 + return BeanUtils.toBean(businessSampleDispatchDetail, BusinessSampleDispatchDetailRespVO.class); + } + + @Override + public void updateBusinessSampleDispatchDetail(BusinessSampleDispatchDetailSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSampleDispatchDetailExists(updateReqVO.getId()); + // 更新 + BusinessSampleDispatchDetailDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSampleDispatchDetailDO.class); + businessSampleDispatchDetailMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSampleDispatchDetail(Long id) { + // 校验存在 + validateBusinessSampleDispatchDetailExists(id); + // 删除 + businessSampleDispatchDetailMapper.deleteById(id); + } + + @Override + public void deleteBusinessSampleDispatchDetailListByIds(List ids) { + // 校验存在 + validateBusinessSampleDispatchDetailExists(ids); + // 删除 + businessSampleDispatchDetailMapper.deleteByIds(ids); + } + + private void validateBusinessSampleDispatchDetailExists(List ids) { + List list = businessSampleDispatchDetailMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS); + } + } + + private void validateBusinessSampleDispatchDetailExists(Long id) { + if (businessSampleDispatchDetailMapper.selectById(id) == null) { + throw exception(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS); + } + } + + @Override + public BusinessSampleDispatchDetailDO getBusinessSampleDispatchDetail(Long id) { + return businessSampleDispatchDetailMapper.selectById(id); + } + + @Override + public PageResult getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO) { + return businessSampleDispatchDetailMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java new file mode 100644 index 0000000..d06739a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchService.java @@ -0,0 +1,76 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 样品调拨 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSampleDispatchService { + + //增加样品 + void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo); + + //发起流程 + CommonResult createProcessInstance(BusinessSampleDispatchSaveReqVO paramVo); + + //执行调拨 + CommonResult execDispatch(BusinessSampleDispatchSaveReqVO paramVo); + CommonResult execGiveback(JSONObject paramVo); + + /** + * 创建样品调拨 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSampleDispatchRespVO createBusinessSampleDispatch(@Valid BusinessSampleDispatchSaveReqVO createReqVO); + + /** + * 更新样品调拨 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSampleDispatch(@Valid BusinessSampleDispatchSaveReqVO updateReqVO); + + /** + * 删除样品调拨 + * + * @param id 编号 + */ + void deleteBusinessSampleDispatch(Long id); + + /** + * 批量删除样品调拨 + * + * @param ids 编号 + */ + void deleteBusinessSampleDispatchListByIds(List ids); + + /** + * 获得样品调拨 + * + * @param id 编号 + * @return 样品调拨 + */ + BusinessSampleDispatchDO getBusinessSampleDispatch(Long id); + + /** + * 获得样品调拨分页 + * + * @param pageReqVO 分页查询 + * @return 样品调拨分页 + */ + PageResult getBusinessSampleDispatchPage(BusinessSampleDispatchPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java new file mode 100644 index 0000000..7cda5e3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleDispatchServiceImpl.java @@ -0,0 +1,354 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; +import com.zt.plat.module.bpm.api.task.BpmTaskApi; +import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import com.zt.plat.module.qms.api.task.BMPCallbackInterface; +import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService; +import com.zt.plat.module.qms.enums.QmsBpmConstant; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.*; + +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleDispatchMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; +import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME; + +/** + * 样品调拨 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +@Slf4j +public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService, BMPCallbackInterface { + + @Resource private BusinessSampleDispatchMapper businessSampleDispatchMapper; + @Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService; + @Resource private BusinessSubSampleService businessSubSampleService; + @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; + @Resource private BpmTaskApi bpmTaskApi; + @Resource private DictionaryBusinessService dictionaryBusinessService; + @Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService; + + @Override + @Transactional(rollbackFor = Exception.class) + public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo) { + Long id = paramVo.getId(); + List addSubSampleIds = paramVo.getAddSubSampleIds(); + List removeDetailIds = paramVo.getRemoveDetailIds(); + + //处理移除 + if(!removeDetailIds.isEmpty()){ + businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds); + } + //处理新增 + if(!addSubSampleIds.isEmpty()){ + List detailList = businessSampleDispatchDetailService.listByParID(id); + //去除已添加过的 + List hasIds = detailList.stream().map(BusinessSampleDispatchDetailDO::getBusinessSubSampleId).toList(); + addSubSampleIds.removeAll(hasIds); + List insertList = new ArrayList<>(); + for (Long subSampleId : addSubSampleIds) { + BusinessSampleDispatchDetailDO detail = new BusinessSampleDispatchDetailDO(); + detail.setBusinessSubSampleId(subSampleId); + detail.setParentId(id); + insertList.add(detail); + } + if(!insertList.isEmpty()) + businessSampleDispatchDetailService.insertBatch(insertList); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createProcessInstance(BusinessSampleDispatchSaveReqVO param) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + Long id = param.getId(); + BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id); + JSONObject formData = new JSONObject(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + entity.setApplyUser(nickName); + entity.setApplyUserId(loginUser.getId()); + entity.setApplyDepartment(loginUser.getVisitDeptName()); + entity.setApplyDepartmentId(loginUser.getVisitDeptId()); + entity.setApplyTime(LocalDateTime.now()); + + formData.put("mainId", id); + formData.put("applyUser", nickName); + formData.put("applyUserId", loginUser.getId()); + formData.put("applyDepartment", loginUser.getVisitDeptName()); + formData.put("applyDepartmentId", loginUser.getVisitDeptId()); + formData.put("applyTime", sdf.format(new Date())); + formData.put("mainDepartmentId", entity.getMainDepartmentId()); + formData.put("mainDepartmentName", entity.getMainDepartmentName()); + Map variables = formData.toJavaObject(Map.class); + variables.put(BPM_CALLBACK_BEAN_NAME, "businessSampleDispatchService"); //流程回调时使用的service + String dictKey = "qms_sample_dispatch_flow_key"; //todo 创建业务字典 + String flowKey = dictionaryBusinessService.getValueByDataKey(dictKey); + BpmProcessInstanceCreateReqDTO reqDTO = new BpmProcessInstanceCreateReqDTO(); + reqDTO.setBusinessKey(String.valueOf(id)); + reqDTO.setProcessDefinitionKey(flowKey); + reqDTO.setVariables(variables); + CommonResult result = bpmProcessInstanceApi.createProcessInstance(loginUser.getId(), reqDTO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + String wfInsId = result.getData(); + entity.setFlowInstanceId(wfInsId); + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + businessSampleDispatchMapper.updateById(entity); + BusinessSampleDispatchRespVO respVO = BeanUtils.toBean(entity, BusinessSampleDispatchRespVO.class); + return CommonResult.success(respVO); + } + + /* + * 执行调拨,传入调拨申请id,将所有明细置为已调拨状态*/ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult execDispatch(BusinessSampleDispatchSaveReqVO paramVo) { + Long id = paramVo.getId(); + String warehouseUser = paramVo.getWarehouseUser(); //库管员 + Long warehouseUserId = paramVo.getWarehouseUserId(); + BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id); + BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO(); + pageReqVO.setParentId(id); + pageReqVO.setPageSize(9999); + List detailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList(); + List detailUpdateList = new ArrayList<>(); + + LocalDateTime borrowTime = LocalDateTime.now(); + List handoverRecordList = new ArrayList<>(); + for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) { + BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO(); + u.setUseStatus("1"); + u.setBorrowStatus("1"); + u.setBorrowUser(entity.getApplyUser()); + u.setBorrowUserId(entity.getApplyUserId()); + u.setBorrowTime(borrowTime); + detailUpdateList.add(u); + //交接记录 + BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO(); + handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId()); + handoverRecord.setSampleCode(detail.getSampleCode()); + handoverRecord.setOperationTime(borrowTime); + handoverRecord.setOperator(warehouseUser); + handoverRecord.setOperatorId(warehouseUserId); + handoverRecord.setSendSampleOperator(warehouseUser); //送样人 + handoverRecord.setReceiveSampleOperator(entity.getApplyUser()); //收样人 + handoverRecordList.add(handoverRecord); + } + businessSampleDispatchDetailService.updateBatch(detailUpdateList); + businessHandoverRecordSubService.insertBatch(handoverRecordList); + entity.setFinishStatus(QmsCommonConstant.COMPLETED); + entity.setWarehouseUser(warehouseUser); + entity.setWarehouseUserId(warehouseUserId); + businessSampleDispatchMapper.updateById(entity); + //更新子样状态 + List subSampleIds = detailList.stream().map(BusinessSampleDispatchDetailExtendRespVO::getBusinessSubSampleId).toList(); + List subSampleList = businessSubSampleService.listByIdList(subSampleIds); + for (BusinessSubSampleDO subSample : subSampleList) { + subSample.setDispatchStatus("1"); + } + businessSubSampleService.updateBatch(subSampleList); + + + + return CommonResult.success("操作成功"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult execGiveback(JSONObject paramVo) { + + String givebackUser = paramVo.getString("givebackUser"); //归还人 + Long givebackUserId = paramVo.getLong("givebackUserId"); + String warehouseUser = paramVo.getString("warehouseUser"); //库管员 + Long warehouseUserId = paramVo.getLong("warehouseUserId"); + String detailIds = paramVo.getString("detailIds"); + List< Long> detailIdList = Arrays.asList(detailIds.split(",")).stream().map(Long::parseLong).toList(); + LocalDateTime givebackTime = LocalDateTime.now(); + BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO(); + pageReqVO.setIdList(detailIdList); + pageReqVO.setPageSize(detailIdList.size() + 999); + List detailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList(); + List detailUpdateList = new ArrayList<>(); + List handoverRecordList = new ArrayList<>(); + for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) { + BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO(); + u.setGivebackUser(givebackUser); + u.setGivebackUserId(givebackUserId); + u.setGivebackTime(givebackTime); + u.setGivebackStatus("1"); + u.setId(detail.getId()); + detailUpdateList.add(u); + + //交接记录 + BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO(); + handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId()); + handoverRecord.setSampleCode(detail.getSampleCode()); + handoverRecord.setOperationTime(givebackTime); + handoverRecord.setOperator(givebackUser); + handoverRecord.setOperatorId(givebackUserId); + handoverRecord.setSendSampleOperator(givebackUser); //送样人 + handoverRecord.setReceiveSampleOperator(warehouseUser); //收样人 + handoverRecordList.add(handoverRecord); + } + businessSampleDispatchDetailService.updateBatch(detailUpdateList); + businessHandoverRecordSubService.insertBatch(handoverRecordList); + //更新子样状态 + List subSampleIds = detailList.stream().map(BusinessSampleDispatchDetailExtendRespVO::getBusinessSubSampleId).toList(); + List subSampleList = businessSubSampleService.listByIdList(subSampleIds); + for (BusinessSubSampleDO subSample : subSampleList) { + subSample.setDispatchStatus("0"); + } + businessSubSampleService.updateBatch(subSampleList); + return CommonResult.success("操作成功"); + } + + @Override + public BusinessSampleDispatchRespVO createBusinessSampleDispatch(BusinessSampleDispatchSaveReqVO createReqVO) { + BusinessSampleDispatchDO businessSampleDispatch = BeanUtils.toBean(createReqVO, BusinessSampleDispatchDO.class); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + if(businessSampleDispatch.getApplyUser() == null){ + businessSampleDispatch.setApplyUser(nickName); + businessSampleDispatch.setApplyUserId(loginUser.getId()); + } + + businessSampleDispatchMapper.insert(businessSampleDispatch); + // 返回 + return BeanUtils.toBean(businessSampleDispatch, BusinessSampleDispatchRespVO.class); + } + + @Override + public void updateBusinessSampleDispatch(BusinessSampleDispatchSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSampleDispatchExists(updateReqVO.getId()); + // 更新 + BusinessSampleDispatchDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSampleDispatchDO.class); + businessSampleDispatchMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSampleDispatch(Long id) { + // 校验存在 + validateBusinessSampleDispatchExists(id); + // 删除 + businessSampleDispatchMapper.deleteById(id); + } + + @Override + public void deleteBusinessSampleDispatchListByIds(List ids) { + // 校验存在 + validateBusinessSampleDispatchExists(ids); + // 删除 + businessSampleDispatchMapper.deleteByIds(ids); + } + + private void validateBusinessSampleDispatchExists(List ids) { + List list = businessSampleDispatchMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS); + } + } + + private void validateBusinessSampleDispatchExists(Long id) { + if (businessSampleDispatchMapper.selectById(id) == null) { + throw exception(BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS); + } + } + + @Override + public BusinessSampleDispatchDO getBusinessSampleDispatch(Long id) { + return businessSampleDispatchMapper.selectById(id); + } + + @Override + public PageResult getBusinessSampleDispatchPage(BusinessSampleDispatchPageReqVO pageReqVO) { + return businessSampleDispatchMapper.selectPage(pageReqVO); + } + + //流程回调 + @Override + public CommonResult callback(QmsBpmDTO reqDTO) { + JSONObject variables = reqDTO.getVariables(); + + //流程状态 1-提交(含退回) 4-取消流程 + String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS); + String mainId = variables.getString("mainId"); + JSONArray fieldExtensions = new JSONArray(); + if(variables.containsKey(QmsBpmConstant.BPM_FIELD_EXTENSIONS)){ + fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS); + } + BusinessSampleDispatchDO entity = getBusinessSampleDispatch(Long.valueOf(mainId)); + log.error("流程回调:{}", JSONObject.toJSONString(reqDTO)); + String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID); + String RETURN_FLAG_PREFIX_KEY = QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY; + String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001"; + + //判断是否最后一个节点 + String lastActivityFlag = "0"; + String firstActivityFlag = "0"; + if(!fieldExtensions.isEmpty()){ + for(int i = 0; i < fieldExtensions.size(); i++){ + JSONObject fieldExtension = fieldExtensions.getJSONObject(i); + if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){ + lastActivityFlag = "1"; + } + if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ + firstActivityFlag = "1"; + } + } + } + + //"RETURN_FLAG_Activity_001": true 标识驳回到发起环节 + if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){ + //驳回。流程需要配置退回到发起节点 + entity.setFlowStatus(QmsCommonConstant.REJECTED); + }else if("4".equals(PROCESS_STATUS)){ + //作废 + entity.setFlowStatus(QmsCommonConstant.VOID); + }else if("1".equals(PROCESS_STATUS)){ + //通过 + if("1".equals(firstActivityFlag)) + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); //驳回后重新提交 + if("1".equals(lastActivityFlag)){ + entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批 + entity.setFinishStatus(QmsCommonConstant.PENDING); + } + } + businessSampleDispatchMapper.updateById(entity); + JSONObject ret = new JSONObject(); + return CommonResult.success(ret); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailService.java index 72e4fa5..f9d5f91 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailService.java @@ -1,13 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.*; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustDetailPageReqVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustDetailRespVO; -import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustDetailSaveReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO; -import com.zt.plat.framework.common.pojo.PageParam; /** * 委检登记样品明细 Service 接口 @@ -53,12 +52,20 @@ public interface BusinessSampleEntrustDetailService { */ BusinessSampleEntrustDetailDO getBusinessSampleEntrustDetail(Long id); + /** + * 获得委检登记样品明细列表 + * + * @param pageReqVO 查询 + * @return 委检登记样品明细列表 + */ + List getBusinessSampleEntrustDetailList(BusinessSampleEntrustDetailReqVO reqVO); + /** * 获得委检登记样品明细分页 * * @param pageReqVO 分页查询 * @return 委检登记样品明细分页 */ - PageResult getBusinessSampleEntrustDetailPage(BusinessSampleEntrustDetailPageReqVO pageReqVO); + PageResult getBusinessSampleEntrustDetailPage(BusinessSampleEntrustDetailPageReqVO pageReqVO); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailServiceImpl.java index b1610d4..d4bec16 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustDetailServiceImpl.java @@ -1,10 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; @@ -83,8 +83,13 @@ public class BusinessSampleEntrustDetailServiceImpl implements BusinessSampleEnt return businessSampleEntrustDetailMapper.selectById(id); } + @Override + public List getBusinessSampleEntrustDetailList(BusinessSampleEntrustDetailReqVO reqVO) { + return businessSampleEntrustDetailMapper.selectList(reqVO); + } + @Override - public PageResult getBusinessSampleEntrustDetailPage(BusinessSampleEntrustDetailPageReqVO pageReqVO) { + public PageResult getBusinessSampleEntrustDetailPage(BusinessSampleEntrustDetailPageReqVO pageReqVO) { return businessSampleEntrustDetailMapper.selectPage(pageReqVO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectService.java index 187464d..444adb7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectServiceImpl.java index 025a77e..78ff94a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustProjectServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustProjectSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java index b97e6e4..ae49327 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationService.java @@ -1,6 +1,11 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -59,4 +64,10 @@ public interface BusinessSampleEntrustRegistrationService { */ PageResult getBusinessSampleEntrustRegistrationPage(BusinessSampleEntrustRegistrationPageReqVO pageReqVO); + /** + * 查询待编制数据*/ + PageResult queryWaitingDataForReport(BusinessSampleEntrustRegistrationPageReqVO pageReqVO); + + + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java index 4dbaf90..c578ea4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleEntrustRegistrationServiceImpl.java @@ -1,10 +1,16 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationSaveReqVO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; @@ -88,4 +94,13 @@ public class BusinessSampleEntrustRegistrationServiceImpl implements BusinessSam return businessSampleEntrustRegistrationMapper.selectPage(pageReqVO); } + //查询待编制数据 + @Override + public PageResult queryWaitingDataForReport(BusinessSampleEntrustRegistrationPageReqVO pageReqVO) { + IPage page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); + pageReqVO.setAssayStatus(QmsCommonConstant.CHECKED); + Page pageList = businessSampleEntrustRegistrationMapper.queryWaitingDataForReport(page, pageReqVO); + PageResult pageResult = new PageResult<>(pageList.getRecords(), pageList.getTotal()); + return BeanUtils.toBean(pageResult, BusinessSampleEntrustRegistrationExtendRespVO.class); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java index 2dbf3c8..b5fcd8e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailService.java @@ -61,4 +61,5 @@ public interface BusinessSampleHandoverDetailService { */ PageResult getBusinessSampleHandoverDetailPage(BusinessSampleHandoverDetailPageReqVO pageReqVO); + void insertBatch(List list); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java index 3b02c5a..5ebc517 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverDetailServiceImpl.java @@ -1,10 +1,13 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; @@ -88,4 +91,9 @@ public class BusinessSampleHandoverDetailServiceImpl implements BusinessSampleHa return businessSampleHandoverDetailMapper.selectPage(pageReqVO); } + @Override + @Transactional(rollbackFor = Exception.class) + public void insertBatch(List list) { + businessSampleHandoverDetailMapper.insertBatch(list); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverService.java index a169f5f..3fe38e9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverService.java @@ -1,10 +1,15 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; +import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.common.pojo.PageParam; /** @@ -51,6 +56,13 @@ public interface BusinessSampleHandoverService { */ BusinessSampleHandoverDO getBusinessSampleHandover(Long id); + /** + * 获取样品交接单报表数据 + * @param id + * @return + */ + JSONObject reportDetail(Long id); + /** * 获得样品交接单业务分页 * @@ -59,4 +71,5 @@ public interface BusinessSampleHandoverService { */ PageResult getBusinessSampleHandoverPage(BusinessSampleHandoverPageReqVO pageReqVO); + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverServiceImpl.java index 3fe41bd..d6e11c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSampleHandoverServiceImpl.java @@ -1,22 +1,27 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.PageParam; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONFactory; +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.fastjson2.JSONWriter; import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverMapper; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; /** @@ -30,6 +35,9 @@ public class BusinessSampleHandoverServiceImpl implements BusinessSampleHandover @Resource private BusinessSampleHandoverMapper businessSampleHandoverMapper; + + @Resource + private BusinessSampleHandoverDetailMapper businessSampleHandoverDetailMapper; @Override public BusinessSampleHandoverRespVO createBusinessSampleHandover(BusinessSampleHandoverSaveReqVO createReqVO) { @@ -83,6 +91,26 @@ public class BusinessSampleHandoverServiceImpl implements BusinessSampleHandover return businessSampleHandoverMapper.selectById(id); } + @Override + public JSONObject reportDetail(Long id) { + JSONWriter.Context context = JSONFactory.createWriteContext(); + context.setDateFormat("yyyy-MM-dd HH:mm:ss"); + + JSONObject result = new JSONObject(); + BusinessSampleHandoverDO businessSampleHandover = businessSampleHandoverMapper.selectById(id); + + String jsonString = JSON.toJSONString(businessSampleHandover, context); + JSONObject businessSampleHandoverJson = JSON.parseObject(jsonString); + JSONArray jsonArray = new JSONArray(); + jsonArray.add(businessSampleHandoverJson); + + List detailList = businessSampleHandoverDetailMapper.selectByBusinessSampleHandoverId(id); + String detailListJsonString = JSON.toJSONString(detailList, context); + result.put("main", jsonArray); + result.put("detail", JSON.parseArray(detailListJsonString)); + return result; + } + @Override public PageResult getBusinessSampleHandoverPage(BusinessSampleHandoverPageReqVO pageReqVO) { return businessSampleHandoverMapper.selectPage(pageReqVO); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectService.java new file mode 100644 index 0000000..c11e67a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 标准样检测项目业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessStandardSampleProjectService { + + /** + * 创建标准样检测项目业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessStandardSampleProjectRespVO createBusinessStandardSampleProject(@Valid BusinessStandardSampleProjectSaveReqVO createReqVO); + + /** + * 更新标准样检测项目业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessStandardSampleProject(@Valid BusinessStandardSampleProjectSaveReqVO updateReqVO); + + /** + * 删除标准样检测项目业务 + * + * @param id 编号 + */ + void deleteBusinessStandardSampleProject(Long id); + + /** + * 批量删除标准样检测项目业务 + * + * @param ids 编号 + */ + void deleteBusinessStandardSampleProjectListByIds(List ids); + + /** + * 获得标准样检测项目业务 + * + * @param id 编号 + * @return 标准样检测项目业务 + */ + BusinessStandardSampleProjectDO getBusinessStandardSampleProject(Long id); + + /** + * 获得标准样检测项目业务分页 + * + * @param pageReqVO 分页查询 + * @return 标准样检测项目业务分页 + */ + PageResult getBusinessStandardSampleProjectPage(BusinessStandardSampleProjectPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectServiceImpl.java new file mode 100644 index 0000000..5b6d2fb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleProjectServiceImpl.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessStandardSampleProjectSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleProjectDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessStandardSampleProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 标准样检测项目业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessStandardSampleProjectServiceImpl implements BusinessStandardSampleProjectService { + + @Resource + private BusinessStandardSampleProjectMapper businessStandardSampleProjectMapper; + + @Override + public BusinessStandardSampleProjectRespVO createBusinessStandardSampleProject(BusinessStandardSampleProjectSaveReqVO createReqVO) { + // 插入 + BusinessStandardSampleProjectDO businessStandardSampleProject = BeanUtils.toBean(createReqVO, BusinessStandardSampleProjectDO.class); + businessStandardSampleProjectMapper.insert(businessStandardSampleProject); + // 返回 + return BeanUtils.toBean(businessStandardSampleProject, BusinessStandardSampleProjectRespVO.class); + } + + @Override + public void updateBusinessStandardSampleProject(BusinessStandardSampleProjectSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessStandardSampleProjectExists(updateReqVO.getId()); + // 更新 + BusinessStandardSampleProjectDO updateObj = BeanUtils.toBean(updateReqVO, BusinessStandardSampleProjectDO.class); + businessStandardSampleProjectMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessStandardSampleProject(Long id) { + // 校验存在 + validateBusinessStandardSampleProjectExists(id); + // 删除 + businessStandardSampleProjectMapper.deleteById(id); + } + + @Override + public void deleteBusinessStandardSampleProjectListByIds(List ids) { + // 校验存在 + validateBusinessStandardSampleProjectExists(ids); + // 删除 + businessStandardSampleProjectMapper.deleteByIds(ids); + } + + private void validateBusinessStandardSampleProjectExists(List ids) { + List list = businessStandardSampleProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_STANDARD_SAMPLE_PROJECT_NOT_EXISTS); + } + } + + private void validateBusinessStandardSampleProjectExists(Long id) { + if (businessStandardSampleProjectMapper.selectById(id) == null) { + throw exception(BUSINESS_STANDARD_SAMPLE_PROJECT_NOT_EXISTS); + } + } + + @Override + public BusinessStandardSampleProjectDO getBusinessStandardSampleProject(Long id) { + return businessStandardSampleProjectMapper.selectById(id); + } + + @Override + public PageResult getBusinessStandardSampleProjectPage(BusinessStandardSampleProjectPageReqVO pageReqVO) { + return businessStandardSampleProjectMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleService.java new file mode 100644 index 0000000..220c167 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleService.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 标准样业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessStandardSampleService { + + /** + * 创建标准样业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessStandardSampleRespVO createBusinessStandardSample(@Valid BusinessStandardSampleSaveReqVO createReqVO); + + /** + * 更新标准样业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessStandardSample(@Valid BusinessStandardSampleSaveReqVO updateReqVO); + + /** + * 删除标准样业务 + * + * @param id 编号 + */ + void deleteBusinessStandardSample(Long id); + + /** + * 批量删除标准样业务 + * + * @param ids 编号 + */ + void deleteBusinessStandardSampleListByIds(List ids); + + /** + * 获得标准样业务 + * + * @param id 编号 + * @return 标准样业务 + */ + BusinessStandardSampleDO getBusinessStandardSample(Long id); + + /** + * 获得标准样业务分页 + * + * @param pageReqVO 分页查询 + * @return 标准样业务分页 + */ + PageResult getBusinessStandardSamplePage(BusinessStandardSamplePageReqVO pageReqVO); + + //List getBusinessStandardSampleByConfigQCSampleMethodId(Long configQCSampleMethodId); + + List getBusinessStandardSampleLeafList(); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleServiceImpl.java new file mode 100644 index 0000000..7219fe5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessStandardSampleServiceImpl.java @@ -0,0 +1,101 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; + +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessStandardSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessStandardSampleMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 标准样业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessStandardSampleServiceImpl implements BusinessStandardSampleService { + + @Resource + private BusinessStandardSampleMapper businessStandardSampleMapper; + + @Override + public BusinessStandardSampleRespVO createBusinessStandardSample(BusinessStandardSampleSaveReqVO createReqVO) { + // 插入 + BusinessStandardSampleDO businessStandardSample = BeanUtils.toBean(createReqVO, BusinessStandardSampleDO.class); + businessStandardSampleMapper.insert(businessStandardSample); + // 返回 + return BeanUtils.toBean(businessStandardSample, BusinessStandardSampleRespVO.class); + } + + @Override + public void updateBusinessStandardSample(BusinessStandardSampleSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessStandardSampleExists(updateReqVO.getId()); + // 更新 + BusinessStandardSampleDO updateObj = BeanUtils.toBean(updateReqVO, BusinessStandardSampleDO.class); + businessStandardSampleMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessStandardSample(Long id) { + // 校验存在 + validateBusinessStandardSampleExists(id); + // 删除 + businessStandardSampleMapper.deleteById(id); + } + + @Override + public void deleteBusinessStandardSampleListByIds(List ids) { + // 校验存在 + validateBusinessStandardSampleExists(ids); + // 删除 + businessStandardSampleMapper.deleteByIds(ids); + } + + private void validateBusinessStandardSampleExists(List ids) { + List list = businessStandardSampleMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_STANDARD_SAMPLE_NOT_EXISTS); + } + } + + private void validateBusinessStandardSampleExists(Long id) { + if (businessStandardSampleMapper.selectById(id) == null) { + throw exception(BUSINESS_STANDARD_SAMPLE_NOT_EXISTS); + } + } + + @Override + public BusinessStandardSampleDO getBusinessStandardSample(Long id) { + return businessStandardSampleMapper.selectById(id); + } + + @Override + public PageResult getBusinessStandardSamplePage(BusinessStandardSamplePageReqVO pageReqVO) { + return businessStandardSampleMapper.selectPage(pageReqVO); + } + +// @Override +// public List getBusinessStandardSampleByConfigQCSampleMethodId(Long configQCSampleMethodId) { +// return businessStandardSampleMapper.selectByConfigQCSampleMethodId(configQCSampleMethodId); +// } + + @Override + public List getBusinessStandardSampleLeafList() { + return businessStandardSampleMapper.getBusinessStandardSampleLeafList(); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentService.java new file mode 100644 index 0000000..01fbed2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 班组判定数据业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSubParentSampleAssessmentService { + + /** + * 创建班组判定数据业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubParentSampleAssessmentRespVO createBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentSaveReqVO createReqVO); + + /** + * 更新班组判定数据业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentSaveReqVO updateReqVO); + + /** + * 删除班组判定数据业务 + * + * @param id 编号 + */ + void deleteBusinessSubParentSampleAssessment(Long id); + + /** + * 批量删除班组判定数据业务 + * + * @param ids 编号 + */ + void deleteBusinessSubParentSampleAssessmentListByIds(List ids); + + /** + * 获得班组判定数据业务 + * + * @param id 编号 + * @return 班组判定数据业务 + */ + BusinessSubParentSampleAssessmentDO getBusinessSubParentSampleAssessment(Long id); + + /** + * 获得班组判定数据业务分页 + * + * @param pageReqVO 分页查询 + * @return 班组判定数据业务分页 + */ + PageResult getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java new file mode 100644 index 0000000..620fdbf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleAssessmentServiceImpl.java @@ -0,0 +1,86 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 班组判定数据业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSubParentSampleAssessmentServiceImpl implements BusinessSubParentSampleAssessmentService { + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + + @Override + public BusinessSubParentSampleAssessmentRespVO createBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentSaveReqVO createReqVO) { + // 插入 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessment = BeanUtils.toBean(createReqVO, BusinessSubParentSampleAssessmentDO.class); + businessSubParentSampleAssessmentMapper.insert(businessSubParentSampleAssessment); + // 返回 + return BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentRespVO.class); + } + + @Override + public void updateBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(updateReqVO.getId()); + // 更新 + BusinessSubParentSampleAssessmentDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubParentSampleAssessmentDO.class); + businessSubParentSampleAssessmentMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubParentSampleAssessment(Long id) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(id); + // 删除 + businessSubParentSampleAssessmentMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubParentSampleAssessmentListByIds(List ids) { + // 校验存在 + validateBusinessSubParentSampleAssessmentExists(ids); + // 删除 + businessSubParentSampleAssessmentMapper.deleteByIds(ids); + } + + private void validateBusinessSubParentSampleAssessmentExists(List ids) { + List list = businessSubParentSampleAssessmentMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS); + } + } + + private void validateBusinessSubParentSampleAssessmentExists(Long id) { + if (businessSubParentSampleAssessmentMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS); + } + } + + @Override + public BusinessSubParentSampleAssessmentDO getBusinessSubParentSampleAssessment(Long id) { + return businessSubParentSampleAssessmentMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentPageReqVO pageReqVO) { + return businessSubParentSampleAssessmentMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleService.java index 1978c50..f06e2c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleServiceImpl.java index 6053205..cab9420 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubParentSampleServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupService.java new file mode 100644 index 0000000..bdd4505 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 子样分析班组业务 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSubSampleAnalysisGroupService { + + /** + * 创建子样分析班组业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubSampleAnalysisGroupRespVO createBusinessSubSampleAnalysisGroup(@Valid BusinessSubSampleAnalysisGroupSaveReqVO createReqVO); + + /** + * 更新子样分析班组业务 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubSampleAnalysisGroup(@Valid BusinessSubSampleAnalysisGroupSaveReqVO updateReqVO); + + /** + * 删除子样分析班组业务 + * + * @param id 编号 + */ + void deleteBusinessSubSampleAnalysisGroup(Long id); + + /** + * 批量删除子样分析班组业务 + * + * @param ids 编号 + */ + void deleteBusinessSubSampleAnalysisGroupListByIds(List ids); + + /** + * 获得子样分析班组业务 + * + * @param id 编号 + * @return 子样分析班组业务 + */ + BusinessSubSampleAnalysisGroupDO getBusinessSubSampleAnalysisGroup(Long id); + + /** + * 获得子样分析班组业务分页 + * + * @param pageReqVO 分页查询 + * @return 子样分析班组业务分页 + */ + PageResult getBusinessSubSampleAnalysisGroupPage(BusinessSubSampleAnalysisGroupPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupServiceImpl.java new file mode 100644 index 0000000..fff47a2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAnalysisGroupServiceImpl.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAnalysisGroupSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 子样分析班组业务 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSubSampleAnalysisGroupServiceImpl implements BusinessSubSampleAnalysisGroupService { + + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + + @Override + public BusinessSubSampleAnalysisGroupRespVO createBusinessSubSampleAnalysisGroup(BusinessSubSampleAnalysisGroupSaveReqVO createReqVO) { + // 插入 + BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroup = BeanUtils.toBean(createReqVO, BusinessSubSampleAnalysisGroupDO.class); + businessSubSampleAnalysisGroupMapper.insert(businessSubSampleAnalysisGroup); + // 返回 + return BeanUtils.toBean(businessSubSampleAnalysisGroup, BusinessSubSampleAnalysisGroupRespVO.class); + } + + @Override + public void updateBusinessSubSampleAnalysisGroup(BusinessSubSampleAnalysisGroupSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubSampleAnalysisGroupExists(updateReqVO.getId()); + // 更新 + BusinessSubSampleAnalysisGroupDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleAnalysisGroupDO.class); + businessSubSampleAnalysisGroupMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubSampleAnalysisGroup(Long id) { + // 校验存在 + validateBusinessSubSampleAnalysisGroupExists(id); + // 删除 + businessSubSampleAnalysisGroupMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubSampleAnalysisGroupListByIds(List ids) { + // 校验存在 + validateBusinessSubSampleAnalysisGroupExists(ids); + // 删除 + businessSubSampleAnalysisGroupMapper.deleteByIds(ids); + } + + private void validateBusinessSubSampleAnalysisGroupExists(List ids) { + List list = businessSubSampleAnalysisGroupMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_SAMPLE_ANALYSIS_GROUP_NOT_EXISTS); + } + } + + private void validateBusinessSubSampleAnalysisGroupExists(Long id) { + if (businessSubSampleAnalysisGroupMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_SAMPLE_ANALYSIS_GROUP_NOT_EXISTS); + } + } + + @Override + public BusinessSubSampleAnalysisGroupDO getBusinessSubSampleAnalysisGroup(Long id) { + return businessSubSampleAnalysisGroupMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubSampleAnalysisGroupPage(BusinessSubSampleAnalysisGroupPageReqVO pageReqVO) { + return businessSubSampleAnalysisGroupMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java index 5e595bb..87a91ce 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java index d60d4be..6460f6d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleAssessmentServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.module.qms.business.bus.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java new file mode 100644 index 0000000..65d0a63 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 分样复检业务数据 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessSubSampleParentRecheckService { + + /** + * 创建分样复检业务数据 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO createReqVO); + + /** + * 更新分样复检业务数据 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO updateReqVO); + + /** + * 删除分样复检业务数据 + * + * @param id 编号 + */ + void deleteBusinessSubSampleParentRecheck(Long id); + + /** + * 批量删除分样复检业务数据 + * + * @param ids 编号 + */ + void deleteBusinessSubSampleParentRecheckListByIds(List ids); + + /** + * 获得分样复检业务数据 + * + * @param id 编号 + * @return 分样复检业务数据 + */ + BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id); + + /** + * 获得分样复检业务数据分页 + * + * @param pageReqVO 分页查询 + * @return 分样复检业务数据分页 + */ + PageResult getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java new file mode 100644 index 0000000..236d7e8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleParentRecheckServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 分样复检业务数据 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessSubSampleParentRecheckServiceImpl implements BusinessSubSampleParentRecheckService { + + @Resource + private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper; + + @Override + public BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO createReqVO) { + // 插入 + BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = BeanUtils.toBean(createReqVO, BusinessSubSampleParentRecheckDO.class); + businessSubSampleParentRecheckMapper.insert(businessSubSampleParentRecheck); + // 返回 + return BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class); + } + + @Override + public void updateBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessSubSampleParentRecheckExists(updateReqVO.getId()); + // 更新 + BusinessSubSampleParentRecheckDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleParentRecheckDO.class); + businessSubSampleParentRecheckMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessSubSampleParentRecheck(Long id) { + // 校验存在 + validateBusinessSubSampleParentRecheckExists(id); + // 删除 + businessSubSampleParentRecheckMapper.deleteById(id); + } + + @Override + public void deleteBusinessSubSampleParentRecheckListByIds(List ids) { + // 校验存在 + validateBusinessSubSampleParentRecheckExists(ids); + // 删除 + businessSubSampleParentRecheckMapper.deleteByIds(ids); + } + + private void validateBusinessSubSampleParentRecheckExists(List ids) { + List list = businessSubSampleParentRecheckMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS); + } + } + + private void validateBusinessSubSampleParentRecheckExists(Long id) { + if (businessSubSampleParentRecheckMapper.selectById(id) == null) { + throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS); + } + } + + @Override + public BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id) { + return businessSubSampleParentRecheckMapper.selectById(id); + } + + @Override + public PageResult getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO) { + return businessSubSampleParentRecheckMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java index 6564d27..c7970ca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleService.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.*; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.*; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.bus.controller.vo.*; @@ -14,6 +17,9 @@ import com.zt.plat.framework.common.pojo.PageParam; */ public interface BusinessSubSampleService { + void updateBatch(List businessSubSampleDOList); + + List listByIdList(List idList); /** * 创建子样业务 * @@ -49,7 +55,9 @@ public interface BusinessSubSampleService { * @param id 编号 * @return 子样业务 */ - BusinessSubSampleDO getBusinessSubSample(Long id); + BusinessSubSampleExtendRespVO getBusinessSubSample(Long id); + + BusinessSubSampleDO getBySampleCode(String sampleCode); /** * 获得子样业务分页 @@ -73,4 +81,12 @@ public interface BusinessSubSampleService { */ BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(@Valid BusinessSubSampleReqVO reqVO); + //样品归库 + BusinessSubSampleRespVO execReturnToStock(@Valid BusinessSubSampleSaveReqVO reqVo); + + //样品下架 + Integer execTakeOff(JSONObject reqVo); + + //库位变更 + Integer execChangeLocation(JSONObject reqVo); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java index 7d3272a..ed14947 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessSubSampleServiceImpl.java @@ -1,24 +1,40 @@ package com.zt.plat.module.qms.business.bus.service; import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; +import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import jakarta.validation.Valid; -import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; +import java.time.LocalDateTime; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.enums.QmsCommonConstant; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; /** @@ -32,6 +48,27 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { @Resource private BusinessSubSampleMapper businessSubSampleMapper; + + @Resource + private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper; + + @Resource private ConfigWarehouseLocationService configWarehouseLocationService; + @Resource private BusinessSampleHandoverService businessSampleHandoverService; + @Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService; + @Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService; + @Resource private DictionaryBusinessService dictionaryBusinessService; + @Resource private SequenceUtil sequenceUtil; + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateBatch(List businessSubSampleDOList) { + businessSubSampleMapper.updateBatch(businessSubSampleDOList); + } + + @Override + public List listByIdList(List idList) { + return businessSubSampleMapper.selectByIds(idList); + } @Override public BusinessSubSampleRespVO createBusinessSubSample(BusinessSubSampleSaveReqVO createReqVO) { @@ -81,18 +118,29 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { } @Override - public BusinessSubSampleDO getBusinessSubSample(Long id) { - return businessSubSampleMapper.selectById(id); + public BusinessSubSampleExtendRespVO getBusinessSubSample(Long id) { + return businessSubSampleMapper.selectExtendById(id); + } + + @Override + public BusinessSubSampleDO getBySampleCode(String sampleCode) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BusinessSubSampleDO::getSampleCode, sampleCode); + return businessSubSampleMapper.selectOne(queryWrapper); } @Override public PageResult getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) { - return businessSubSampleMapper.selectPage(pageReqVO); + PageResult page = businessSubSampleMapper.selectPage(pageReqVO); + if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(pageReqVO.getSampleFlowNodeKey())) {//如果是班组收样 + + } + return page; } @Override public List getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO) { - return businessSubSampleMapper.selectlist(reqVO); + return businessSubSampleMapper.selectList(reqVO); } @Override @@ -100,4 +148,174 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService { return businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO); } + //样品归库 + @Override + @Transactional(rollbackFor = Exception.class) + public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); + BusinessSubSampleDO businessSubSampleDO = this.getBySampleCode(reqVo.getSampleCode()); + if(businessSubSampleDO == null) + throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS); + //检查样品状态 + if(!QmsCommonConstant.FLOW_SAMPLE_STORAGE.equals(businessSubSampleDO.getSampleFlowNodeKey())) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "子样任务不在“归库”环节,请检查前置任务是否已完成!"); + if(QmsCommonConstant.COMPLETED.equals(businessSubSampleDO.getReturnStatus())) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已归库,请勿重复操作!"); + + ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + if(locationDO == null) + throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + + //更新入库状态 + businessSubSampleDO.setReturnStatus(QmsCommonConstant.COMPLETED); + businessSubSampleDO.setConfigWarehouseLocationInfomationId(locationDO.getId()); + businessSubSampleDO.setReturnTime(LocalDateTime.now()); + businessSubSampleMapper.updateById(businessSubSampleDO); + + //更新流转记录 T_BSN_HND_RCD_SB。这不记录送样人、收样人。在调拨和归还时需要记录 + BusinessHandoverRecordSubSaveReqVO recordSubVO = new BusinessHandoverRecordSubSaveReqVO(); + recordSubVO.setBusinessSubSampleId(businessSubSampleDO.getId()); + recordSubVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); + recordSubVO.setSampleCode(businessSubSampleDO.getSampleReturnCode()); + recordSubVO.setOperationTime(LocalDateTime.now()); + recordSubVO.setOperator(loginUserName); + recordSubVO.setOperatorId(loginUser.getId()); + recordSubVO.setSendSampleOperator(""); + recordSubVO.setReceiveSampleOperator(""); + recordSubVO.setConfigSampleFlowId(0L); + businessHandoverRecordSubService.createBusinessHandoverRecordSub(recordSubVO); + /* + * 样品编码用归库码 + * 这里不更新交接人。 调拨和归还时记录交接人 + * + * */ + + return BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleRespVO.class); + } + + //样品下架 + @Override + @Transactional(rollbackFor = Exception.class) + public Integer execTakeOff(JSONObject reqVo) { + String actionWay = reqVo.getString("actionWay"); + String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); + String sampleCode = reqVo.getString("sampleCode"); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); + //查询要操作的样品 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE); + queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED); + if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){ + //按编号查询样品 + if(ObjectUtils.isEmpty(sampleCode)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!"); + List sampleCodes = Arrays.asList(sampleCode.split( ",")); + queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes); + } + else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){ + //按库位查询样品 + if(ObjectUtils.isEmpty(warehouseLocationCode)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少库位编码参数!"); + ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + if(locationDO == null) + throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode); + }else{ + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!"); + } + List waitingList = businessSubSampleMapper.selectList(queryWrapper); + if(waitingList.isEmpty()) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "无待下架的样品!"); + Integer sampleCount = waitingList.size(); + + //创建交接抬头 + BusinessSampleHandoverSaveReqVO handoverVO = new BusinessSampleHandoverSaveReqVO(); + String codeTemplate = dictionaryBusinessService.getValueByDataKey("sample_take_off_serial"); + if(ObjectUtils.isEmpty(codeTemplate)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少“样品下架记录编号规则”的配置,请在业务参数字典增加此配置!"); + String code = sequenceUtil.genCode(codeTemplate); + handoverVO.setCode(code); + handoverVO.setName("样品下架记录"); + handoverVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); + handoverVO.setOperationTime(LocalDateTime.now()); + handoverVO.setOperator(loginUserName); + handoverVO.setOperatorId(loginUser.getId()); + BusinessSampleHandoverRespVO handoverRespVO = businessSampleHandoverService.createBusinessSampleHandover(handoverVO); + + //更新下架状态 + List recordList = new ArrayList<>(); + List detailList = new ArrayList<>(); //通过样品交接明细记录下架记录 + for(BusinessSubSampleDO businessSubSampleDO : waitingList){ + businessSubSampleDO.setReturnStatus(QmsCommonConstant.TAKEN_OFF); + //创建流转记录 + BusinessHandoverRecordSubDO reecordDO = new BusinessHandoverRecordSubDO(); + reecordDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + reecordDO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE); + reecordDO.setSampleCode(businessSubSampleDO.getSampleReturnCode()); + reecordDO.setOperationTime(LocalDateTime.now()); + reecordDO.setOperator(loginUserName); + reecordDO.setOperatorId(loginUser.getId()); + reecordDO.setSendSampleOperator(""); + reecordDO.setReceiveSampleOperator(""); + reecordDO.setConfigSampleFlowId(0L); + recordList.add(reecordDO); + + + BusinessSampleHandoverDetailDO detailDO = new BusinessSampleHandoverDetailDO(); + detailDO.setBusinessSampleHandoverId(handoverRespVO.getId()); + detailDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + detailDO.setSampleName(businessSubSampleDO.getSampleName()); + detailDO.setSampleCode(businessSubSampleDO.getSampleReturnCode()); + detailList.add(detailDO); + } + businessHandoverRecordSubService.insertBatch(recordList); + businessSampleHandoverDetailService.insertBatch(detailList); + businessSubSampleMapper.updateBatch(waitingList); + return sampleCount; + } + + //库位变更 + @Override + public Integer execChangeLocation(JSONObject reqVo) { + String actionWay = reqVo.getString("actionWay"); + String targetLocation = reqVo.getString("targetLocation"); + String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); + String sampleCode = reqVo.getString("sampleCode"); + if(ObjectUtils.isEmpty(targetLocation)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!"); + ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + //查询要操作的样品 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE); + queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED); + if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){ + //按编号查询样品 + if(ObjectUtils.isEmpty(sampleCode)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!"); + List sampleCodes = Arrays.asList(sampleCode.split( ",")); + queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes); + } + else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){ + //按库位查询样品 + if(ObjectUtils.isEmpty(warehouseLocationCode)) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少库位编码参数!"); + ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); + if(locationDO == null) + throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode); + }else{ + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!"); + } + List waitingList = businessSubSampleMapper.selectList(queryWrapper); + if(waitingList.isEmpty()) + throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "没有找到样品!"); + Integer sampleCount = waitingList.size(); + for(BusinessSubSampleDO businessSubSampleDO : waitingList){ + businessSubSampleDO.setConfigWarehouseLocationInfomationId(targetLocationDO.getId()); + } + businessSubSampleMapper.updateBatch(waitingList); + return sampleCount; + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java new file mode 100644 index 0000000..c553c49 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; + +/** + * 荧光采集记录 Service 接口 + * + * @author 后台管理 + */ +public interface BusinessXRFDataService { + + /** + * 创建荧光采集记录 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + BusinessXRFDataRespVO createBusinessXRFData(@Valid BusinessXRFDataSaveReqVO createReqVO); + + /** + * 更新荧光采集记录 + * + * @param updateReqVO 更新信息 + */ + void updateBusinessXRFData(@Valid BusinessXRFDataSaveReqVO updateReqVO); + + /** + * 删除荧光采集记录 + * + * @param id 编号 + */ + void deleteBusinessXRFData(Long id); + + /** + * 批量删除荧光采集记录 + * + * @param ids 编号 + */ + void deleteBusinessXRFDataListByIds(List ids); + + /** + * 获得荧光采集记录 + * + * @param id 编号 + * @return 荧光采集记录 + */ + BusinessXRFDataDO getBusinessXRFData(Long id); + + /** + * 获得荧光采集记录分页 + * + * @param pageReqVO 分页查询 + * @return 荧光采集记录分页 + */ + PageResult getBusinessXRFDataPage(BusinessXRFDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java new file mode 100644 index 0000000..1077ba3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/BusinessXRFDataServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光采集记录 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class BusinessXRFDataServiceImpl implements BusinessXRFDataService { + + @Resource + private BusinessXRFDataMapper businessXRFDataMapper; + + @Override + public BusinessXRFDataRespVO createBusinessXRFData(BusinessXRFDataSaveReqVO createReqVO) { + // 插入 + BusinessXRFDataDO businessXRFData = BeanUtils.toBean(createReqVO, BusinessXRFDataDO.class); + businessXRFDataMapper.insert(businessXRFData); + // 返回 + return BeanUtils.toBean(businessXRFData, BusinessXRFDataRespVO.class); + } + + @Override + public void updateBusinessXRFData(BusinessXRFDataSaveReqVO updateReqVO) { + // 校验存在 + validateBusinessXRFDataExists(updateReqVO.getId()); + // 更新 + BusinessXRFDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessXRFDataDO.class); + businessXRFDataMapper.updateById(updateObj); + } + + @Override + public void deleteBusinessXRFData(Long id) { + // 校验存在 + validateBusinessXRFDataExists(id); + // 删除 + businessXRFDataMapper.deleteById(id); + } + + @Override + public void deleteBusinessXRFDataListByIds(List ids) { + // 校验存在 + validateBusinessXRFDataExists(ids); + // 删除 + businessXRFDataMapper.deleteByIds(ids); + } + + private void validateBusinessXRFDataExists(List ids) { + List list = businessXRFDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(BUSINESS_XRF_DATA_NOT_EXISTS); + } + } + + private void validateBusinessXRFDataExists(Long id) { + if (businessXRFDataMapper.selectById(id) == null) { + throw exception(BUSINESS_XRF_DATA_NOT_EXISTS); + } + } + + @Override + public BusinessXRFDataDO getBusinessXRFData(Long id) { + return businessXRFDataMapper.selectById(id); + } + + @Override + public PageResult getBusinessXRFDataPage(BusinessXRFDataPageReqVO pageReqVO) { + return businessXRFDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java new file mode 100644 index 0000000..2b94cbe --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java @@ -0,0 +1,38 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.List; + +import com.alibaba.fastjson2.JSONObject; + +/** + * SampleAnalysisAuditService + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月29日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月29日 + */ +public interface SampleAnalysisAuditService { + + JSONObject crossAuditByTaskId(Long businessAssayTaskId); + + void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus); + + JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus); + + JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId); + + JSONObject getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId); + + void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId); + + void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId); + + JSONObject modifyParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId, Long businessSubSampleAssessmentId, List businessAssayProjectDataIds); + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java new file mode 100644 index 0000000..47c4099 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -0,0 +1,1044 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONFactory; +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.fastjson2.JSONWriter; +import com.alibaba.nacos.shaded.io.grpc.Attributes.Key; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.ql.util.express.DefaultContext; +import com.ql.util.express.ExpressRunner; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportFieldMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTypeMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigRuleMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMethodMapper; +import com.zt.plat.module.qms.core.qlexpress.cmp.AllowanceCalculatorComponent; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.bean.BeanUtil; +import jakarta.annotation.Resource; + +/** + * SampleAnalysisAuditServiceImpl + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月29日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月29日 + */ +@Service +public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditService { + + @Resource + private ExpressRunner expressRunner; + + @Resource + private AllowanceCalculatorComponent allowanceCalculatorComponent; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + + @Resource + private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper; + +// @Resource +// private BusinessTeamAssessmentMapper businessTeamAssessmentMapper; + + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + @Resource + private ConfigSubSampleMethodMapper configSubSampleMethodMapper; + + @Override + public JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String assessmentStatus) { + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + List> columnList = new ArrayList<>(); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectDOList) { + columnList.add(new HashMap() { + private static final long serialVersionUID = 2100402322138923549L; + + { + put("title", configAssayMethodProject.getShowName() + "(" + configAssayMethodProject.getDictionaryProjectUnit() + ")"); + put("field", configAssayMethodProject.getSimpleName()); + put("dataType", configAssayMethodProject.getDataType()); + put("decimalPosition", configAssayMethodProject.getDecimalPosition()); + put("isEdit", true); + }}); + } + + List> dataList = new ArrayList<>(); + BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); + search.setConfigAssayMethodId(configAssayMethodId); + List resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search); + + for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) { + Map businessAssayTaskDataMap = BeanUtil.beanToMap(businessAssayTaskDataExtendRespVO); + Map businessAssayTaskDataAssessmentMap = BeanUtil.copyProperties(businessAssayTaskDataMap, Map.class); + businessAssayTaskDataAssessmentMap.put("assayOperator", "判定结果"); + businessAssayTaskDataAssessmentMap.put("reportTime", null); + businessAssayTaskDataAssessmentMap.put("assessmentStatus", QmsCommonConstant.IN_PROGRESS); + + //查询是否已添加过判定记录 + Map assessmentMap = dataList.stream().filter(f -> + Objects.equals(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), f.get("businessSubSampleId")) && + Objects.equals(businessAssayTaskDataExtendRespVO.getConfigAssayMethodId(), f.get("configAssayMethodId")) && + "判定结果".equals(f.get("assayOperator")) + ).findFirst().orElse(null); + //为空则未添加过判定记录 + if (assessmentMap == null) { + if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataExtendRespVO.getAssayType())) {//平行 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId); + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + businessAssayTaskDataAssessmentMap.put("id", businessSubSampleAssessment.getId()); + businessAssayTaskDataAssessmentMap.put("assessmentStatus", businessSubSampleAssessment.getAssessmentStatus()); + businessAssayTaskDataAssessmentMap.put("assessmentStatus_" + businessSubSampleAssessment.getSimpleName(), businessSubSampleAssessment.getAssessmentStatus()); + businessAssayTaskDataAssessmentMap.put(businessSubSampleAssessment.getSimpleName(), businessSubSampleAssessment.getAssessmentValue()); + businessAssayTaskDataAssessmentMap.put("assessmentValue", businessSubSampleAssessment.getAssessmentValue()); + } + } else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessAssayTaskDataExtendRespVO.getAssayType())) {//双杯 + //businessTeamAssessmentMapper.selectBy + } + dataList.add(businessAssayTaskDataAssessmentMap); + //赋值 + assessmentMap = businessAssayTaskDataAssessmentMap; + } + + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataExtendRespVO.getId()); + for (BusinessAssayProjectDataExtendRespVO businessAssayProjectData : businessAssayProjectDataList) { + businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), businessAssayProjectData.getValue()); + businessAssayTaskDataMap.put("isNotAssessment_" + businessAssayProjectData.getSimpleName(), businessAssayProjectData.getIsNotAssessment()); + //添加判定状态 + businessAssayTaskDataMap.put("assessmentStatus", assessmentMap.get("assessmentStatus")); + + } + dataList.add(businessAssayTaskDataMap); + + } + + if (StringUtils.isNotBlank(assessmentStatus)) { + dataList = dataList.stream().filter(f -> assessmentStatus.equals(f.get("assessmentStatus"))).collect(Collectors.toList()); + } + + + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + return json; + } + + @Override + public JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId) { + List> columnList = new ArrayList<>(); + List> dataList = new ArrayList<>(); + + //查询子样平行分析结果 + BusinessAssayProjectDataReqVO search = new BusinessAssayProjectDataReqVO(); + search.setBusinessSubSampleId(businessSubSampleId); + search.setConfigAssayMethodId(configAssayMethodId); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectAnalysisBy(search); + + //已检测项目分组,取第一个 + Map> businessAssayProjectDataMap = businessAssayProjectDataList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataExtendRespVO::getConfigAssayMethodProjectId)); + for (Map.Entry> businessAssayProjectDataEntry : businessAssayProjectDataMap.entrySet()) { + //单个检测项目的分析结果 + List businessAssayProjectDataSingleList = businessAssayProjectDataEntry.getValue(); + for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtendRespVO : businessAssayProjectDataSingleList) {//每个检测结果作为一个动态列 + columnList.add(new HashMap() { + private static final long serialVersionUID = -1844858000003248901L; + + { + put("title", businessAssayProjectDataExtendRespVO.getSampleAssayCode() + "(" + businessAssayProjectDataExtendRespVO.getAssayOperator() + ")"); + put("field", businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getAnalysisCount()); + }}); + } + + //取第一个后跳出循环 + break; + } + + //查询判定值 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + Map businessSubSampleAssessmentMap = BeanUtil.beanToMap(businessSubSampleAssessment); + List businessAssayProjectDataSingleList = businessAssayProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubSampleAssessment.getDictionaryProjectId())).collect(Collectors.toList()); + for (BusinessAssayProjectDataExtendRespVO businessAssayProjectDataExtendRespVO : businessAssayProjectDataSingleList) { + businessSubSampleAssessmentMap.put(businessAssayProjectDataExtendRespVO.getBusinessAssayTaskDataId() + ";" + businessAssayProjectDataExtendRespVO.getBusinessSubSampleId() + ";" + businessAssayProjectDataExtendRespVO.getAnalysisCount(), businessAssayProjectDataExtendRespVO.getValue()); + } + dataList.add(businessSubSampleAssessmentMap); + } + + + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + json.put("subDatas", businessAssayProjectDataList); + return json; + } + + @Override + public JSONObject getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId) { + // TODO Auto-generated method stub + return null; + } + + @Override + public JSONObject crossAuditByTaskId(Long businessAssayTaskId) { + JSONWriter.Context context = JSONFactory.createWriteContext(); + context.setDateFormat("yyyy-MM-dd HH:mm:ss"); + + JSONObject resultJsonObject = new JSONObject(); + + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + if (businessAssayTaskDO == null) { + throw new ServiceException(1_032_100_000, "未找到任务分配单"); + } + String formValue = businessAssayTaskDO.getFormValue(); + JSONObject formValueJsonObject = JSON.parseObject(formValue); + + String jsonString = JSON.toJSONString(businessAssayTaskDO, context); + JSONObject businessAssayTaskJson = JSON.parseObject(jsonString); + formValueJsonObject.forEach((key, value) -> { + businessAssayTaskJson.put(key, value); + }); + JSONArray jsonArray = new JSONArray(); + jsonArray.add(businessAssayTaskJson); + resultJsonObject.put("businessAssayTask", jsonArray); + + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); +// BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + //处理数据 + List> datas = new ArrayList<>(); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getSampleId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null); + + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); + map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); + map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); + map.put("analysisType", "analysis"); + + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { +// map.put("e" + ep.getDicId(), ep); + map.put(ep.getName(), ep.getValue()); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { +// map.put("p" + p.getDicId(), p); + map.put(p.getName(), p.getValue()); + } + } + + } + datas.add(map); + } + + List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + + for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCManagementData.getId()); + map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCManagementData.getSampleCode()); + map.put("sampleName", businessQCManagementData.getSampleName()); + map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey()); + + BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); + projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); + List projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { +// map.put("e" + ep.getDicId(), ep); + map.put(ep.getName(), ep.getValue()); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); + parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); + List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { +// map.put("p" + p.getDicId(), p); + map.put(p.getName(), p.getValue()); + } + } + + } + datas.add(map); + } + + List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCCoefficientData.getId()); + map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCCoefficientData.getSampleCode()); + map.put("sampleName", businessQCCoefficientData.getSampleName()); + map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey()); + + BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO(); + parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId()); + List plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2); + for (BusinessAssayProjectAndParameterRespVO p : plist2) { +// map.put("p" + p.getDicId(), p); + map.put(p.getName(), p.getValue()); + } + datas.add(map); + } + +// resultJsonObject.put("all", datas); +// Map>> map = datas.stream().collect(Collectors.groupingBy(g -> (String) g.get("analysisType"))); +// for (Map.Entry>> entry : map.entrySet()) { +// resultJsonObject.put(entry.getKey(), entry.getValue()); +// } + + List> fxList = datas.stream().filter(f -> "analysis".equals(f.get("analysisType")) || "zky".equals(f.get("analysisType")) || "kby".equals(f.get("analysisType")) ).collect(Collectors.toList()); + resultJsonObject.put("fx", fxList); + List> byList = datas.stream().filter(f -> "by".equals(f.get("analysisType"))).collect(Collectors.toList()); + resultJsonObject.put("by", byList); + return resultJsonObject; + } + + @Override + public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) { + + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + + //判定记录 + List saveBusinessSubSampleAssessmentDOList = new ArrayList<>(); + List updateBusinessSubSampleAssessmentDOList = new ArrayList<>(); + + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + if (QmsCommonConstant.APPROVE.equals(auditStatus)) { + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.APPROVED); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.APPROVED); + businessAssayTaskDO.setReportTime(LocalDateTime.now()); + businessAssayTaskDO.setReportOperator(SecurityFrameworkUtils.getLoginUserNickname()); + + //查询分析任务明细 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessAssayTaskId(businessAssayTaskId); + //根据子样分组 + Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); + //循环分组 + for (Map.Entry> businessAssayTaskDataDOMapEntry : businessAssayTaskDataDOMap.entrySet()) { + + Long businessSubSampleId = businessAssayTaskDataDOMapEntry.getKey(); + List businessAssayTaskDataList = businessAssayTaskDataDOMapEntry.getValue(); + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.get(0); + + if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) { + //根据子样id及分析方法id,查询未上报的分析任务 + List unReportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), QmsCommonConstant.NO); + if (unReportedList.size() > 0) {//还有未上报数据,直接处理,无需判定 + continue; + } else {//做超差判定 + //根据子样id及分析方法id,查询已上报的分析任务 + List reportedList = businessAssayTaskDataMapper.selectIsReportedList(businessAssayTaskDataIdList, businessAssayTaskDataDO.getBusinessSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId(), QmsCommonConstant.YES); + if (reportedList.size() > 0) { + List reportedBusinessAssayTaskDataIdList = reportedList.stream().map(m -> m.getId()).collect(Collectors.toList()); + businessAssayTaskDataIdList.addAll(reportedBusinessAssayTaskDataIdList); + } + + //查询分析项目 + List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); + Map> businessAssayProjectDataDOMap = businessAssayProjectDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataDO::getDictionaryProjectId)); + for (Map.Entry> businessAssayProjectDataDOEntry : businessAssayProjectDataDOMap.entrySet()) { + Long dictionaryProjectId = businessAssayProjectDataDOEntry.getKey(); + List val1 = businessAssayProjectDataDOEntry.getValue(); + BusinessAssayProjectDataDO businessAssayProjectDataDO = val1.get(0); + List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessAssayTaskDataDO.getConfigAssayMethodId()).eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessAssayProjectDataDO.getConfigAssayMethodProjectId())); + + //查询判定结果数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + + saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } else { + updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + businessSubSampleAssessmentDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + businessSubSampleAssessmentDO.setDictionaryProjectId(dictionaryProjectId); + businessSubSampleAssessmentDO.setDataType(businessAssayProjectDataDO.getDataType()); + businessSubSampleAssessmentDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); + businessSubSampleAssessmentDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + businessSubSampleAssessmentDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + businessSubSampleAssessmentDO.setUsage(businessAssayProjectDataDO.getUsage()); + businessSubSampleAssessmentDO.setSymbol(businessAssayProjectDataDO.getSymbol()); + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); + + // 排序并处理 null + List sortedValues = val1.stream() + .map(v -> { + String val = v.getValue(); + return val == null || val.trim().isEmpty() ? BigDecimal.ZERO : new BigDecimal(val.trim()); + }) + .sorted() + .collect(Collectors.toList()); + + // 获取小数精度 + int elementScale = businessAssayProjectDataDO.getDecimalPosition(); + // 计算代表值(均值或差值) + BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); + + //设置判定值 + businessSubSampleAssessmentDO.setAssessmentValue(representativeValue.toPlainString()); + + // 查找匹配的允差规则 + ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); + if (matchedRule == null) { + throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + dictionaryProjectId + ", 值: " + representativeValue); + } + + // 计算允差值 + BigDecimal allowValue; + try { + allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale); + } catch (Exception e) { + throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + dictionaryProjectId); + } + + // 判断相邻差值是否超差 + for (int i = 0; i < sortedValues.size() - 1; i++) { + BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs(); + if (diff.compareTo(allowValue) > 0) { + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); + break; + } + } + + } + + + + + } + + + } else if (QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessAssayTaskDataDO.getAssayType())) { + + } else {//单杯 + //查询分析项目 + List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); + + for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) { + + //查询判定结果数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodIdAndConfigAssayMethodProjectId(businessSubSampleId, businessAssayTaskDataDO.getConfigAssayMethodId(), businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + if (businessSubSampleAssessmentDO == null) { + businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + + saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } else { + updateBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); + } + businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + businessSubSampleAssessmentDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + businessSubSampleAssessmentDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + businessSubSampleAssessmentDO.setDictionaryProjectId(businessAssayProjectDataDO.getDictionaryProjectId()); + businessSubSampleAssessmentDO.setDataType(businessAssayProjectDataDO.getDataType()); + businessSubSampleAssessmentDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); + businessSubSampleAssessmentDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + businessSubSampleAssessmentDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + businessSubSampleAssessmentDO.setUsage(businessAssayProjectDataDO.getUsage()); + businessSubSampleAssessmentDO.setMinimumLimitValue(businessAssayProjectDataDO.getMinimumLimitValue()); + businessSubSampleAssessmentDO.setSymbol(businessAssayProjectDataDO.getSymbol()); + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); + businessSubSampleAssessmentDO.setAssessmentValue(businessAssayProjectDataDO.getValue()); + } + + } + + } + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setIsReported(1); + businessAssayTaskDataDO.setReportTime(LocalDateTime.now()); + businessAssayTaskDataDO.setReporter(nickName); + } + + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + + + + + + + + + + + + + } else { + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.PENDING); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + } + businessAssayTaskMapper.updateById(businessAssayTaskDO); + + //插入平行判定记录 + if (saveBusinessSubSampleAssessmentDOList.size() > 0) { + businessSubSampleAssessmentMapper.insertBatch(saveBusinessSubSampleAssessmentDOList); + } + if (updateBusinessSubSampleAssessmentDOList.size() > 0) { + businessSubSampleAssessmentMapper.updateBatch(updateBusinessSubSampleAssessmentDOList); + } + + //插入双杯判定记录 +// if (businessTeamAssessmentDOList.size() > 0) { +// businessTeamAssessmentMapper.insertBatch(businessTeamAssessmentDOList); +// } + } + + // 查找匹配的允差区间 + private ConfigAssayMethodProjectAssessmentDO findMatchingRule(List rules, BigDecimal value) { + if (rules == null || rules.isEmpty()) return null; + + // 特殊处理 level=0 和 level=4 + for (ConfigAssayMethodProjectAssessmentDO rule : rules) { + if (rule.getAssessmentLevel() == 0) { + ConfigAssayMethodProjectAssessmentDO next = rules.stream() + .filter(r -> r.getAssessmentLevel() == 1) + .findFirst() + .orElse(rule); + if (value.compareTo(new BigDecimal(next.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(next.getMaximumValue())) <= 0) { + return next; + } + } else if (rule.getAssessmentLevel() == 4) { + ConfigAssayMethodProjectAssessmentDO prev = rules.stream() + .filter(r -> r.getAssessmentLevel() == 3) + .findFirst() + .orElse(rule); + if (value.compareTo(new BigDecimal(prev.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(prev.getMaximumValue())) <= 0) { + return prev; + } + } else { + if (value.compareTo(new BigDecimal(rule.getMinimumValue())) >= 0 && value.compareTo(new BigDecimal(rule.getMaximumValue())) <= 0) { + return rule; + } + } + } + return null; + } + + // 计算代表值:1个取本身,2个取均值,>2取平均 + private BigDecimal calculateRepresentativeValue(List values, int elementScale) { + int size = values.size(); + if (size == 0) return BigDecimal.ZERO; + if (size == 1) return values.get(0).setScale(elementScale, RoundingMode.HALF_EVEN); + if (size == 2) { + return values.get(0).add(values.get(1)).divide(BigDecimal.valueOf(2), elementScale, RoundingMode.HALF_EVEN); + } + BigDecimal sum = values.stream().reduce(BigDecimal.ZERO, BigDecimal::add); + return sum.divide(BigDecimal.valueOf(size), elementScale, RoundingMode.HALF_EVEN); + } + + @Resource + private ConfigSampleReportMapper configSampleReportMapper; + + @Resource + private ConfigReportFieldMapper configReportFieldMapper; + + @Resource + private ConfigReportTypeMapper configReportTypeMapper; + + @Resource + private ConfigProjectMapper configProjectMapper; + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Resource + private BusinessBaseSampleMapper businessBaseSampleMapper; + + @Resource + private ConfigSubSampleParentMethodMapper configSubSampleParentMethodMapper; + + @Resource + private BusinessSubParentSampleMapper businessSubParentSampleMapper; + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) { + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + List unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.NO); + if (unReportedList.size() > 0) { + throw new ServiceException(1_032_100_000, "存在未上报的数据"); + } +// List saveBusinessAssayReportDataDOList = new ArrayList<>(); +// List updateBusinessAssayReportDataDOList = new ArrayList<>(); + + List businessSubParentSampleAssessmentDOList = new ArrayList<>(); + + //分析任务已全部上报 + List reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.YES); + //判定结果 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + + List businessSubSampleAssessmentIdList = businessSubSampleAssessmentList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + BusinessAssayTaskDataDO businessAssayTaskDataDO = reportedList.get(0); + + //查询主样 + BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId()); + +// List businessSubParentSampleIdList = reportedList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList()); + + //查询分样 + BusinessSubParentSampleDO businessSubParentSampleDO = businessSubParentSampleMapper.selectById(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + + //查询分样对应的方法 + ConfigSubSampleParentMethodDO configSubSampleParentMethodDO = configSubSampleParentMethodMapper.selectByConfigSubSampleParentIdAndConfigAssayMethodId(businessSubParentSampleDO.getConfigSubSampleParentId(), configAssayMethodId); + + //循环判定值 + BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = null; + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO(); + businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + businessSubParentSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); + businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue()); + businessSubParentSampleAssessmentDO.setTaskType(businessSubSampleAssessment.getTaskType()); + businessSubParentSampleAssessmentDO.setAssayType(businessSubSampleAssessment.getAssayType()); + businessSubParentSampleAssessmentDO.setDataType(businessSubSampleAssessment.getDataType()); + businessSubParentSampleAssessmentDO.setDecimalPosition(businessSubSampleAssessment.getDecimalPosition()); + businessSubParentSampleAssessmentDO.setUsage(businessSubSampleAssessment.getUsage()); + businessSubParentSampleAssessmentDO.setMinimumLimitValue(businessSubParentSampleAssessmentDO.getMinimumLimitValue()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodId(businessSubSampleAssessment.getConfigAssayMethodId()); + businessSubParentSampleAssessmentDO.setConfigAssayMethodProjectId(businessSubSampleAssessment.getConfigAssayMethodProjectId()); + businessSubParentSampleAssessmentDO.setDictionaryProjectId(businessSubSampleAssessment.getDictionaryProjectId()); + + businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO); + } + + + /** + //查询报表 + List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + + ConfigSampleReportReqVO configSampleReportSearch = new ConfigSampleReportReqVO(); + configSampleReportSearch.setConfigBaseSampleId(businessBaseSampleDO.getConfigBaseSampleId()); + List configSampleReportList = configSampleReportMapper.selectList(configSampleReportSearch); + + List configReportTypeIdList = configSampleReportList.stream().map(m -> m.getConfigReportTypeId()).collect(Collectors.toList()); + + //查询动态和计算的报表字段 + List configReportFieldList = configReportFieldMapper.selectByConfigReportTypeIds(configReportTypeIdList, Arrays.asList(QmsCommonConstant.FIELD_DYNAMIC, QmsCommonConstant.FIELD_CALCULATED)); + //动态报表字段 + List configReportFieldDynamicList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_DYNAMIC.equals(f.getFieldType())).collect(Collectors.toList()); + //根据检测方法查询字段配置 + List configProjectList = configProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + + + for (ConfigSampleReportExtendRespVO configSampleReport : configSampleReportList) { + BusinessAssayReportDataDO businessAssayReportDataDO = businessAssayReportDataDOList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getConfigSampleReportId().equals(configSampleReport.getId())).findFirst().orElse(null); + if (businessAssayReportDataDO == null) { + businessAssayReportDataDO = new BusinessAssayReportDataDO(); + businessAssayReportDataDO.setBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId()); + businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId()); + businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + + saveBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } else { + updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } + JSONObject assayDataJson = new JSONObject(); + String assayData = businessAssayReportDataDO.getAssayData(); + if (StringUtils.isNotBlank(assayData)) { + assayDataJson = JSON.parseObject(assayData); + } + //循环判定值 + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + Long configAssayMethodProjectId = businessSubSampleAssessment.getConfigAssayMethodProjectId(); + List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); + for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { + //查询动态报表字段 + ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null); + + if (configReportField == null) { + continue; + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); + reportFieldValueData.setFieldName(configReportField.getFieldName()); + reportFieldValueData.setFieldValue(businessSubSampleAssessment.getAssessmentValue()); + reportFieldValueData.setDataType(configReportField.getDataType()); + reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit()); + assayDataJson.put(configReportField.getField(), reportFieldValueData); + } + } + businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString()); + + //修改已上报数据来源 + String dataSource = businessAssayReportDataDO.getDataSource(); + Set dataSources = StringUtils.isBlank(dataSource) ? new HashSet<>() : new HashSet<>(Arrays.asList(dataSource.split(","))); + String reportedSource = businessAssayReportDataDO.getReportedSource(); + ReportedDataSource reportedDataSource = null; + if (StringUtils.isNotBlank(reportedSource)) { + reportedDataSource = JSON.parseObject(reportedSource, ReportedDataSource.class); + } else { + reportedDataSource = new ReportedDataSource(); + } + reportedDataSource.addDataSource(configAssayMethodId.toString(), nickName, LocalDateTime.now()); + Set busDataSources = reportedDataSource.getDetails().stream().map(m -> m.getSourceCode()).collect(Collectors.toSet()); + if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) { + businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES); + } + if (busDataSources.size() > 0) { + //计算 + // TODO + } + businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource)); + + } + + + if (saveBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList); + } + if (updateBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); + } + **/ + + if (businessSubParentSampleAssessmentDOList.size() > 0) { + businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList); + } + + businessSubSampleAssessmentMapper.update(new LambdaUpdateWrapper() + .set(BusinessSubSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) + .set(BusinessSubSampleAssessmentDO::getReporter, nickName) + .set(BusinessSubSampleAssessmentDO::getReportTime, LocalDateTime.now()) + .in(BusinessSubSampleAssessmentDO::getId, businessSubSampleAssessmentIdList)); + } + + @Resource + private ConfigSubSampleMapper configSubSampleMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Resource + private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void createReAnalysis(Long businessSubSampleId, Long configAssayMethodId) { + //子样数据 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); + + //子样配置数据 + ConfigSubSampleDO configSubSampleDO = configSubSampleMapper.selectById(businessSubSampleDO.getConfigSubSampleId()); + if (StringUtils.isBlank(configSubSampleDO.getRecheckFlowNodeKey())) { + throw new ServiceException(1_032_100_000, "未配置复检流程,不能发起复检委托!"); + } + + List newBusinessAssayTaskDataDOList = new ArrayList<>(); + List newBusinessAssayProjectDataDOList = new ArrayList<>(); + List newBusinessAssayParameterDataDOList = new ArrayList<>(); + + BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = null; + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectMaxAnalysisCountByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + List businessAssayTaskDataDOIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataDOIdList); + List businessAssayProjectDataDOIdList = businessAssayProjectDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + List businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataDOIdList); + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + // 子样检测任务 + newBusinessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + newBusinessAssayTaskDataDO.setId(IdWorker.getId()); + newBusinessAssayTaskDataDO.setBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId()); + newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessAssayTaskDataDO.getBusinessSubSampleId()); + newBusinessAssayTaskDataDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId()); + newBusinessAssayTaskDataDO.setSampleFlowNodeKey(configSubSampleDO.getRecheckFlowNodeKey()); + newBusinessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now()); + newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId()); + newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName()); + newBusinessAssayTaskDataDO.setAnalysisCount(businessAssayTaskDataDO.getAnalysisCount() + 1); + newBusinessAssayTaskDataDO.setAssayProject(businessAssayTaskDataDO.getAssayProject()); + + List businessAssayProjectDataList = businessAssayProjectDataDOList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList()); + for (BusinessAssayProjectDataExtendRespVO businessAssayProjectData : businessAssayProjectDataList) { + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(newBusinessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(businessAssayProjectData.getConfigAssayMethodProjectId()); + businessAssayProjectDataDO.setDictionaryProjectId(businessAssayProjectData.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(businessAssayProjectData.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(businessAssayProjectData.getDecimalPosition()); + businessAssayProjectDataDO.setIsEnabled(businessAssayProjectData.getIsEnabled()); + businessAssayProjectDataDO.setIsNotAssessment(0); + + newBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List businessAssayParameterDataList = businessAssayParameterDataDOList.stream().filter(f -> f.getBusinessAssayProjectDataId().equals(businessAssayProjectData.getId())).collect(Collectors.toList()); + for (BusinessAssayParameterDataDO businessAssayParameterData : businessAssayParameterDataList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(businessAssayParameterData.getConfigAssayMethodProjectParameterId()); + businessAssayParameterDataDO.setDictionaryParameterId(businessAssayParameterData.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(businessAssayParameterData.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(businessAssayParameterData.getDecimalPosition()); + + newBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + + newBusinessAssayTaskDataDOList.add(newBusinessAssayTaskDataDO); + + } + + //修改判定状态 + //查询判定值 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentList) { + businessSubSampleAssessmentExtendRespVO.setAssessmentValue(null); + businessSubSampleAssessmentExtendRespVO.setAssessmentStatus(QmsCommonConstant.IN_PROGRESS); + } + + if (newBusinessAssayTaskDataDOList.size() > 0) { + businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList); + } + if (newBusinessAssayProjectDataDOList.size() > 0) { + businessAssayProjectDataMapper.insertBatch(newBusinessAssayProjectDataDOList); + } + if (newBusinessAssayParameterDataDOList.size() > 0) { + businessAssayParameterDataMapper.insertBatch(newBusinessAssayParameterDataDOList); + } + if (businessSubSampleAssessmentList.size() > 0) { + List businessSubSampleAssessmentDOList = BeanUtil.copyToList(businessSubSampleAssessmentList, BusinessSubSampleAssessmentDO.class); + businessSubSampleAssessmentMapper.updateBatch(businessSubSampleAssessmentDOList); + } + + } + + @Resource + private ConfigRuleMapper configRuleMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public JSONObject modifyParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId, Long businessSubSampleAssessmentId, List businessAssayProjectDataIds) { + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectById(businessSubSampleAssessmentId); + //查询子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); + //查询子样与方法的配置 + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); + + //计算判定值计算规则 + ConfigRuleDO calculateAssessmentValue = configRuleMapper.selectLatestConfigRuleByCode(configSubSampleMethodDO.getCalculateMethod()); + + BusinessAssayProjectDataReqVO businessAssayProjectDataSearch = new BusinessAssayProjectDataReqVO(); + businessAssayProjectDataSearch.setBusinessSubSampleId(businessSubSampleId); + businessAssayProjectDataSearch.setConfigAssayMethodId(configAssayMethodId); + businessAssayProjectDataSearch.setConfigAssayMethodProjectId(businessSubSampleAssessmentDO.getConfigAssayMethodProjectId()); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectAnalysisBy(businessAssayProjectDataSearch); + List businessAssayProjectDataDOList = BeanUtil.copyToList(businessAssayProjectDataList, BusinessAssayProjectDataDO.class); + for (BusinessAssayProjectDataDO businessAssayProjectDataDO : businessAssayProjectDataDOList) { + if (businessAssayProjectDataIds.contains(businessAssayProjectDataDO.getId())) { + businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO); + } else { + businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.YES); + } + } + // 排序并处理 null + List sortedValues = businessAssayProjectDataDOList.stream() + .filter(f -> f.getIsNotAssessment().equals(QmsCommonConstant.NO)) + .map(v -> { + String val = v.getValue(); + return val == null || val.trim().isEmpty() ? BigDecimal.ZERO : new BigDecimal(val.trim()); + }) + .sorted() + .collect(Collectors.toList()); + + // 获取小数精度 + int elementScale = businessSubSampleAssessmentDO.getDecimalPosition(); + // 计算代表值(均值\) +// BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); + DefaultContext context = new DefaultContext<>(); + context.put("values", sortedValues); + context.put("scale", elementScale); + BigDecimal representativeValue = null; + try { + representativeValue = (BigDecimal) expressRunner.execute(calculateAssessmentValue.getExpression(), context, null, false, false); + } catch (Exception e) { + e.printStackTrace(); + } + + //设置判定值 + businessSubSampleAssessmentDO.setAssessmentValue(representativeValue.toPlainString()); + + List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX() + .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessSubSampleAssessmentDO.getConfigAssayMethodId()) + .eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessSubSampleAssessmentDO.getConfigAssayMethodProjectId())); + + // 查找匹配的允差规则 + ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); + if (matchedRule == null) { + throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId() + ", 值: " + representativeValue); + } + + // 计算允差值 + BigDecimal allowValue; + try { + allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale); + } catch (Exception e) { + throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId()); + } + + // 判断相邻差值是否超差 + for (int i = 0; i < sortedValues.size() - 1; i++) { + BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs(); + if (diff.compareTo(allowValue) > 0) { + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); + break; + } + } + + //更新判定值 + businessSubSampleAssessmentMapper.updateById(businessSubSampleAssessmentDO); + //更新检测项目 + businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataDOList); + + + return getParallelResultAssessment(businessSubSampleId, configAssayMethodId); + } + + + + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java new file mode 100644 index 0000000..5b102c2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisService.java @@ -0,0 +1,68 @@ +package com.zt.plat.module.qms.business.bus.service; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.*; + +/** + * SampleAnalysisService + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月22日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月22日 + */ +public interface SampleAnalysisService { + + /** + * 根据分配任务单id获取任务分配单分析样品项目 + * @param businessAssayTaskId 任务分配单id + * @return + */ + BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId); + + /** + * 批量保存任务单录入数据 + * @param vo + */ + void saveBatchSampleAnalysis(BusinessAssayTaskAnalysisSampleProjectRespVO vo); + + /** + * 根据分配任务id 获取任务分配单 分析样品项目及品控样品项目 + * @param businessAssayTaskId + * @return + */ + BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId); + + /** + * 下发配料 + * @param businessAssayTaskId + */ + void issuedIngredients(Long businessAssayTaskId); + + /** + * 根据任务单id提交分析数据 + * @param businessAssayTaskId 任务单id + */ + void submitSampleAnalysisByTaskId(Long businessAssayTaskId); + + /** + * 批量保存任务单录入数据 + * @param vo + */ + void saveBatchSmpleAndQcAnalysis(BusinessAssayTaskAnalysisSampleAndQcProjectRespVO vo); + + /** + * 根据子样任务id查询分析数据 + * @param businessAssayTaskDataId + * @return + */ + JSONObject getSampleAnalysisDataByTaskDataId(Long businessAssayTaskDataId); + + void rollbackAnalysisSample(BusinessAssayTaskBackSampleReqVO req); + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java new file mode 100644 index 0000000..1a12032 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -0,0 +1,938 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.BatchSampleAnalysisColumnRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleAndQcProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskAnalysisSampleProjectRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskBackSampleReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; +import com.zt.plat.module.qms.common.data.service.DataCollectionService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.collection.CollUtil; +import jakarta.annotation.Resource; + +/** + * SampleAnalysisServiceImpl + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2025年9月22日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2025年9月22日 + */ +@Service +public class SampleAnalysisServiceImpl implements SampleAnalysisService { + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigAssayMethodProjectRangeMapper configAssayMethodProjectRangeMapper; + + @Resource + private ConfigAssayMethodProjectCoefficientMapper configAssayMethodProjectCoefficientMapper; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Resource + private ConfigQCSampleMethodMapper configQCSampleMethodMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + + @Resource + private DataCollectionService dataCollectionService; + + @Override + public BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId) { + BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO(); + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + if (businessAssayTaskDO == null) { + throw new ServiceException(1_032_100_000, "未找到任务分配单"); + } + businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTaskId(businessAssayTaskId); + businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTasNo(businessAssayTaskDO.getTaskNo()); + businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTasName(businessAssayTaskDO.getTaskName()); + businessAssayTaskAnalysisSampleProjectRespVO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessAssayTaskAnalysisSampleProjectRespVO.setAssayTime(businessAssayTaskDO.getAssayTime()); + businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + businessAssayTaskAnalysisSampleProjectRespVO.setDataCollectionId(businessAssayTaskDO.getFormDataCollectionId()); + businessAssayTaskAnalysisSampleProjectRespVO.setFormValue(businessAssayTaskDO.getFormValue()); + businessAssayTaskAnalysisSampleProjectRespVO.setIsIngredients(businessAssayTaskDO.getIsIngredients()); + businessAssayTaskAnalysisSampleProjectRespVO.setIngredientsStatus(businessAssayTaskDO.getIngredientsStatus()); + + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodName(configAssayMethodDO.getName()); + businessAssayTaskAnalysisSampleProjectRespVO.setDataCollectionKey(configAssayMethodDO.getDataCollectionKey()); + + //处理列 + List cloumns = new ArrayList<>(); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + //cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null)); + + + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId)); + + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + + BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); + projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + String fieldIndex = "e" + ep.getDicId(); + String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(ep.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + fieldIndex = "p" + p.getDicId(); + title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); + isEdit = StringUtils.isBlank(p.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + } + } + } + businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns); + + + //处理数据 + List> datas = new ArrayList<>(); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null); + + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); + map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); + map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); + map.put("rollbackStatus", businessAssayTaskDetailDO.getRollbackStatus()); + + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + map.put("e" + ep.getDicId(), ep); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + map.put("p" + p.getDicId(), p); + } + } + + } + datas.add(map); + } + + businessAssayTaskAnalysisSampleProjectRespVO.setDatas(datas); + + //查询区间范围 + List configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodProjectRangeList(BeanUtils.toBean(configAssayMethodProjectRangeDOList, ConfigAssayMethodProjectRangeRespVO.class)); + + //查询补正系数 + List configAssayMethodProjectCoefficientDOList = configAssayMethodProjectCoefficientMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodProjectCoefficientList(BeanUtils.toBean(configAssayMethodProjectCoefficientDOList, ConfigAssayMethodProjectCoefficientRespVO.class)); + + return businessAssayTaskAnalysisSampleProjectRespVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveBatchSampleAnalysis(BusinessAssayTaskAnalysisSampleProjectRespVO vo) { + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(vo.getBusinessAssayTaskId()); + businessAssayTaskDO.setFormValue(vo.getFormValue()); + businessAssayTaskDO.setAssayTime(vo.getAssayTime()); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SAVED); + //赋值数据集id + if (vo.getDataCollectionId() == null) { + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + DataCollectionDO dataCollectionDO = dataCollectionService.getLatestDataCollectionByKey(configAssayMethodDO.getDataCollectionKey()); + businessAssayTaskDO.setFormDataCollectionId(dataCollectionDO.getId()); + } else { + businessAssayTaskDO.setFormDataCollectionId(vo.getDataCollectionId()); + } + + +// List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId())); + + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList)); + + + List> datas = vo.getDatas(); + for (Map map : datas) { +// Long businessAssayTaskDataId = (Long) map.get("businessAssayTaskDataId"); +// Long businessAssayTaskId = (Long) map.get("businessAssayTaskId"); +// Long businessSubSampleId = (Long) map.get("businessSubSampleId"); +// Long businessSubParentSampleId = (Long) map.get("businessSubParentSampleId"); +// Long configAssayMethodId = (Long) map.get("configAssayMethodId"); +// Long businessAssayTaskDetailId = (Long) map.get("businessAssayTaskDetailId"); +// String sampleCode = map.get("sampleCode"); +// String sampleName = map.get("sampleName"); + + List listBusinessAssayProjectAndParameter = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { +// String key = entry.getKey(); + Object val = entry.getValue(); + if (val instanceof String || val == null) { + continue; + } + BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class); + listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter); + } + + //BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.stream().filter(f -> f.getId().equals(businessAssayTaskDataId)).findFirst().orElse(null); + + + for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) { + if ("project".equals(pap.getType())) { + BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessAssayProjectDataDO.setValue(pap.getValue()); + businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessAssayProjectDataDO.setValue(value.toPlainString()); + businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + + + } else { + businessAssayProjectDataDO.setValue(null); + } + + + } else if ("parameter".equals(pap.getType())) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessAssayParameterDataDO.setValue(pap.getValue()); + businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessAssayParameterDataDO.setValue(value.toPlainString()); + businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessAssayParameterDataDO.setValue(null); + } + } + } + + } + + + + businessAssayTaskMapper.updateById(businessAssayTaskDO); + businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList); + if (CollUtil.isNotEmpty(businessAssayParameterDataList)) { + businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList); + } + } + + @Override + public BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) { + BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProjectRespVO = new BusinessAssayTaskAnalysisSampleAndQcProjectRespVO(); + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + if (businessAssayTaskDO == null) { + throw new ServiceException(1_032_100_000, "未找到任务分配单"); + } + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setBusinessAssayTaskId(businessAssayTaskId); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setBusinessAssayTasNo(businessAssayTaskDO.getTaskNo()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setBusinessAssayTasName(businessAssayTaskDO.getTaskName()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTime(businessAssayTaskDO.getAssayTime()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setDataCollectionId(businessAssayTaskDO.getFormDataCollectionId()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setFormValue(businessAssayTaskDO.getFormValue()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setIsIngredients(businessAssayTaskDO.getIsIngredients()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setIngredientsStatus(businessAssayTaskDO.getIngredientsStatus()); + + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigAssayMethodName(configAssayMethodDO.getName()); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setDataCollectionKey(configAssayMethodDO.getDataCollectionKey()); + + List assayTaskAnalysisDataList = new ArrayList<>(); + + //质控分析数据 + List qcAnalysis = getQcAnalysis(businessAssayTaskDO); + assayTaskAnalysisDataList.addAll(qcAnalysis); + + //样品分析数据 + BusinessAssayTaskAnalysisDataRespVO analysis = getAnalysis(businessAssayTaskDO); + assayTaskAnalysisDataList.add(analysis); + + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTaskAnalysisDataList(assayTaskAnalysisDataList); + +// List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); +// businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigQCSampleMethodList(configQCSampleMethodList); + + //查询区间范围 + List configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigAssayMethodProjectRangeList(BeanUtils.toBean(configAssayMethodProjectRangeDOList, ConfigAssayMethodProjectRangeRespVO.class)); + + //查询补正系数 + List configAssayMethodProjectCoefficientDOList = configAssayMethodProjectCoefficientMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigAssayMethodProjectCoefficientList(BeanUtils.toBean(configAssayMethodProjectCoefficientDOList, ConfigAssayMethodProjectCoefficientRespVO.class)); + + return businessAssayTaskAnalysisSampleAndQcProjectRespVO; + } + + private BusinessAssayTaskAnalysisDataRespVO getAnalysis(BusinessAssayTaskDO businessAssayTaskDO) { + BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO = new BusinessAssayTaskAnalysisDataRespVO(); + businessAssayTaskAnalysisDataRespVO.setAnalysisType("analysis"); + businessAssayTaskAnalysisDataRespVO.setAnalysisName("分析样"); + businessAssayTaskAnalysisDataRespVO.setSortNo(99); + + + //处理列 + List cloumns = new ArrayList<>(); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + //cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null)); + + + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0); + + BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); + projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + String fieldIndex = "e" + ep.getDicId(); + String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(ep.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + fieldIndex = "p" + p.getDicId(); + title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); + isEdit = StringUtils.isBlank(p.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + } + } + } + businessAssayTaskAnalysisDataRespVO.setColumns(cloumns); + + + //处理数据 + List> datas = new ArrayList<>(); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) { + BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null); + + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId()); + map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId()); + map.put("businessSubSampleId", businessAssayTaskDataDO.getBusinessSubSampleId()); + map.put("businessSubParentSampleId", businessAssayTaskDataDO.getBusinessSubParentSampleId()); + map.put("configAssayMethodId", businessAssayTaskDataDO.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", businessAssayTaskDetailDO.getId()); + map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode()); + map.put("sampleName", businessAssayTaskDetailDO.getSampleName()); + map.put("rollbackStatus", businessAssayTaskDetailDO.getRollbackStatus()); + + BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO(); + projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + map.put("e" + ep.getDicId(), ep); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + map.put("p" + p.getDicId(), p); + } + } + + } + datas.add(map); + } + + businessAssayTaskAnalysisDataRespVO.setDatas(datas); + + + return businessAssayTaskAnalysisDataRespVO; + } + + private List getQcAnalysis(BusinessAssayTaskDO businessAssayTaskDO) { + List list = new ArrayList<>(); + + List configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO = null; + for (ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO : configQCSampleMethodList) { + businessAssayTaskAnalysisDataRespVO = new BusinessAssayTaskAnalysisDataRespVO(); + businessAssayTaskAnalysisDataRespVO.setAnalysisType(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); + businessAssayTaskAnalysisDataRespVO.setAnalysisName(configQCSampleMethodExtendRespVO.getDictionaryBusinessName()); + businessAssayTaskAnalysisDataRespVO.setSortNo(configQCSampleMethodExtendRespVO.getSortNo()); + businessAssayTaskAnalysisDataRespVO.setConfigQCSampleMethod(configQCSampleMethodExtendRespVO); + + //处理列 + List cloumns = new ArrayList<>(); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null)); + + //处理数据 + List> datas = new ArrayList<>(); + if ("kby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) || "by".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey())) { + List businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskIdAndDictionaryBusinessKey(businessAssayTaskDO.getId(), configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()); + if (CollUtil.isEmpty(businessQCCoefficientDataDOList)) { + break; + } + BusinessQCCoefficientDataDO businessQCCoefficientDataDO = businessQCCoefficientDataDOList.get(0); + + BusinessQCCoefficientParameterDataReqVO parameterDataSearch = new BusinessQCCoefficientParameterDataReqVO(); + parameterDataSearch.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); + List plist = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + String fieldIndex = "p" + p.getDicId(); + String title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(p.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + } + + + for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCCoefficientData.getId()); + map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCCoefficientData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCCoefficientData.getSampleCode()); + map.put("sampleName", businessQCCoefficientData.getSampleName()); + + BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO(); + parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId()); + List plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2); + for (BusinessAssayProjectAndParameterRespVO p : plist2) { + map.put("p" + p.getDicId(), p); + } + datas.add(map); + } + + + } else { + List businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + if (CollUtil.isEmpty(businessQCManagementDataDOList)) { + break; + } + BusinessQCManagementDataDO businessQCManagementDataDO = businessQCManagementDataDOList.get(0); + + BusinessQCManagementProjectDataReqVO projectDataSearch = new BusinessQCManagementProjectDataReqVO(); + projectDataSearch.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); + List projectAndParameterList = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + String fieldIndex = "e" + ep.getDicId(); + String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); + boolean isEdit = StringUtils.isBlank(ep.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName())); + + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); + parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); + List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + fieldIndex = "p" + p.getDicId(); + title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); + isEdit = StringUtils.isBlank(p.getFormula()); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName())); + } + } + } + + for (BusinessQCManagementDataDO businessQCManagementData : businessQCManagementDataDOList) { + Map map = new HashedMap<>(); + map.put("businessAssayTaskDataId", businessQCManagementData.getId()); + map.put("businessAssayTaskId", businessQCManagementData.getBusinessAssayTaskId()); + map.put("businessSubSampleId", ""); + map.put("businessSubParentSampleId", ""); + map.put("configAssayMethodId", businessQCManagementData.getConfigAssayMethodId()); + map.put("businessAssayTaskDetailId", ""); + map.put("sampleCode", businessQCManagementData.getSampleCode()); + map.put("sampleName", businessQCManagementData.getSampleName()); + + BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO(); + projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId()); + List projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) { + map.put("e" + ep.getDicId(), ep); + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO(); + parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId()); + List plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + map.put("p" + p.getDicId(), p); + } + } + + } + datas.add(map); + } + + } + businessAssayTaskAnalysisDataRespVO.setColumns(cloumns); + businessAssayTaskAnalysisDataRespVO.setDatas(datas); + list.add(businessAssayTaskAnalysisDataRespVO); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveBatchSmpleAndQcAnalysis(BusinessAssayTaskAnalysisSampleAndQcProjectRespVO vo) { + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(vo.getBusinessAssayTaskId()); + businessAssayTaskDO.setFormValue(vo.getFormValue()); + businessAssayTaskDO.setAssayTime(vo.getAssayTime()); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SAVED); + //赋值数据集id + if (vo.getDataCollectionId() == null) { + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + DataCollectionDO dataCollectionDO = dataCollectionService.getLatestDataCollectionByKey(configAssayMethodDO.getDataCollectionKey()); + businessAssayTaskDO.setFormDataCollectionId(dataCollectionDO.getId()); + } else { + businessAssayTaskDO.setFormDataCollectionId(vo.getDataCollectionId()); + } + + List assayTaskAnalysisDataList = vo.getAssayTaskAnalysisDataList(); + if (CollUtil.isNotEmpty(assayTaskAnalysisDataList)) { + for (BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO : assayTaskAnalysisDataList) { + if ("analysis".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) { + List businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId())); + + List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); + List businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList)); + + List> datas = businessAssayTaskAnalysisDataRespVO.getDatas(); + for (Map map : datas) { + + List listBusinessAssayProjectAndParameter = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { + Object val = entry.getValue(); + if (val instanceof String || val == null) { + continue; + } + BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class); + listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter); + } + + for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) { + if ("project".equals(pap.getType())) { + BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessAssayProjectDataDO.setValue(pap.getValue()); + businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessAssayProjectDataDO.setValue(value.toPlainString()); + businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessAssayProjectDataDO.setValue(null); + } + } else if ("parameter".equals(pap.getType())) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessAssayParameterDataDO.setValue(pap.getValue()); + businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessAssayParameterDataDO.setValue(value.toPlainString()); + businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessAssayParameterDataDO.setValue(null); + } + } + } + + } + + if (CollUtil.isNotEmpty(businessAssayProjectDataList)) { + businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList); + } + if (CollUtil.isNotEmpty(businessAssayParameterDataList)) { + businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList); + } + + } else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) { + List BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + List businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(businessQCManagementDataIdList); + List businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessQCManagementParameterDataList = businessQCManagementParameterDataMapper.selectByBusinessQCManagementProjectDataIds(businessQCManagementProjectDataIdList); + + List> datas = businessAssayTaskAnalysisDataRespVO.getDatas(); + for (Map map : datas) { + + List listBusinessAssayProjectAndParameter = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { + Object val = entry.getValue(); + if (val instanceof String || val == null) { + continue; + } + BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class); + listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter); + } + + for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) { + if ("project".equals(pap.getType())) { + BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = businessQCManagementProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessQCManagementProjectDataDO.setValue(pap.getValue()); + businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessQCManagementProjectDataDO.setValue(value.toPlainString()); + businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessQCManagementProjectDataDO.setValue(null); + } + } else if ("parameter".equals(pap.getType())) { + BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = businessQCManagementParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessQCManagementParameterDataDO.setValue(pap.getValue()); + businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessQCManagementParameterDataDO.setValue(value.toPlainString()); + businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessQCManagementParameterDataDO.setValue(null); + } + } + } + + } + + if (CollUtil.isNotEmpty(businessQCManagementProjectDataList)) { + businessQCManagementProjectDataMapper.updateBatch(businessQCManagementProjectDataList); + } + + if (CollUtil.isNotEmpty(businessQCManagementParameterDataList)) { + businessQCManagementParameterDataMapper.updateBatch(businessQCManagementParameterDataList); + } + } else { + List businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId()); + + List businessQCCoefficientDataIdList = businessQCCoefficientDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + List businessQCCoefficientParameterDataList = businessQCCoefficientParameterDataMapper.selectByBusinessQCCoefficientDataIds(businessQCCoefficientDataIdList); + + List> datas = businessAssayTaskAnalysisDataRespVO.getDatas(); + for (Map map : datas) { + + List listBusinessAssayProjectAndParameter = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { + Object val = entry.getValue(); + if (val instanceof String || val == null) { + continue; + } + BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class); + listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter); + } + + for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) { + if ("parameter".equals(pap.getType())) { + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = businessQCCoefficientParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null); + if (StringUtils.isNotBlank(pap.getValue())) { + String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 + switch (dataType) { + case "int": + case "date": + case "datetime": + case "string": + businessQCCoefficientParameterDataDO.setValue(pap.getValue()); + businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue()); + break; + case "decimal": + BigDecimal value = new BigDecimal(pap.getValue()); + value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN); + businessQCCoefficientParameterDataDO.setValue(value.toPlainString()); + businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString()); + break; + default: + throw new IllegalArgumentException("Unexpected value: " + dataType); + } + } else { + businessQCCoefficientParameterDataDO.setValue(null); + } + } + } + + } + + if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) { + businessQCCoefficientParameterDataMapper.updateBatch(businessQCCoefficientParameterDataList); + } + + } + } + + } + businessAssayTaskMapper.updateById(businessAssayTaskDO); + } + + + @Override + public void submitSampleAnalysisByTaskId(Long businessAssayTaskId) { + String loginUserNickname = SecurityFrameworkUtils.getLoginUserNickname(); + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SUBMITTED); + businessAssayTaskDO.setAssaySubmitTime(LocalDateTime.now()); + businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); + businessAssayTaskMapper.updateById(businessAssayTaskDO); + } + + @Override + public JSONObject getSampleAnalysisDataByTaskDataId(Long businessAssayTaskDataId) { + JSONObject resultJsonObject = new JSONObject(); + + BusinessAssayTaskDataExtendRespVO businessAssayTaskData = businessAssayTaskDataMapper.selectExtendRespById(businessAssayTaskDataId); + if (businessAssayTaskData == null) { + throw new ServiceException(1_032_100_000, "未找到检测任务业务数据,请检查参数是否正确"); + } + + resultJsonObject = (JSONObject) JSON.toJSON(businessAssayTaskData); + + List> columns = new ArrayList<>(); + + BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO(); + projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskDataId); + List projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch); + for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) { + final String eTitle = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); + + columns.add(new HashMap<>() { + private static final long serialVersionUID = 1L; + { + put("title", eTitle); + put("value", ep.getValue()); + }}); + + if (StringUtils.isNotEmpty(ep.getFormula())) { + BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); + parameterDataSearch.setBusinessAssayProjectDataId(ep.getId()); + List plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch); + for (BusinessAssayProjectAndParameterRespVO p : plist) { + final String pTitle = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); + columns.add(new HashMap<>() { + private static final long serialVersionUID = 8422574140192155301L; + { + put("title", pTitle); + put("value", p.getValue()); + }}); + } + } + } + resultJsonObject.put("columns", columns); + return resultJsonObject; + } + + @Override + public void rollbackAnalysisSample(BusinessAssayTaskBackSampleReqVO req) { + List businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectByIds(req.getIdList()); + for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : businessAssayTaskDetailList) { + + businessAssayTaskDetailDO.setRollbackStatus("returned"); + businessAssayTaskDetailDO.setRemark(req.getBackDesc()); + } + + businessAssayTaskDetailMapper.updateBatch(businessAssayTaskDetailList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void issuedIngredients(Long businessAssayTaskId) { + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); + businessAssayTaskDO.setIngredientsStatus("in_progress"); + businessAssayTaskMapper.updateById(businessAssayTaskDO); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustService.java index 5afefb1..b272e23 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustService.java @@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.service; import java.util.List; +import com.alibaba.fastjson2.JSONObject; import com.yomahub.liteflow.flow.LiteflowResponse; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleEntrustRegistrationExtendRespVO; @@ -18,8 +19,11 @@ public interface SampleEntrustService { BusinessSampleEntrustRegistrationExtendRespVO detail(Long id); void delete(Long id); + + JSONObject reportDetail(Long id); void deleteList(List ids); void submit(@Valid BusinessSampleEntrustRegistrationSubmitReqVO req); + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java index 89a2e0f..de5792d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleEntrustServiceImpl.java @@ -7,6 +7,11 @@ import java.util.stream.Collectors; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONFactory; +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.fastjson2.JSONWriter; import com.yomahub.liteflow.core.FlowExecutor; import com.yomahub.liteflow.flow.LiteflowResponse; @@ -65,7 +70,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class); if (!response.isSuccess()){ log.error("创建委托登记失败", response.getCause()); - throw new ServiceException(500, response.getCause().getMessage()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); } return response; } @@ -73,27 +78,16 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { @Override public BusinessSampleEntrustRegistrationExtendRespVO detail(Long id) { BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistrationDO = businessSampleEntrustRegistrationMapper.selectById(id); - //BusinessSampleEntrustRegistrationExtendRespVO businessSampleEntrustRegistrationExtendRespVO = BeanUtils.toBean(businessSampleEntrustRegistrationDO, BusinessSampleEntrustRegistrationExtendRespVO.class); BusinessSampleEntrustRegistrationExtendRespVO businessSampleEntrustRegistrationExtendRespVO = BeanUtil.copyProperties(businessSampleEntrustRegistrationDO, BusinessSampleEntrustRegistrationExtendRespVO.class); List sampleEntrustDetailExtendRespVOList = new ArrayList<>(); - List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, id)); + List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationId(id); BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO = null; for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailList) { businessSampleEntrustDetailExtendRespVO = BeanUtils.toBean(businessSampleEntrustDetailDO, BusinessSampleEntrustDetailExtendRespVO.class); - List businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectJoinList(BusinessSampleEntrustProjectExtendRespVO.class, new MPJLambdaWrapperX() - .selectAll(BusinessSampleEntrustProjectDO.class) - .selectAs(DictionaryProjectDO::getCode, BusinessSampleEntrustProjectExtendRespVO::getProjectCode) - .selectAs(DictionaryProjectDO::getName, BusinessSampleEntrustProjectExtendRespVO::getProjectName) - .selectAs(DictionaryProjectDO::getSimpleName, BusinessSampleEntrustProjectExtendRespVO::getProjectSimpleName) - .selectAs(DictionaryProjectDO::getShowName, BusinessSampleEntrustProjectExtendRespVO::getProjectShowName) - .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSampleEntrustProjectDO::getDictionaryProjectId) - .eq(BusinessSampleEntrustProjectDO::getBusinessSampleEntrustDetailId, businessSampleEntrustDetailDO.getId())); - -// List sampleEntrustProjectList = businessSampleEntrustProjectMapper.selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustProjectDO::getBusinessSampleEntrustDetailId, businessSampleEntrustDetailDO.getId())); -// List businessSampleEntrustProjectExtendRespVOList = BeanUtils.toBean(sampleEntrustProjectList, BusinessSampleEntrustProjectExtendRespVO.class); + List businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailDO.getId()); businessSampleEntrustDetailExtendRespVO.setSampleEntrustDetailProjectList(businessSampleEntrustProjectExtendRespVOList); @@ -103,7 +97,46 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { return businessSampleEntrustRegistrationExtendRespVO; } + + @Override + public JSONObject reportDetail(Long id) { + JSONWriter.Context context = JSONFactory.createWriteContext(); + context.setDateFormat("yyyy-MM-dd HH:mm:ss"); + + JSONObject result = new JSONObject(); + BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistrationDO = businessSampleEntrustRegistrationMapper.selectById(id); + String externalInfomation = businessSampleEntrustRegistrationDO.getExternalInfomation(); + JSONObject extInfJsonObject = JSON.parseObject(externalInfomation); + + String jsonString = JSON.toJSONString(businessSampleEntrustRegistrationDO, context); + JSONObject sampleEntrustRegistration = JSON.parseObject(jsonString); + extInfJsonObject.forEach((key, value) -> { + sampleEntrustRegistration.put(key, value); + }); + + JSONArray jsonArray = new JSONArray(); + jsonArray.add(sampleEntrustRegistration); + List sampleEntrustDetailExtendRespVOList = new ArrayList<>(); + List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationId(id); + BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO = null; + for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailList) { + businessSampleEntrustDetailExtendRespVO = BeanUtils.toBean(businessSampleEntrustDetailDO, BusinessSampleEntrustDetailExtendRespVO.class); + + List businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailDO.getId()); + + businessSampleEntrustDetailExtendRespVO.setSampleEntrustDetailProjectList(businessSampleEntrustProjectExtendRespVOList); + + sampleEntrustDetailExtendRespVOList.add(businessSampleEntrustDetailExtendRespVO); + } + + String sampleEntrustDetailJsonString = JSON.toJSONString(sampleEntrustDetailExtendRespVOList, context); + result.put("sampleEntrustRegistration", jsonArray); + result.put("sampleEntrustDetail", JSON.parseArray(sampleEntrustDetailJsonString)); + return result; + } + + @Override @Transactional(rollbackFor = Exception.class) public LiteflowResponse update(@Valid SampleEntrustParam sampleEntrustParam) { @@ -111,7 +144,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class); if (!response.isSuccess()){ log.error("更新委托登记失败", response.getCause()); - throw new ServiceException(500, response.getCause().getMessage()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); } return response; } @@ -120,10 +153,10 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { @Transactional(rollbackFor = Exception.class) public void delete(Long id) { if (id == null) { - throw new ServiceException(500, "委托登记id不允许为空"); + throw new ServiceException(1_032_100_000, "委托登记id不允许为空"); } if (businessSampleEntrustRegistrationMapper.selectById(id) == null) { - throw new ServiceException(500, "委托登记业务不存在"); + throw new ServiceException(1_032_100_000, "委托登记业务不存在"); } List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, id)); @@ -154,11 +187,11 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { @Transactional(rollbackFor = Exception.class) public void deleteList(List ids) { if (ids == null || ids.size() <= 0) { - throw new ServiceException(500, "委托登记id列表不允许为空"); + throw new ServiceException(1_032_100_000, "委托登记id列表不允许为空"); } List sampleEntrustRegistrationList = businessSampleEntrustRegistrationMapper.selectByIds(ids); if (CollUtil.isEmpty(sampleEntrustRegistrationList) || sampleEntrustRegistrationList.size() != ids.size()) { - throw new ServiceException(500, "委托登记业务不存在"); + throw new ServiceException(1_032_100_000, "委托登记业务不存在"); } List sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, ids)); @@ -190,7 +223,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { Long tenantId = TenantContextHolder.getRequiredTenantId(); BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = businessSampleEntrustRegistrationMapper.selectById(req.getId()); if (sampleEntrustRegistration == null) { - throw new ServiceException(500, "委托登记业务不存在"); + throw new ServiceException(1_032_100_000, "委托登记业务不存在"); } SampleEntrustParam sampleEntrustParam = BeanUtils.toBean(sampleEntrustRegistration, SampleEntrustParam.class); sampleEntrustParam.setIsReceiveSample(req.getIsReceiveSample()); @@ -217,8 +250,10 @@ public class SampleEntrustServiceImpl implements SampleEntrustService { LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class); if (!response.isSuccess()){ log.error("提交委托登记失败", response.getCause()); - throw new ServiceException(500, response.getCause().getMessage()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); } } + + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleFlowServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleFlowServiceImpl.java index 2e7f493..cd682b1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleFlowServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleFlowServiceImpl.java @@ -27,7 +27,7 @@ public class SampleFlowServiceImpl implements SampleFlowService { LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class); if (!response.isSuccess()){ log.error("样品流转失败", response.getCause()); - throw new ServiceException(500, response.getCause().getMessage()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); } return response; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java new file mode 100644 index 0000000..5ca7ecd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingService.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.List; + +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentMethodRespVO; + +public interface SampleResultReportingService { + + List getUnReportMethodGroupList(); + + JSONObject getSampleResultReportingList(Long configAssayMethodId); + + List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId); + + void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO); + + void batchResultDataReporting(BatchResultDataReportingReqVO reqVO); + + JSONObject getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId); + + void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO); + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java new file mode 100644 index 0000000..e4014bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleResultReportingServiceImpl.java @@ -0,0 +1,545 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentExtendRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.NoReportSubParentSampleAssessmentRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentMethodRespVO; +import com.zt.plat.module.qms.business.bus.controller.vo.ReportFieldValueData; +import com.zt.plat.module.qms.business.bus.controller.vo.ReportedDataSource; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportFieldMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import jakarta.annotation.Resource; + +@Service +public class SampleResultReportingServiceImpl implements SampleResultReportingService { + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper; + + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + + @Resource + private BusinessSubParentSampleMapper businessSubParentSampleMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + + @Override + public List getUnReportMethodGroupList() { + List list = businessSubParentSampleAssessmentMapper.selectUnReportMethodGroupList(); + return list; + } + + @Override + public JSONObject getSampleResultReportingList(Long configAssayMethodId) { + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + List> columnList = new ArrayList<>(); + + //动态字段 + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectDOList) { + columnList.add(new HashMap() { + private static final long serialVersionUID = 2100402322138923549L; + + { + put("title", configAssayMethodProject.getShowName() + "(" + configAssayMethodProject.getDictionaryProjectUnit() + ")"); + put("field", configAssayMethodProject.getSimpleName()); + put("dataType", configAssayMethodProject.getDataType()); + put("decimalPosition", configAssayMethodProject.getDecimalPosition()); + put("isEdit", true); + }}); + } + + List> dataList = new ArrayList<>(); + + //查询结果报送未上报的样品 + List noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId); + //分样id列表 + List businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList()); + //报送的检测项目数据 + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + //获取分析任务数 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + List businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + //获取子样数据 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); + + //获取结果判定数据 + List businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + + //获取复测业务数据 + List businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId); + + //循环未上报的样品 + for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) { + Map noReportSubParentSampleAssessmentMap = BeanUtil.beanToMap(noReportSubParentSampleAssessmentRespVO); + String sampleCode = businessSubSampleDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).map(m -> m.getSampleAssayCode()).distinct().collect(Collectors.joining(" | ")); + noReportSubParentSampleAssessmentMap.put("sampleCode", sampleCode); + + Map subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); + Map subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class); + List curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果"); + StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder(); + for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) { + noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), businessSubParentSampleAssessmentDO.getAssessmentValue()); + businessSubParentSampleAssessmentIds.append(businessSubParentSampleAssessmentDO.getId()).append(","); + } + businessSubParentSampleAssessmentIds.delete(businessSubParentSampleAssessmentIds.length() -1, businessSubParentSampleAssessmentIds.length()); + noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); + dataList.add(noReportSubParentSampleAssessmentMap); + + //复测之前的判定数据 + BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = businessSubSampleParentRecheckDOList.stream().filter(f -> f.getRecheckBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).findFirst().orElse(null); + if (businessSubSampleParentRecheckDO != null) { + + List businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId()); + StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder(); + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentExtendBeforeList) { + subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName()); + subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue()); + businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentExtendRespVO.getId()).append(","); + } + businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length()); + subSampleAssessmentBeforeMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); + subSampleAssessmentBeforeMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIdsBefore.toString()); + + dataList.add(subSampleAssessmentBeforeMap); + } + + + List businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList()); + StringBuilder businessSubSampleAssessmentIds = new StringBuilder(); + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentList) { + subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName()); + subSampleAssessmentMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue()); + businessSubSampleAssessmentIds.append(businessSubSampleAssessmentExtendRespVO.getId()).append(","); + } + businessSubSampleAssessmentIds.delete(businessSubSampleAssessmentIds.length() -1, businessSubSampleAssessmentIds.length()); + subSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString()); + subSampleAssessmentMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIds.toString()); + + dataList.add(subSampleAssessmentMap); + } + + + /** + + List businessSubParentSampleIdList = businessSubParentSampleAssessmentDOList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList()); + + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId); + + + + for (BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO : businessSubParentSampleAssessmentDOList) { + //Map dataMap = new HashMap<>(); + Map dataMap = BeanUtil.beanToMap(businessSubParentSampleAssessmentDO); + + + dataList.add(dataMap); + } + **/ + + + + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + return json; + } + + + @Override + public List getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) { + //查询检查项目 + List list = businessSubParentSampleAssessmentMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId); + //过滤默认的 + List resultList = list.stream().filter(f -> f.getIsRecheckDefault() != null && f.getIsRecheckDefault().equals(QmsCommonConstant.YES)).collect(Collectors.toList()); + for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : resultList) { + List methodList = new ArrayList<>(); + //根据检查项目过滤方法 + List projectMethodList = list.stream().filter(f -> f.getDictionaryProjectId().equals(recheckSubSampleParentMethodRespVO.getDictionaryProjectId())).collect(Collectors.toList()); + for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethod : projectMethodList) { + ConfigAssayMethodRespVO configAssayMethodRespVO = new ConfigAssayMethodRespVO(); + configAssayMethodRespVO.setId(recheckSubSampleParentMethod.getConfigAssayMethodId()); + configAssayMethodRespVO.setName(recheckSubSampleParentMethod.getConfigAssayMethodName()); + methodList.add(configAssayMethodRespVO); + } + recheckSubSampleParentMethodRespVO.setMethodList(methodList); + } + + return resultList; + } + + @Resource + private BaseSampleMapper baseSampleMapper; + + @Resource + private ConfigSubSampleMethodMapper configSubSampleMethodMapper; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Resource + private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper; + + + @Override + @Transactional(rollbackFor = Exception.class) + public void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO) { + + List newBusinessAssayTaskDataDOList = new ArrayList<>(); + List newBusinessAssayProjectDataDOList = new ArrayList<>(); + List newBusinessAssayParameterDataDOList = new ArrayList<>(); + List newBusinessSubSampleParentRecheckDOList = new ArrayList<>(); + + //获取分析任务数 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId()); + List businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList()); + + //获取子样 + List businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds); + + for (BusinessSubSampleDO businessSubSampleDO : businessSubSampleDOList) { + + //复检的检测项目 + List recheckProjectList = reqVO.getRecheckProjectList(); + + //根据方法分组 + Map> recheckProjectMap = recheckProjectList.stream().collect(Collectors.groupingBy(RecheckSubSampleParentMethodRespVO::getConfigAssayMethodId)); + + BusinessAssayTaskDataDO businessAssayTaskDataDO = null; + for (Map.Entry> entry : recheckProjectMap.entrySet()) { + Long configAssayMethodId = entry.getKey(); + List projectList = entry.getValue(); + + BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = new BusinessSubSampleParentRecheckDO(); + businessSubSampleParentRecheckDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleParentRecheckDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleParentRecheckDO.setConfigAssayMethodId(reqVO.getConfigAssayMethodId()); + businessSubSampleParentRecheckDO.setRecheckBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessSubSampleParentRecheckDO.setRecheckBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessSubSampleParentRecheckDO.setRecheckConfigAssayMethodId(configAssayMethodId); + + newBusinessSubSampleParentRecheckDOList.add(businessSubSampleParentRecheckDO); + + //查询分析方法 + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(configAssayMethodId); + ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId); + + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + + //根据任务数判断是平行还是 + String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP; + + //根据任务数循环 + for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) { + //子样检测任务 + businessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + businessAssayTaskDataDO.setId(IdWorker.getId()); + businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); + businessAssayTaskDataDO.setAssayType(assayType); + businessAssayTaskDataDO.setTaskType("复测"); + businessAssayTaskDataDO.setConfigSampleFlowId(businessSubSampleDO.getConfigSampleFlowId()); + businessAssayTaskDataDO.setSampleFlowNodeKey(businessSubSampleDO.getSampleFlowNodeKey()); + businessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now()); + businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + + + StringBuilder assayProjectBuilder = new StringBuilder(); + + for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : projectList) { + ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getDictionaryProjectId().equals(recheckSubSampleParentMethodRespVO.getDictionaryProjectId())).findFirst().orElse(null); + + assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(","); + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + + newBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodId); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + newBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + + assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); + businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString()); + newBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO); + } + + } + } + if (CollUtil.isNotEmpty(newBusinessAssayTaskDataDOList)) { + businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList); + } + if (CollUtil.isNotEmpty(newBusinessAssayProjectDataDOList)) { + businessAssayProjectDataMapper.insertBatch(newBusinessAssayProjectDataDOList); + } + if (CollUtil.isNotEmpty(newBusinessAssayParameterDataDOList)) { + businessAssayParameterDataMapper.insertBatch(newBusinessAssayParameterDataDOList); + } + if (CollUtil.isNotEmpty(newBusinessSubSampleParentRecheckDOList)) { + businessSubSampleParentRecheckMapper.insertBatch(newBusinessSubSampleParentRecheckDOList); + } + } + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Resource + private ConfigSampleReportMapper configSampleReportMapper; + + @Resource + private ConfigReportFieldMapper configReportFieldMapper; + + @Resource + private ConfigProjectMapper configProjectMapper; + + @Resource + private BusinessBaseSampleMapper businessBaseSampleMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void batchResultDataReporting(BatchResultDataReportingReqVO reqVO) { + + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + + List saveBusinessAssayReportDataDOList = new ArrayList<>(); + List updateBusinessAssayReportDataDOList = new ArrayList<>(); + + List businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId()); + + List businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds()); + + for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) { + + BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessSubParentSampleDO.getBusinessBaseSampleId()); + + //查询报表 + List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubParentSampleDO.getBusinessBaseSampleId()); + + ConfigSampleReportReqVO configSampleReportSearch = new ConfigSampleReportReqVO(); + configSampleReportSearch.setConfigBaseSampleId(businessBaseSampleDO.getConfigBaseSampleId()); + List configSampleReportList = configSampleReportMapper.selectList(configSampleReportSearch); + + List configReportTypeIdList = configSampleReportList.stream().map(m -> m.getConfigReportTypeId()).collect(Collectors.toList()); + + //查询动态和计算的报表字段 + List configReportFieldList = configReportFieldMapper.selectByConfigReportTypeIds(configReportTypeIdList, Arrays.asList(QmsCommonConstant.FIELD_DYNAMIC, QmsCommonConstant.FIELD_CALCULATED)); + //动态报表字段 + List configReportFieldDynamicList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_DYNAMIC.equals(f.getFieldType())).collect(Collectors.toList()); + //根据检测方法查询字段配置 + List configProjectList = configProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId()); + + + for (ConfigSampleReportExtendRespVO configSampleReport : configSampleReportList) { + BusinessAssayReportDataDO businessAssayReportDataDO = businessAssayReportDataDOList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getConfigSampleReportId().equals(configSampleReport.getId())).findFirst().orElse(null); + if (businessAssayReportDataDO == null) { + businessAssayReportDataDO = new BusinessAssayReportDataDO(); + businessAssayReportDataDO.setBusinessBaseSampleId(businessSubParentSampleDO.getBusinessBaseSampleId()); + businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId()); + businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId()); + businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + + saveBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } else { + updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } + JSONObject assayDataJson = new JSONObject(); + String assayData = businessAssayReportDataDO.getAssayData(); + if (StringUtils.isNotBlank(assayData)) { + assayDataJson = JSON.parseObject(assayData); + } + //循环判定值 + List businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList()); + for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) { + Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId(); + List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); + for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { + //查询动态报表字段 + ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null); + + if (configReportField == null) { + continue; + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); + reportFieldValueData.setFieldName(configReportField.getFieldName()); + reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue()); + reportFieldValueData.setDataType(configReportField.getDataType()); + reportFieldValueData.setDecimalPosition(configReportField.getDecimalPosition()); + reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit()); + reportFieldValueData.setUsage(businessSubParentSampleAssessment.getUsage()); + reportFieldValueData.setMinLimitValue(businessSubParentSampleAssessment.getMinimumLimitValue()); + reportFieldValueData.setMethodName(businessSubParentSampleAssessment.getConfigAssayMethodName()); + assayDataJson.put(configReportField.getField(), reportFieldValueData); + } + } + businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString()); + + //修改已上报数据来源 + String dataSource = businessAssayReportDataDO.getDataSource(); + Set dataSources = StringUtils.isBlank(dataSource) ? new HashSet<>() : new HashSet<>(Arrays.asList(dataSource.split(","))); + String reportedSource = businessAssayReportDataDO.getReportedSource(); + ReportedDataSource reportedDataSource = null; + if (StringUtils.isNotBlank(reportedSource)) { + reportedDataSource = JSON.parseObject(reportedSource, ReportedDataSource.class); + } else { + reportedDataSource = new ReportedDataSource(); + } + reportedDataSource.addDataSource(reqVO.getConfigAssayMethodId().toString(), nickName, LocalDateTime.now()); + Set busDataSources = reportedDataSource.getDetails().stream().map(m -> m.getSourceCode()).collect(Collectors.toSet()); + if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) { + businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES); + } + if (busDataSources.size() > 0) { + //计算 + // TODO + } + businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource)); + + } + } + + if (saveBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList); + } + if (updateBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); + } + + List businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper() + .set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) + .set(BusinessSubParentSampleAssessmentDO::getReporter, nickName) + .set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now()) + .in(BusinessSubParentSampleAssessmentDO::getId, businessSubParentSampleAssessmentIdList)); + } + + @Override + public JSONObject getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId) { + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO) { + List businessSubParentSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubParentSampleAssessmentIds().split(",")); + List businessSubSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubSampleAssessmentIds().split(",")); + List businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByIds(businessSubParentSampleAssessmentIdList); + List businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByIds(businessSubSampleAssessmentIdList); + for (BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO : businessSubParentSampleAssessmentDOList) { + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentDO.getDictionaryProjectId())).findFirst().orElse(null); + businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessmentDO.getAssessmentValue()); + } + businessSubParentSampleAssessmentMapper.updateBatch(businessSubParentSampleAssessmentDOList); + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java new file mode 100644 index 0000000..b287b5e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignService.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.util.List; + +import com.yomahub.liteflow.flow.LiteflowResponse; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam; +import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; + +public interface SampleTaskAssignService { + + /** + * 获取分配用户列表 + * @return + */ + List getAssignUserList(); + + /** + * 获取未指派任务子样信息 + * @return + */ + List getAssaySampleList(); + + /** + * 根据子样id查询分析方法 + * @param businessSubSampleId + * @param configAssayMethodId + * @return + */ + List getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId); + + /** + * 修改分析方法 + * @param req + */ + void changeMethod(ChangeAssayMethodReqVO req); + + /** + * 按方法分配任务 + * @param param + */ + LiteflowResponse methodAssign(SampleTaskAssignMethodParam param); + + /** + * 按样品分配任务 + * @param param + */ + LiteflowResponse sampleAssign(SampleTaskAssignSampleParam param); + + /** + * 手动分配任务 + * @param param + * @return + */ + LiteflowResponse manualAssign(SampleTaskAssignManualParam param); + + /** + * 提交任务单 + * @param id + */ + void submitAssign(Long id); + + /** + * 作废任务单 + * @param id + */ + void voidAssign(Long id); + + /** + * 批量删除指派明细 + * @param req + */ + void removeAssignTaskDetail(BatchDeleteReqVO req); + + /** + * 创建质控样 + * @param req + */ + void createQcSample(CreateQcSampleReqVO req); + + /** + * 删除质控样 + * @param req + */ + void deleteQcSample(DeleteQcSampleReqVO req); + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java new file mode 100644 index 0000000..fc4c815 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleTaskAssignServiceImpl.java @@ -0,0 +1,633 @@ +package com.zt.plat.module.qms.business.bus.service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.yomahub.liteflow.core.FlowExecutor; +import com.yomahub.liteflow.flow.LiteflowResponse; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCParameterDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCParameterDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam; +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam; +import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodParameterMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper; +import com.zt.plat.module.qms.business.dic.dal.mapper.DictionaryProjectMapper; +import com.zt.plat.module.qms.core.code.SequenceUtil; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.system.api.dept.DeptApi; +import com.zt.plat.module.system.api.dept.dto.DeptRespDTO; +import com.zt.plat.module.system.api.user.AdminUserApi; +import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class SampleTaskAssignServiceImpl implements SampleTaskAssignService { + + @Resource + private FlowExecutor flowExecutor; + + @Resource + private AdminUserApi adminUserApi; + + @Resource + private DeptApi deptApi; + + @Resource + private SequenceUtil sequenceUtil; + + @Resource + private BusinessAssayTaskMapper businessAssayTaskMapper; + + @Resource + private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper; + + @Resource + private BusinessSubSampleMapper businessSubSampleMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Resource + private BusinessAssayParameterDataMapper businessAssayParameterDataMapper; + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Resource + private ConfigSubSampleMethodMapper configSubSampleMethodMapper; + + @Resource + private ConfigAssayMethodMapper configAssayMethodMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + @Resource + private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper; + + @Resource + private DictionaryProjectMapper dictionaryProjectMapper; + + @Resource + private ConfigQCSampleMethodMapper configQCSampleMethodMapper; + + @Resource + private ConfigQCSampleMethodParameterMapper configQCSampleMethodParameterMapper; + + @Resource + private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper; + + @Resource + private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper; + + @Resource + private BusinessQCManagementDataMapper businessQCManagementDataMapper; + + @Resource + private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper; + + @Resource + private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper; + + @Override + public List getAssignUserList() { + //当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long visitDeptId = loginUser.getVisitDeptId(); + //当前部门及子部门id + List deptIdList = new ArrayList<>(); + deptIdList.add(visitDeptId); + //获取子部门 + CommonResult> childDeptListResult = deptApi.getChildDeptList(visitDeptId); + if (childDeptListResult.isSuccess()) { + List childDeptList = childDeptListResult.getData(); + if (CollUtil.isNotEmpty(childDeptList)) { + List childDeptIdList = childDeptList.stream().map(m -> m.getId()).collect(Collectors.toList()); + deptIdList.addAll(childDeptIdList); + } + } + CommonResult> userListResult = adminUserApi.getUserListByDeptIds(deptIdList); + return userListResult.getCheckedData(); + } + + @Override + public List getAssaySampleList() { + List list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(); + return list; + } + + @Override + public List getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) { + List resutList = new ArrayList<>(); + //当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long visitDeptId = loginUser.getVisitDeptId(); + + //子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId); + //原检测项目 + List oldConfigAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + //原检测项目字典id列表 + List oldDictionaryProjectIdList = oldConfigAssayMethodProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList()); + + + //子样对应的检测任务 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleId(businessSubSampleId); + + //查询子样配置的方法 + List configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdAndAssayDepartmentId(businessSubSampleDO.getConfigSubSampleId(), visitDeptId); + + JSONObject jsonObject = null; + for (ConfigSubSampleMethodExtendRespVO configSubSampleMethod : configSubSampleMethodList) { + jsonObject = new JSONObject(); + jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId()); + jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName()); + jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode()); + + StringBuilder assayProjectBuilder = new StringBuilder(); + List configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configSubSampleMethod.getConfigAssayMethodId()); + + //判定是否存在原检测项目 + boolean isExistProject = configAssayMethodProjectList.stream().anyMatch(m -> oldDictionaryProjectIdList.contains(m.getDictionaryProjectId())); + if (!isExistProject) {//如果不存在,则跳出循环 + continue; + } + + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectList) { + assayProjectBuilder.append(configAssayMethodProject.getShowName()).append(","); + } + assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length()); + + jsonObject.put("assayProject", assayProjectBuilder.toString()); + + boolean checked = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId())); + boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()) && m.getIsAssignTasked().equals(QmsCommonConstant.YES)); + jsonObject.put("checked", checked); + jsonObject.put("disabled", disabled); + + resutList.add(jsonObject); + } + + return resutList; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void changeMethod(ChangeAssayMethodReqVO req) { + + List updateBusinessAssayReportDataDOList = new ArrayList<>(); + List saveBusinessAssayTaskDataDOList = new ArrayList<>(); + List saveBusinessAssayProjectDataDOList = new ArrayList<>(); + List saveBusinessAssayParameterDataDOList = new ArrayList<>(); + + List removeProjectIdList = new ArrayList<>(); + List removeParameterIdList = new ArrayList<>(); + //子样 + BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(req.getBusinessSubSampleId()); + + //查询检测任务 + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleDO.getBusinessSubParentSampleId(), req.getConfigAssayMethodId()); + + boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES)); + if (disabled) { + throw new ServiceException(10010, "当前样品存在已分配任务,不允许修改分析方法"); + } + //查询报表数据 + List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) { + String dataSource = businessAssayReportDataDO.getDataSource(); + if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在 + List dataSourceList = new ArrayList<>(); + String[] dataSourceSplit = dataSource.split(","); + for (int i = 0; i < dataSourceSplit.length; i++) { + dataSourceList.add(Long.parseLong(dataSourceSplit[i])); + } + //移除当前的 + dataSourceList.remove(req.getConfigAssayMethodId()); + //添加新的 + dataSourceList.addAll(req.getChangeConfigAssayMethodIdList()); + + //重新赋值 + businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ",")); + + //添加到更新列表 + updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } + + } + + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + //查询旧的 + List businessAssayProjectDataExtendRespVOs = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + List businessAssayProjectDataIdList = businessAssayProjectDataExtendRespVOs.stream().map(m -> m.getId()).collect(Collectors.toList()); + removeProjectIdList.addAll(businessAssayProjectDataIdList); + List businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList); + List businessAssayParameterDataDOIdList = businessAssayParameterDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList()); + removeParameterIdList.addAll(businessAssayParameterDataDOIdList); + + int i = 0; + for (Long configAssayMethodId : req.getChangeConfigAssayMethodIdList()) { + Long businessAssayTaskDataId = null; + if (i == 0) { + businessAssayTaskDataId = businessAssayTaskDataDO.getId(); + businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); + } else { + businessAssayTaskDataId = IdWorker.getId(); + BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = new BusinessAssayTaskDataDO(); + newBusinessAssayTaskDataDO.setId(businessAssayTaskDataId); + newBusinessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId()); + newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId()); + newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId()); + newBusinessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId); + newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId()); + newBusinessAssayTaskDataDO.setSampleFlowNodeKey(businessAssayTaskDataDO.getSampleFlowNodeKey()); + newBusinessAssayTaskDataDO.setSampleFlowNodeTime(businessAssayTaskDataDO.getSampleFlowNodeTime()); + newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId()); + newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName()); + + saveBusinessAssayTaskDataDOList.add(newBusinessAssayTaskDataDO); + } + + //查询新的检测项目 + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + + StringBuilder assayProjectBuilder = new StringBuilder(); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) { + assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(","); + + //检测项目 + BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO(); + businessAssayProjectDataDO.setId(IdWorker.getId()); + businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId()); + businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId()); + businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType()); + businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition()); + businessAssayProjectDataDO.setIsEnabled(1); + businessAssayProjectDataDO.setIsNotAssessment(0); + + saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO); + + List configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodProjectDO.getId()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) { + BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO(); + businessAssayParameterDataDO.setId(IdWorker.getId()); + businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId()); + businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + + saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO); + } + } + + i++; + } + + + } + + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + businessAssayProjectDataMapper.deleteByIds(removeProjectIdList); + businessAssayParameterDataMapper.deleteByIds(removeParameterIdList); + //更新报表数据来源 + if (updateBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); + } + if (saveBusinessAssayTaskDataDOList.size() > 0) { + businessAssayTaskDataMapper.insertBatch(saveBusinessAssayTaskDataDOList); + } + if (saveBusinessAssayProjectDataDOList.size() > 0) { + businessAssayProjectDataMapper.insertBatch(saveBusinessAssayProjectDataDOList); + } + if (saveBusinessAssayParameterDataDOList.size() > 0) { + businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) { + if (param.getConfigAssayMethodId() == null) { + throw new ServiceException(1_032_100_000, "无分析方法"); + } + if (CollUtil.isEmpty(param.getAssignAssayUserList())) { + throw new ServiceException(1_032_100_000, "无任务分配人员"); + } + Long tenantId = TenantContextHolder.getRequiredTenantId(); + LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class); + if (!response.isSuccess()){ + log.error("按方法分配任务失败", response.getCause()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); + } + return response; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public LiteflowResponse sampleAssign(SampleTaskAssignSampleParam param) { + if (param.getAssignAssayUser() == null) { + throw new ServiceException(1_032_100_000, "无任务分配人员"); + } + if (CollUtil.isEmpty(param.getAssignSampleIdList())) { + throw new ServiceException(1_032_100_000, "无任务分配样品"); + } + Long tenantId = TenantContextHolder.getRequiredTenantId(); + LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class); + if (!response.isSuccess()){ + log.error("按样品分配任务失败", response.getCause()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); + } + return response; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public LiteflowResponse manualAssign(SampleTaskAssignManualParam param) { + if (param.getAssignAssayUser() == null) { + throw new ServiceException(1_032_100_000, "无任务分配人员"); + } + if (CollUtil.isEmpty(param.getAssayTaskDataIdList())) { + throw new ServiceException(1_032_100_000, "无分配的检测任务"); + } + Long tenantId = TenantContextHolder.getRequiredTenantId(); + LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class); + if (!response.isSuccess()){ + log.error("手动分配任务失败", response.getCause()); + throw new ServiceException(1_032_100_000, response.getCause().getMessage()); + } + return response; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void submitAssign(Long id) { + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(id); + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.SUBMITTED); + businessAssayTaskDO.setTaskAssignSubmitTime(LocalDateTime.now()); + businessAssayTaskMapper.updateById(businessAssayTaskDO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void voidAssign(Long id) { + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(id); + if (QmsCommonConstant.SUBMITTED.equals(businessAssayTaskDO.getTaskAssignStatus())) { + throw new ServiceException(1_032_100_000, "任务已提交,不允许作废"); + } + businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.VOID); + + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId())); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setAssayOperator(null); + businessAssayTaskDataDO.setAssignTaskTime(null); + businessAssayTaskDataDO.setIsAssignTasked(0); + } + businessAssayTaskMapper.updateById(businessAssayTaskDO); + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void removeAssignTaskDetail(BatchDeleteReqVO req) { + List businessAssayTaskDetailDOList = businessAssayTaskDetailMapper.selectByIds(req.getIds()); + List businessAssayTaskDataIdList = businessAssayTaskDetailDOList.stream().map(m -> m.getBusinessAssayTaskDataId()).collect(Collectors.toList()); + List businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByIds(businessAssayTaskDataIdList); + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setIsAssignTasked(QmsCommonConstant.NO); + businessAssayTaskDataDO.setAssignTaskTime(null); + businessAssayTaskDataDO.setAssayOperator(null); + businessAssayTaskDataDO.setBusinessAssayTaskId(null); + } + //更新检测任务 + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); + + //删除任务单明细数据 + businessAssayTaskDetailMapper.physicalDeleteByIds(req.getIds()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void createQcSample(CreateQcSampleReqVO req) { + List businessQCManagementDataDOList = new ArrayList<>(); + List businessQCManagementProjectDataDOList = new ArrayList<>(); + List businessQCManagementParameterDataDOList = new ArrayList<>(); + + List businessQCCoefficientDataDOList = new ArrayList<>(); + List businessQCCoefficientParameterDataDOList = new ArrayList<>(); + + //分配任务 + BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(req.getBusinessAssayTaskId()); + + //分析方法 + ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId()); + + ConfigQCSampleMethodExtendRespVO configQCSampleMethod = configQCSampleMethodMapper.selectByConfigAssayMethodIdAndDictionaryBusinessKey(businessAssayTaskDO.getConfigAssayMethodId(), req.getDictionaryBusinessKey()); + + if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + + BusinessQCCoefficientDataDO businessQCCoefficientDataDO = new BusinessQCCoefficientDataDO(); + businessQCCoefficientDataDO.setId(IdWorker.getId()); + businessQCCoefficientDataDO.setBusinessAssayTaskId(businessAssayTaskDO.getId()); + businessQCCoefficientDataDO.setConfigAssayMethodId(configQCSampleMethod.getConfigAssayMethodId()); + businessQCCoefficientDataDO.setSampleName(configQCSampleMethod.getDictionaryBusinessName()); + if (StringUtils.isNotBlank(req.getSampleName())) { + businessQCCoefficientDataDO.setSampleName(req.getSampleName()); + } + if (StringUtils.isNotBlank(req.getSampleCode())) { + businessQCCoefficientDataDO.setSampleCode(req.getSampleCode()); + } else { + if (StringUtils.isNotBlank(configQCSampleMethod.getCodeRule())) { + String codeSample = sequenceUtil.genCode(configQCSampleMethod.getCodeRule()); + businessQCCoefficientDataDO.setSampleCode(codeSample); + } + } + businessQCCoefficientDataDO.setDictionaryBusinessId(configQCSampleMethod.getDictionaryBusinessId()); + businessQCCoefficientDataDO.setDictionaryBusinessKey(configQCSampleMethod.getDictionaryBusinessKey()); + businessQCCoefficientDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessQCCoefficientDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessQCCoefficientDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCCoefficientDataDO.setAssayProject(""); + businessQCCoefficientDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); + businessQCCoefficientDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessQCCoefficientDataDO.setIsReported(QmsCommonConstant.NO); + + businessQCCoefficientDataDOList.add(businessQCCoefficientDataDO); + + List configQCSampleMethodParameterExtendRespVOs = configQCSampleMethodParameterMapper.selectByConfigQCSampleMethodId(configQCSampleMethod.getId()); + for (ConfigQCSampleMethodParameterExtendRespVO configQCSampleMethodParameterExtendRespVO : configQCSampleMethodParameterExtendRespVOs) { + BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = new BusinessQCCoefficientParameterDataDO(); + businessQCCoefficientParameterDataDO.setBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId()); + businessQCCoefficientParameterDataDO.setConfigQCSampleMethodParameterId(configQCSampleMethodParameterExtendRespVO.getId()); + businessQCCoefficientParameterDataDO.setDictionaryParameterId(configQCSampleMethodParameterExtendRespVO.getDictionaryParameterId()); + businessQCCoefficientParameterDataDO.setDataType(configQCSampleMethodParameterExtendRespVO.getDataType()); + businessQCCoefficientParameterDataDO.setDecimalPosition(configQCSampleMethodParameterExtendRespVO.getDecimalPosition()); + businessQCCoefficientParameterDataDO.setValue(configQCSampleMethodParameterExtendRespVO.getDefaultValue()); + + businessQCCoefficientParameterDataDOList.add(businessQCCoefficientParameterDataDO); + } + + } else {//管理样与标准样 + //分析项目 + List configAssayMethodProjectExtendRespList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + List configAssayMethodProjectIds = configAssayMethodProjectExtendRespList.stream().map(m -> m.getId()).collect(Collectors.toList()); + //分析项目参数 + List configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectIds(configAssayMethodProjectIds); + //分析项目 + String assayProject = configAssayMethodProjectExtendRespList.stream().map(m -> m.getShowName()).collect(Collectors.joining(",")); + + BusinessQCManagementDataDO businessQCManagementDataDO = new BusinessQCManagementDataDO(); + businessQCManagementDataDO.setId(IdWorker.getId()); + businessQCManagementDataDO.setBusinessAssayTaskId(req.getBusinessAssayTaskId()); + businessQCManagementDataDO.setConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId()); + businessQCManagementDataDO.setSampleName(req.getSampleName()); + if (StringUtils.isNotBlank(req.getSampleCode())) { + businessQCManagementDataDO.setSampleCode(req.getSampleCode()); + } + businessQCManagementDataDO.setBusinessStandardSampleId(req.getBusinessStandardSampleId()); + businessQCManagementDataDO.setDictionaryBusinessId(req.getDictionaryBusinessId()); + businessQCManagementDataDO.setDictionaryBusinessKey(req.getDictionaryBusinessKey()); + businessQCManagementDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId()); + businessQCManagementDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName()); + businessQCManagementDataDO.setAssayOperator(businessAssayTaskDO.getAssayOperator()); + businessQCManagementDataDO.setAssayProject(assayProject); + businessQCManagementDataDO.setAssignTaskTime(businessAssayTaskDO.getTaskAssignTime()); + businessQCManagementDataDO.setIsAssignTasked(QmsCommonConstant.YES); + businessQCManagementDataDO.setIsReported(QmsCommonConstant.NO); + + businessQCManagementDataDOList.add(businessQCManagementDataDO); + + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectExtendRespVO : configAssayMethodProjectExtendRespList) { + BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = new BusinessQCManagementProjectDataDO(); + businessQCManagementProjectDataDO.setId(IdWorker.getId()); + businessQCManagementProjectDataDO.setBusinessQCManagementDataId(businessQCManagementDataDO.getId()); + businessQCManagementProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectExtendRespVO.getId()); + businessQCManagementProjectDataDO.setDictionaryProjectId(configAssayMethodProjectExtendRespVO.getDictionaryProjectId()); + businessQCManagementProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_QUALITY_CONTROL); + businessQCManagementProjectDataDO.setSymbol("="); + businessQCManagementProjectDataDO.setDataType(configAssayMethodProjectExtendRespVO.getDataType()); + businessQCManagementProjectDataDO.setDecimalPosition(configAssayMethodProjectExtendRespVO.getDecimalPosition()); + businessQCManagementProjectDataDO.setIsEnabled(configAssayMethodProjectExtendRespVO.getIsDefaultEnabled()); + + businessQCManagementProjectDataDOList.add(businessQCManagementProjectDataDO); + + List configAssayMethodProjectParameterDoList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectExtendRespVO.getId())).collect(Collectors.toList()); + for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDoList) { + BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = new BusinessQCManagementParameterDataDO(); + businessQCManagementParameterDataDO.setBusinessQCManagementProjectDataId(businessQCManagementProjectDataDO.getId()); + businessQCManagementParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId()); + businessQCManagementParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId()); + businessQCManagementParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType()); + businessQCManagementParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition()); + + businessQCManagementParameterDataDOList.add(businessQCManagementParameterDataDO); + } + + } + + } + + if (CollUtil.isNotEmpty(businessQCManagementDataDOList)) { + businessQCManagementDataMapper.insertBatch(businessQCManagementDataDOList); + } + if (CollUtil.isNotEmpty(businessQCManagementProjectDataDOList)) { + businessQCManagementProjectDataMapper.insertBatch(businessQCManagementProjectDataDOList); + } + if (CollUtil.isNotEmpty(businessQCManagementParameterDataDOList)) { + businessQCManagementParameterDataMapper.insertBatch(businessQCManagementParameterDataDOList); + } + if (CollUtil.isNotEmpty(businessQCCoefficientDataDOList)) { + businessQCCoefficientDataMapper.insertBatch(businessQCCoefficientDataDOList); + } + if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataDOList)) { + businessQCCoefficientParameterDataMapper.insertBatch(businessQCCoefficientParameterDataDOList); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteQcSample(DeleteQcSampleReqVO req) { + if ("kby".equals(req.getDictionaryBusinessKey()) || "by".equals(req.getDictionaryBusinessKey())) {//空白样和标样 + businessQCCoefficientDataMapper.deleteByIds(req.getQcSampleIdList()); + businessQCCoefficientParameterDataMapper.delete(new LambdaQueryWrapperX().in(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, req.getQcSampleIdList())); + } else { //管理样和标准样 + businessQCManagementDataMapper.deleteByIds(req.getQcSampleIdList()); + List businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(req.getQcSampleIdList()); + List businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); + businessQCManagementProjectDataMapper.deleteByIds(businessQCManagementProjectDataIdList); + businessQCManagementParameterDataMapper.delete(new LambdaQueryWrapperX().in(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, businessQCManagementProjectDataIdList)); + } + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java index dbf5cf8..00e7fc2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/BaseSampleController.java @@ -45,14 +45,14 @@ public class BaseSampleController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建样品大类管理") - @PreAuthorize("@ss.hasPermission('qms:base-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:create')") public CommonResult createBaseSample(@Valid @RequestBody BaseSampleSaveReqVO createReqVO) { return success(baseSampleService.createBaseSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品大类管理") - @PreAuthorize("@ss.hasPermission('qms:base-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:update')") public CommonResult updateBaseSample(@Valid @RequestBody BaseSampleSaveReqVO updateReqVO) { baseSampleService.updateBaseSample(updateReqVO); return success(true); @@ -61,7 +61,7 @@ public class BaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除样品大类管理") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:delete')") public CommonResult deleteBaseSample(@RequestParam("id") Long id) { baseSampleService.deleteBaseSample(id); return success(true); @@ -70,7 +70,7 @@ public class BaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品大类管理") - @PreAuthorize("@ss.hasPermission('qms:base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:delete')") public CommonResult deleteBaseSampleList(@RequestBody BatchDeleteReqVO req) { baseSampleService.deleteBaseSampleListByIds(req.getIds()); return success(true); @@ -79,7 +79,7 @@ public class BaseSampleController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得样品大类管理") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:query')") public CommonResult getBaseSample(@RequestParam("id") Long id) { BaseSampleDO baseSample = baseSampleService.getBaseSample(id); return success(BeanUtils.toBean(baseSample, BaseSampleRespVO.class)); @@ -94,7 +94,7 @@ public class BaseSampleController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得样品大类管理分页") - @PreAuthorize("@ss.hasPermission('qms:base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:query')") public CommonResult> getBaseSamplePage(@Valid BaseSamplePageReqVO pageReqVO) { PageResult pageResult = baseSampleService.getBaseSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class)); @@ -102,7 +102,7 @@ public class BaseSampleController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出样品大类管理 Excel") - @PreAuthorize("@ss.hasPermission('qms:base-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:base-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportBaseSampleExcel(@Valid BaseSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java index 244ec1b..98c088c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodController.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.*; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +44,14 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:create')") public CommonResult createConfigAssayMethod(@Valid @RequestBody ConfigAssayMethodSaveReqVO createReqVO) { return success(configAssayMethodService.createConfigAssayMethod(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:update')") public CommonResult updateConfigAssayMethod(@Valid @RequestBody ConfigAssayMethodSaveReqVO updateReqVO) { configAssayMethodService.updateConfigAssayMethod(updateReqVO); return success(true); @@ -60,7 +60,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除检测方法配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:delete')") public CommonResult deleteConfigAssayMethod(@RequestParam("id") Long id) { configAssayMethodService.deleteConfigAssayMethod(id); return success(true); @@ -69,7 +69,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:delete')") public CommonResult deleteConfigAssayMethodList(@RequestBody BatchDeleteReqVO req) { configAssayMethodService.deleteConfigAssayMethodListByIds(req.getIds()); return success(true); @@ -78,7 +78,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得检测方法配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") public CommonResult getConfigAssayMethod(@RequestParam("id") Long id) { ConfigAssayMethodDO configAssayMethod = configAssayMethodService.getConfigAssayMethod(id); return success(BeanUtils.toBean(configAssayMethod, ConfigAssayMethodRespVO.class)); @@ -86,7 +86,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @GetMapping("/list") @Operation(summary = "获得检测方法配置列表") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") public CommonResult> getConfigAssayMethodList(@Valid ConfigAssayMethodReqVO reqVO) { List listResult = configAssayMethodService.getConfigAssayMethodList(reqVO); return success(listResult); @@ -94,7 +94,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得检测方法配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:query')") public CommonResult> getConfigAssayMethodPage(@Valid ConfigAssayMethodPageReqVO pageReqVO) { PageResult pageResult = configAssayMethodService.getConfigAssayMethodPage(pageReqVO); return success(pageResult); @@ -102,7 +102,7 @@ public class ConfigAssayMethodController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出检测方法配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigAssayMethodExcel(@Valid ConfigAssayMethodPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java new file mode 100644 index 0000000..376c3ad --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectAssessmentController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodProjectAssessmentService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测方法分析项目判定") +@RestController +@RequestMapping("/qms/config-assay-method-project-assessment") +@Validated +public class ConfigAssayMethodProjectAssessmentController implements BusinessControllerMarker { + + + @Resource + private ConfigAssayMethodProjectAssessmentService configAssayMethodProjectAssessmentService; + + @PostMapping("/create") + @Operation(summary = "创建检测方法分析项目判定") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:create')") + public CommonResult createConfigAssayMethodProjectAssessment(@Valid @RequestBody ConfigAssayMethodProjectAssessmentSaveReqVO createReqVO) { + return success(configAssayMethodProjectAssessmentService.createConfigAssayMethodProjectAssessment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测方法分析项目判定") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:update')") + public CommonResult updateConfigAssayMethodProjectAssessment(@Valid @RequestBody ConfigAssayMethodProjectAssessmentSaveReqVO updateReqVO) { + configAssayMethodProjectAssessmentService.updateConfigAssayMethodProjectAssessment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测方法分析项目判定") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:delete')") + public CommonResult deleteConfigAssayMethodProjectAssessment(@RequestParam("id") Long id) { + configAssayMethodProjectAssessmentService.deleteConfigAssayMethodProjectAssessment(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测方法分析项目判定") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:delete')") + public CommonResult deleteConfigAssayMethodProjectAssessmentList(@RequestBody BatchDeleteReqVO req) { + configAssayMethodProjectAssessmentService.deleteConfigAssayMethodProjectAssessmentListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测方法分析项目判定") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:query')") + public CommonResult getConfigAssayMethodProjectAssessment(@RequestParam("id") Long id) { + ConfigAssayMethodProjectAssessmentDO configAssayMethodProjectAssessment = configAssayMethodProjectAssessmentService.getConfigAssayMethodProjectAssessment(id); + return success(BeanUtils.toBean(configAssayMethodProjectAssessment, ConfigAssayMethodProjectAssessmentRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测方法分析项目判定分页") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:query')") + public CommonResult> getConfigAssayMethodProjectAssessmentPage(@Valid ConfigAssayMethodProjectAssessmentPageReqVO pageReqVO) { + PageResult pageResult = configAssayMethodProjectAssessmentService.getConfigAssayMethodProjectAssessmentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigAssayMethodProjectAssessmentRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测方法分析项目判定 Excel") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-assessment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigAssayMethodProjectAssessmentExcel(@Valid ConfigAssayMethodProjectAssessmentPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configAssayMethodProjectAssessmentService.getConfigAssayMethodProjectAssessmentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测方法分析项目判定.xls", "数据", ConfigAssayMethodProjectAssessmentRespVO.class, + BeanUtils.toBean(list, ConfigAssayMethodProjectAssessmentRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java new file mode 100644 index 0000000..6faf4a3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectCoefficientController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; +import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodProjectCoefficientService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测方法分析项目补正系数") +@RestController +@RequestMapping("/qms/config-assay-method-project-coefficient") +@Validated +public class ConfigAssayMethodProjectCoefficientController implements BusinessControllerMarker { + + + @Resource + private ConfigAssayMethodProjectCoefficientService configAssayMethodProjectCoefficientService; + + @PostMapping("/create") + @Operation(summary = "创建检测方法分析项目补正系数") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:create')") + public CommonResult createConfigAssayMethodProjectCoefficient(@Valid @RequestBody ConfigAssayMethodProjectCoefficientSaveReqVO createReqVO) { + return success(configAssayMethodProjectCoefficientService.createConfigAssayMethodProjectCoefficient(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测方法分析项目补正系数") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:update')") + public CommonResult updateConfigAssayMethodProjectCoefficient(@Valid @RequestBody ConfigAssayMethodProjectCoefficientSaveReqVO updateReqVO) { + configAssayMethodProjectCoefficientService.updateConfigAssayMethodProjectCoefficient(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测方法分析项目补正系数") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:delete')") + public CommonResult deleteConfigAssayMethodProjectCoefficient(@RequestParam("id") Long id) { + configAssayMethodProjectCoefficientService.deleteConfigAssayMethodProjectCoefficient(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测方法分析项目补正系数") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:delete')") + public CommonResult deleteConfigAssayMethodProjectCoefficientList(@RequestBody BatchDeleteReqVO req) { + configAssayMethodProjectCoefficientService.deleteConfigAssayMethodProjectCoefficientListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测方法分析项目补正系数") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:query')") + public CommonResult getConfigAssayMethodProjectCoefficient(@RequestParam("id") Long id) { + ConfigAssayMethodProjectCoefficientDO configAssayMethodProjectCoefficient = configAssayMethodProjectCoefficientService.getConfigAssayMethodProjectCoefficient(id); + return success(BeanUtils.toBean(configAssayMethodProjectCoefficient, ConfigAssayMethodProjectCoefficientRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测方法分析项目补正系数分页") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:query')") + public CommonResult> getConfigAssayMethodProjectCoefficientPage(@Valid ConfigAssayMethodProjectCoefficientPageReqVO pageReqVO) { + PageResult pageResult = configAssayMethodProjectCoefficientService.getConfigAssayMethodProjectCoefficientPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigAssayMethodProjectCoefficientRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测方法分析项目补正系数 Excel") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-coefficient:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigAssayMethodProjectCoefficientExcel(@Valid ConfigAssayMethodProjectCoefficientPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configAssayMethodProjectCoefficientService.getConfigAssayMethodProjectCoefficientPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测方法分析项目补正系数.xls", "数据", ConfigAssayMethodProjectCoefficientRespVO.class, + BeanUtils.toBean(list, ConfigAssayMethodProjectCoefficientRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java index a4438a6..5fe6fad 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @PostMapping("/create") @Operation(summary = "创建检测方法分析项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:create')") public CommonResult createConfigAssayMethodProject(@Valid @RequestBody ConfigAssayMethodProjectSaveReqVO createReqVO) { return success(configAssayMethodProjectService.createConfigAssayMethodProject(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测方法分析项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:update')") public CommonResult updateConfigAssayMethodProject(@Valid @RequestBody ConfigAssayMethodProjectSaveReqVO updateReqVO) { configAssayMethodProjectService.updateConfigAssayMethodProject(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @DeleteMapping("/delete") @Operation(summary = "删除检测方法分析项目配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:delete')") public CommonResult deleteConfigAssayMethodProject(@RequestParam("id") Long id) { configAssayMethodProjectService.deleteConfigAssayMethodProject(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测方法分析项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:delete')") public CommonResult deleteConfigAssayMethodProjectList(@RequestBody BatchDeleteReqVO req) { configAssayMethodProjectService.deleteConfigAssayMethodProjectListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @GetMapping("/get") @Operation(summary = "获得检测方法分析项目配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:query')") public CommonResult getConfigAssayMethodProject(@RequestParam("id") Long id) { ConfigAssayMethodProjectDO configAssayMethodProject = configAssayMethodProjectService.getConfigAssayMethodProject(id); return success(BeanUtils.toBean(configAssayMethodProject, ConfigAssayMethodProjectRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得检测方法分析项目配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:query')") public CommonResult> getConfigAssayMethodProjectPage(@Valid ConfigAssayMethodProjectPageReqVO pageReqVO) { PageResult pageResult = configAssayMethodProjectService.getConfigAssayMethodProjectPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigAssayMethodProjectRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigAssayMethodProjectController implements BusinessControllerMar @GetMapping("/export-excel") @Operation(summary = "导出检测方法分析项目配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigAssayMethodProjectExcel(@Valid ConfigAssayMethodProjectPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java index 48a7171..e8bd392 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectParameterController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @PostMapping("/create") @Operation(summary = "创建检测方法分析项目参数配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:create')") public CommonResult createConfigAssayMethodProjectParameter(@Valid @RequestBody ConfigAssayMethodProjectParameterSaveReqVO createReqVO) { return success(configAssayMethodProjectParameterService.createConfigAssayMethodProjectParameter(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测方法分析项目参数配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:update')") public CommonResult updateConfigAssayMethodProjectParameter(@Valid @RequestBody ConfigAssayMethodProjectParameterSaveReqVO updateReqVO) { configAssayMethodProjectParameterService.updateConfigAssayMethodProjectParameter(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @DeleteMapping("/delete") @Operation(summary = "删除检测方法分析项目参数配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:delete')") public CommonResult deleteConfigAssayMethodProjectParameter(@RequestParam("id") Long id) { configAssayMethodProjectParameterService.deleteConfigAssayMethodProjectParameter(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测方法分析项目参数配置") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:delete')") public CommonResult deleteConfigAssayMethodProjectParameterList(@RequestBody BatchDeleteReqVO req) { configAssayMethodProjectParameterService.deleteConfigAssayMethodProjectParameterListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @GetMapping("/get") @Operation(summary = "获得检测方法分析项目参数配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:query')") public CommonResult getConfigAssayMethodProjectParameter(@RequestParam("id") Long id) { ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameter = configAssayMethodProjectParameterService.getConfigAssayMethodProjectParameter(id); return success(BeanUtils.toBean(configAssayMethodProjectParameter, ConfigAssayMethodProjectParameterRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @GetMapping("/page") @Operation(summary = "获得检测方法分析项目参数配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:query')") public CommonResult> getConfigAssayMethodProjectParameterPage(@Valid ConfigAssayMethodProjectParameterPageReqVO pageReqVO) { PageResult pageResult = configAssayMethodProjectParameterService.getConfigAssayMethodProjectParameterPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigAssayMethodProjectParameterRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigAssayMethodProjectParameterController implements BusinessCont @GetMapping("/export-excel") @Operation(summary = "导出检测方法分析项目参数配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-parameter:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigAssayMethodProjectParameterExcel(@Valid ConfigAssayMethodProjectParameterPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java new file mode 100644 index 0000000..ce4f804 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigAssayMethodProjectRangeController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.module.qms.business.config.service.ConfigAssayMethodProjectRangeService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 检测方法分析项目区间") +@RestController +@RequestMapping("/qms/config-assay-method-project-range") +@Validated +public class ConfigAssayMethodProjectRangeController implements BusinessControllerMarker { + + + @Resource + private ConfigAssayMethodProjectRangeService configAssayMethodProjectRangeService; + + @PostMapping("/create") + @Operation(summary = "创建检测方法分析项目区间") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:create')") + public CommonResult createConfigAssayMethodProjectRange(@Valid @RequestBody ConfigAssayMethodProjectRangeSaveReqVO createReqVO) { + return success(configAssayMethodProjectRangeService.createConfigAssayMethodProjectRange(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测方法分析项目区间") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:update')") + public CommonResult updateConfigAssayMethodProjectRange(@Valid @RequestBody ConfigAssayMethodProjectRangeSaveReqVO updateReqVO) { + configAssayMethodProjectRangeService.updateConfigAssayMethodProjectRange(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测方法分析项目区间") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:delete')") + public CommonResult deleteConfigAssayMethodProjectRange(@RequestParam("id") Long id) { + configAssayMethodProjectRangeService.deleteConfigAssayMethodProjectRange(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测方法分析项目区间") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:delete')") + public CommonResult deleteConfigAssayMethodProjectRangeList(@RequestBody BatchDeleteReqVO req) { + configAssayMethodProjectRangeService.deleteConfigAssayMethodProjectRangeListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测方法分析项目区间") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:query')") + public CommonResult getConfigAssayMethodProjectRange(@RequestParam("id") Long id) { + ConfigAssayMethodProjectRangeDO configAssayMethodProjectRange = configAssayMethodProjectRangeService.getConfigAssayMethodProjectRange(id); + return success(BeanUtils.toBean(configAssayMethodProjectRange, ConfigAssayMethodProjectRangeRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测方法分析项目区间分页") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:query')") + public CommonResult> getConfigAssayMethodProjectRangePage(@Valid ConfigAssayMethodProjectRangePageReqVO pageReqVO) { + PageResult pageResult = configAssayMethodProjectRangeService.getConfigAssayMethodProjectRangePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigAssayMethodProjectRangeRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测方法分析项目区间 Excel") + //@PreAuthorize("@ss.hasPermission('qms:config-assay-method-project-range:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigAssayMethodProjectRangeExcel(@Valid ConfigAssayMethodProjectRangePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configAssayMethodProjectRangeService.getConfigAssayMethodProjectRangePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测方法分析项目区间.xls", "数据", ConfigAssayMethodProjectRangeRespVO.class, + BeanUtils.toBean(list, ConfigAssayMethodProjectRangeRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java index 5c5a82f..1f83fb2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigBaseSampleController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建主样配置") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:create')") public CommonResult createConfigBaseSample(@Valid @RequestBody ConfigBaseSampleSaveReqVO createReqVO) { return success(configBaseSampleService.createConfigBaseSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新主样配置") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:update')") public CommonResult updateConfigBaseSample(@Valid @RequestBody ConfigBaseSampleSaveReqVO updateReqVO) { configBaseSampleService.updateConfigBaseSample(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除主样配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:delete')") public CommonResult deleteConfigBaseSample(@RequestParam("id") Long id) { configBaseSampleService.deleteConfigBaseSample(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除主样配置") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:delete')") public CommonResult deleteConfigBaseSampleList(@RequestBody BatchDeleteReqVO req) { configBaseSampleService.deleteConfigBaseSampleListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得主样配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:query')") public CommonResult getConfigBaseSample(@RequestParam("id") Long id) { ConfigBaseSampleDO configBaseSample = configBaseSampleService.getConfigBaseSample(id); return success(BeanUtils.toBean(configBaseSample, ConfigBaseSampleRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得主样配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:query')") public CommonResult> getConfigBaseSamplePage(@Valid ConfigBaseSamplePageReqVO pageReqVO) { PageResult pageResult = configBaseSampleService.getConfigBaseSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigBaseSampleRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigBaseSampleController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出主样配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-base-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-base-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigBaseSampleExcel(@Valid ConfigBaseSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java index c0be048..3913f0c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigEntrustSourceController.java @@ -1,5 +1,9 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourcePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +14,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +47,14 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建检验委托来源配置") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:create')") public CommonResult createConfigEntrustSource(@Valid @RequestBody ConfigEntrustSourceSaveReqVO createReqVO) { return success(configEntrustSourceService.createConfigEntrustSource(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检验委托来源配置") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:update')") public CommonResult updateConfigEntrustSource(@Valid @RequestBody ConfigEntrustSourceSaveReqVO updateReqVO) { configEntrustSourceService.updateConfigEntrustSource(updateReqVO); return success(true); @@ -60,7 +63,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除检验委托来源配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:delete')") public CommonResult deleteConfigEntrustSource(@RequestParam("id") Long id) { configEntrustSourceService.deleteConfigEntrustSource(id); return success(true); @@ -69,7 +72,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检验委托来源配置") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:delete')") public CommonResult deleteConfigEntrustSourceList(@RequestBody BatchDeleteReqVO req) { configEntrustSourceService.deleteConfigEntrustSourceListByIds(req.getIds()); return success(true); @@ -78,7 +81,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得检验委托来源配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") public CommonResult getConfigEntrustSource(@RequestParam("id") Long id) { ConfigEntrustSourceDO configEntrustSource = configEntrustSourceService.getConfigEntrustSource(id); return success(BeanUtils.toBean(configEntrustSource, ConfigEntrustSourceRespVO.class)); @@ -86,7 +89,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得检验委托来源配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") public CommonResult> getConfigEntrustSourcePage(@Valid ConfigEntrustSourcePageReqVO pageReqVO) { PageResult pageResult = configEntrustSourceService.getConfigEntrustSourcePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigEntrustSourceRespVO.class)); @@ -94,7 +97,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @GetMapping("/list") @Operation(summary = "获得检验委托来源配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:query')") public CommonResult> getConfigEntrustSourceList(@Valid ConfigEntrustSourceReqVO reqVO) { List listResult = configEntrustSourceService.getConfigEntrustSourceList(reqVO); return success(BeanUtils.toBean(listResult, ConfigEntrustSourceRespVO.class)); @@ -103,7 +106,7 @@ public class ConfigEntrustSourceController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出检验委托来源配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-entrust-source:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-entrust-source:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigEntrustSourceExcel(@Valid ConfigEntrustSourcePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java new file mode 100644 index 0000000..2ac449a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigPermissionController.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO; +import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; + +@Tag(name = "管理后台 - 权限配置,通用权限配置") +@RestController +@RequestMapping("/qms/config-permission") +@Validated +public class ConfigPermissionController implements BusinessControllerMarker { + + + @Resource + private ConfigPermissionService configPermissionService; + + @PostMapping("/create") + @Operation(summary = "创建权限配置,通用权限配置") +// @PreAuthorize("@ss.hasPermission('qms:config-permission:create')") + public CommonResult createConfigPermission(@Valid @RequestBody ConfigPermissionSaveReqVO createReqVO) { + return success(configPermissionService.createConfigPermission(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新权限配置,通用权限配置") +// @PreAuthorize("@ss.hasPermission('qms:config-permission:update')") + public CommonResult updateConfigPermission(@Valid @RequestBody ConfigPermissionSaveReqVO updateReqVO) { + configPermissionService.updateConfigPermission(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除权限配置,通用权限配置") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:config-permission:delete')") + public CommonResult deleteConfigPermission(@RequestParam("id") Long id) { + configPermissionService.deleteConfigPermission(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除权限配置,通用权限配置") + @PreAuthorize("@ss.hasPermission('qms:config-permission:delete')") + public CommonResult deleteConfigPermissionList(@RequestBody BatchDeleteReqVO req) { + configPermissionService.deleteConfigPermissionListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得权限配置,通用权限配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:config-permission:query')") + public CommonResult getConfigPermission(@RequestParam("id") Long id) { + ConfigPermissionDO configPermission = configPermissionService.getConfigPermission(id); + return success(BeanUtils.toBean(configPermission, ConfigPermissionRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得权限配置,通用权限配置分页") +// @PreAuthorize("@ss.hasPermission('qms:config-permission:query')") + public CommonResult> getConfigPermissionPage(@Valid ConfigPermissionPageReqVO pageReqVO) { + PageResult pageResult = configPermissionService.getConfigPermissionPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigPermissionRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出权限配置,通用权限配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-permission:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigPermissionExcel(@Valid ConfigPermissionPageReqVO pageReqVO, HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configPermissionService.getConfigPermissionPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "权限配置,通用权限配置.xls", "数据", ConfigPermissionRespVO.class, + BeanUtils.toBean(list, ConfigPermissionRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java index a846ea6..e251e92 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigProjectController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigProjectController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-project:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:create')") public CommonResult createConfigProject(@Valid @RequestBody ConfigProjectSaveReqVO createReqVO) { return success(configProjectService.createConfigProject(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-project:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:update')") public CommonResult updateConfigProject(@Valid @RequestBody ConfigProjectSaveReqVO updateReqVO) { configProjectService.updateConfigProject(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigProjectController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除检测项目配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:delete')") public CommonResult deleteConfigProject(@RequestParam("id") Long id) { configProjectService.deleteConfigProject(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigProjectController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:delete')") public CommonResult deleteConfigProjectList(@RequestBody BatchDeleteReqVO req) { configProjectService.deleteConfigProjectListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigProjectController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得检测项目配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:query')") public CommonResult getConfigProject(@RequestParam("id") Long id) { ConfigProjectDO configProject = configProjectService.getConfigProject(id); return success(BeanUtils.toBean(configProject, ConfigProjectRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigProjectController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得检测项目配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:query')") public CommonResult> getConfigProjectPage(@Valid ConfigProjectPageReqVO pageReqVO) { PageResult pageResult = configProjectService.getConfigProjectPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigProjectRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigProjectController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出检测项目配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-project:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-project:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigProjectExcel(@Valid ConfigProjectPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java new file mode 100644 index 0000000..5115254 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; +import com.zt.plat.module.qms.business.config.service.ConfigQCSampleMethodService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样与检测方法配置") +@RestController +@RequestMapping("/qms/config-qc-sample-method") +@Validated +public class ConfigQCSampleMethodController implements BusinessControllerMarker { + + + @Resource + private ConfigQCSampleMethodService configQCSampleMethodService; + + @PostMapping("/create") + @Operation(summary = "创建质控样与检测方法配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:create')") + public CommonResult createConfigQCSampleMethod(@Valid @RequestBody ConfigQCSampleMethodSaveReqVO createReqVO) { + return success(configQCSampleMethodService.createConfigQCSampleMethod(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样与检测方法配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:update')") + public CommonResult updateConfigQCSampleMethod(@Valid @RequestBody ConfigQCSampleMethodSaveReqVO updateReqVO) { + configQCSampleMethodService.updateConfigQCSampleMethod(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样与检测方法配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:delete')") + public CommonResult deleteConfigQCSampleMethod(@RequestParam("id") Long id) { + configQCSampleMethodService.deleteConfigQCSampleMethod(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样与检测方法配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:delete')") + public CommonResult deleteConfigQCSampleMethodList(@RequestBody BatchDeleteReqVO req) { + configQCSampleMethodService.deleteConfigQCSampleMethodListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样与检测方法配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:query')") + public CommonResult getConfigQCSampleMethod(@RequestParam("id") Long id) { + ConfigQCSampleMethodDO configQCSampleMethod = configQCSampleMethodService.getConfigQCSampleMethod(id); + return success(BeanUtils.toBean(configQCSampleMethod, ConfigQCSampleMethodRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样与检测方法配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:query')") + public CommonResult> getConfigQCSampleMethodPage(@Valid ConfigQCSampleMethodPageReqVO pageReqVO) { + PageResult pageResult = configQCSampleMethodService.getConfigQCSampleMethodPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigQCSampleMethodRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样与检测方法配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigQCSampleMethodExcel(@Valid ConfigQCSampleMethodPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configQCSampleMethodService.getConfigQCSampleMethodPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样与检测方法配置.xls", "数据", ConfigQCSampleMethodRespVO.class, + BeanUtils.toBean(list, ConfigQCSampleMethodRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java new file mode 100644 index 0000000..6662b7b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCSampleMethodParameterController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; +import com.zt.plat.module.qms.business.config.service.ConfigQCSampleMethodParameterService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控样检测方法参数配置") +@RestController +@RequestMapping("/qms/config-QC-sample-method-parameter") +@Validated +public class ConfigQCSampleMethodParameterController implements BusinessControllerMarker { + + + @Resource + private ConfigQCSampleMethodParameterService configQCSampleMethodParameterService; + + @PostMapping("/create") + @Operation(summary = "创建质控样检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:create')") + public CommonResult createConfigQCSampleMethodParameter(@Valid @RequestBody ConfigQCSampleMethodParameterSaveReqVO createReqVO) { + return success(configQCSampleMethodParameterService.createConfigQCSampleMethodParameter(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控样检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:update')") + public CommonResult updateConfigQCSampleMethodParameter(@Valid @RequestBody ConfigQCSampleMethodParameterSaveReqVO updateReqVO) { + configQCSampleMethodParameterService.updateConfigQCSampleMethodParameter(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控样检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:delete')") + public CommonResult deleteConfigQCSampleMethodParameter(@RequestParam("id") Long id) { + configQCSampleMethodParameterService.deleteConfigQCSampleMethodParameter(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控样检测方法参数配置") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:delete')") + public CommonResult deleteConfigQCSampleMethodParameterList(@RequestBody BatchDeleteReqVO req) { + configQCSampleMethodParameterService.deleteConfigQCSampleMethodParameterListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控样检测方法参数配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:query')") + public CommonResult getConfigQCSampleMethodParameter(@RequestParam("id") Long id) { + ConfigQCSampleMethodParameterDO configQCSampleMethodParameter = configQCSampleMethodParameterService.getConfigQCSampleMethodParameter(id); + return success(BeanUtils.toBean(configQCSampleMethodParameter, ConfigQCSampleMethodParameterRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控样检测方法参数配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:query')") + public CommonResult> getConfigQCSampleMethodParameterPage(@Valid ConfigQCSampleMethodParameterPageReqVO pageReqVO) { + PageResult pageResult = configQCSampleMethodParameterService.getConfigQCSampleMethodParameterPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigQCSampleMethodParameterRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控样检测方法参数配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-QC-sample-method-parameter:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigQCSampleMethodParameterExcel(@Valid ConfigQCSampleMethodParameterPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configQCSampleMethodParameterService.getConfigQCSampleMethodParameterPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控样检测方法参数配置.xls", "数据", ConfigQCSampleMethodParameterRespVO.class, + BeanUtils.toBean(list, ConfigQCSampleMethodParameterRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java new file mode 100644 index 0000000..0bbb29f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigQCStandardSampleController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCStandardSampleDO; +import com.zt.plat.module.qms.business.config.service.ConfigQCStandardSampleService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 质控与定值样关系") +@RestController +@RequestMapping("/qms/config-qc-standard-sample") +@Validated +public class ConfigQCStandardSampleController implements BusinessControllerMarker { + + + @Resource + private ConfigQCStandardSampleService configQCStandardSampleService; + + @PostMapping("/create") + @Operation(summary = "创建质控与定值样关系") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:create')") + public CommonResult createConfigQCStandardSample(@Valid @RequestBody ConfigQCStandardSampleSaveReqVO createReqVO) { + return success(configQCStandardSampleService.createConfigQCStandardSample(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新质控与定值样关系") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:update')") + public CommonResult updateConfigQCStandardSample(@Valid @RequestBody ConfigQCStandardSampleSaveReqVO updateReqVO) { + configQCStandardSampleService.updateConfigQCStandardSample(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除质控与定值样关系") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:delete')") + public CommonResult deleteConfigQCStandardSample(@RequestParam("id") Long id) { + configQCStandardSampleService.deleteConfigQCStandardSample(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除质控与定值样关系") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:delete')") + public CommonResult deleteConfigQCStandardSampleList(@RequestBody BatchDeleteReqVO req) { + configQCStandardSampleService.deleteConfigQCStandardSampleListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得质控与定值样关系") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:query')") + public CommonResult getConfigQCStandardSample(@RequestParam("id") Long id) { + ConfigQCStandardSampleDO configQCStandardSample = configQCStandardSampleService.getConfigQCStandardSample(id); + return success(BeanUtils.toBean(configQCStandardSample, ConfigQCStandardSampleRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得质控与定值样关系分页") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:query')") + public CommonResult> getConfigQCStandardSamplePage(@Valid ConfigQCStandardSamplePageReqVO pageReqVO) { + PageResult pageResult = configQCStandardSampleService.getConfigQCStandardSamplePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigQCStandardSampleRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出质控与定值样关系 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-QC-standard-sample:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigQCStandardSampleExcel(@Valid ConfigQCStandardSamplePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configQCStandardSampleService.getConfigQCStandardSamplePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "质控与定值样关系.xls", "数据", ConfigQCStandardSampleRespVO.class, + BeanUtils.toBean(list, ConfigQCStandardSampleRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java index 38c9dd8..c755fbb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportFieldController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建报表字段配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:create')") public CommonResult createConfigReportField(@Valid @RequestBody ConfigReportFieldSaveReqVO createReqVO) { return success(configReportFieldService.createConfigReportField(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新报表字段配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:update')") public CommonResult updateConfigReportField(@Valid @RequestBody ConfigReportFieldSaveReqVO updateReqVO) { configReportFieldService.updateConfigReportField(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除报表字段配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-report-field:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:delete')") public CommonResult deleteConfigReportField(@RequestParam("id") Long id) { configReportFieldService.deleteConfigReportField(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除报表字段配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:delete')") public CommonResult deleteConfigReportFieldList(@RequestBody BatchDeleteReqVO req) { configReportFieldService.deleteConfigReportFieldListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得报表字段配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:query')") public CommonResult getConfigReportField(@RequestParam("id") Long id) { ConfigReportFieldDO configReportField = configReportFieldService.getConfigReportField(id); return success(BeanUtils.toBean(configReportField, ConfigReportFieldRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得报表字段配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:query')") public CommonResult> getConfigReportFieldPage(@Valid ConfigReportFieldPageReqVO pageReqVO) { PageResult pageResult = configReportFieldService.getConfigReportFieldPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigReportFieldRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigReportFieldController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出报表字段配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-report-field:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-field:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigReportFieldExcel(@Valid ConfigReportFieldPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java index f0546ee..56c515e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTemplateController.java @@ -64,6 +64,9 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; import com.zt.plat.module.qms.enums.ErrorCodeConstants; +import com.zt.plat.module.qms.framework.gridreport.GridReport; +import com.zt.plat.module.qms.framework.gridreport.PdfHelper; +import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException; import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService; import gridreport.jni.BinaryObject; import gridreport.jni.ExportImageType; @@ -77,6 +80,11 @@ import gridreport.jni.Report; @Slf4j public class ConfigReportTemplateController implements BusinessControllerMarker { + public static final String WR_PREFIX = "_WR_"; + + @Resource + private GridReport gridReport; + @Resource private SecurityProperties securityProperties; @@ -101,14 +109,14 @@ public class ConfigReportTemplateController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建报表模版配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:create')") public CommonResult createConfigReportTemplate(@Valid @RequestBody ConfigReportTemplateSaveReqVO createReqVO) { return success(configReportTemplateService.createConfigReportTemplate(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新报表模版配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:update')") public CommonResult updateConfigReportTemplate(@Valid @RequestBody ConfigReportTemplateSaveReqVO updateReqVO) { configReportTemplateService.updateConfigReportTemplate(updateReqVO); return success(true); @@ -117,7 +125,7 @@ public class ConfigReportTemplateController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除报表模版配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-report-template:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:delete')") public CommonResult deleteConfigReportTemplate(@RequestParam("id") Long id) { configReportTemplateService.deleteConfigReportTemplate(id); return success(true); @@ -126,7 +134,7 @@ public class ConfigReportTemplateController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除报表模版配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:delete')") public CommonResult deleteConfigReportTemplateList(@RequestParam("ids") List ids) { configReportTemplateService.deleteConfigReportTemplateListByIds(ids); return success(true); @@ -135,15 +143,24 @@ public class ConfigReportTemplateController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得报表模版配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:query')") public CommonResult getConfigReportTemplate(@RequestParam("id") Long id) { ConfigReportTemplateDO configReportTemplate = configReportTemplateService.getConfigReportTemplate(id); return success(BeanUtils.toBean(configReportTemplate, ConfigReportTemplateRespVO.class)); } + @GetMapping("/getByKey") + @Operation(summary = "获得报表模版配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:query')") + public CommonResult getConfigReportTemplate(@RequestParam("key") String key) { + ConfigReportTemplateDO configReportTemplate = configReportTemplateService.getConfigReportTemplateByKey(key); + return success(BeanUtils.toBean(configReportTemplate, ConfigReportTemplateRespVO.class)); + } + @GetMapping("/page") @Operation(summary = "获得报表模版配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:query')") public CommonResult> getConfigReportTemplatePage(@Valid ConfigReportTemplatePageReqVO pageReqVO) { PageResult pageResult = configReportTemplateService.getConfigReportTemplatePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigReportTemplateRespVO.class)); @@ -151,7 +168,7 @@ public class ConfigReportTemplateController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出报表模版配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-report-template:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-template:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigReportTemplateExcel(@Valid ConfigReportTemplatePageReqVO pageReqVO, HttpServletResponse response) throws IOException { @@ -161,6 +178,376 @@ public class ConfigReportTemplateController implements BusinessControllerMarker ExcelUtils.write(response, "报表模版配置.xls", "数据", ConfigReportTemplateRespVO.class, BeanUtils.toBean(list, ConfigReportTemplateRespVO.class)); } + + /*** + * 预览报表 + * @param reportId + * @param reportKey + * @param dataUrl + * @param isCrypto + * @param type + * @return + * @throws Exception + */ + @GetMapping("/preview") + @Operation(summary = "预览报表") + public ResponseEntity preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + log.info("url:" + dataUrl); + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + log.info("url:" + dataUrl); + //处理url参数 + if(dataUrl.contains("?")) { + String urlParam = dataUrl.split("\\?")[1]; + String[] urlVks = urlParam.split("&"); + for (int i = 0; i < urlVks.length; i++) { + String vk = urlVks[i]; + if (StrUtil.isNotBlank(vk)) { + String[] vkSplit = vk.split("="); + if(vkSplit.length == 2){ + reportParams.put(vkSplit[0], vkSplit[1]); + } + } + } + } + + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + log.error("报表数据:" + reportData); + throw new GridReportException("获取报表数据错误!"); + } + } + + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + MediaType mediaType = null; + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + mediaType = MediaType.APPLICATION_PDF; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + default: + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + } + + return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); + } + + @GetMapping("/previewDocs") + @Operation(summary = "报告预览报表") + public ResponseEntity previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new GridReportException("未找到报表模板!"); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + log.info("url:" + dataUrl); + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + log.info("url:" + dataUrl); + + + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + + Map map = BeanUtil.beanToMap(dataR.getData()); + for (Map.Entry obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) { + reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString()); + } + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + log.error("报表数据:" + reportData); + throw new GridReportException("获取报表数据错误!"); + } + + } + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + MediaType mediaType = null; + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + mediaType = MediaType.APPLICATION_PDF; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + case "IMG": + fileExtName = "png"; + mediaType = MediaType.IMAGE_PNG; + docBytes = binaryObject.getDataBuf(); + break; + default: + mediaType = MediaType.APPLICATION_OCTET_STREAM; + docBytes = binaryObject.getDataBuf(); + break; + } + + return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType); + } + + @GetMapping("/export") + @Operation(summary = "导出报表") + public ResponseEntity export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception { + HttpServletRequest request = ServletUtils.getRequest(); + ConfigReportTemplateDO gridppReportFile = null; + if (reportId != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId); + } else if (StrUtil.isNotBlank(reportKey)) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new GridReportException("未找到报表模板!"); + } + String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData()); + + //报表参数 + Map reportParams = new HashMap<>(); + //获取当前用户姓名 + LoginUser user = SecurityFrameworkUtils.getLoginUser(); + String realName = ""; + if (user != null) { + realName = SecurityFrameworkUtils.getLoginUserNickname(); + } + reportParams.put("operName", realName); + + if (StrUtil.isNotBlank(dataUrl)) { + dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl); + //处理url参数 + if (dataUrl.contains("?")) { + String urlParam = dataUrl.split("\\?")[1]; + String[] urlVks = urlParam.split("&"); + for (int i = 0; i < urlVks.length; i++) { + String vk = urlVks[i]; + if (StrUtil.isNotBlank(vk)) { + String[] vkSplit = vk.split("="); + if(vkSplit.length == 2){ + reportParams.put(vkSplit[0], vkSplit[1]); + } + } + } + } + Map headers = new HashMap<>(); + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + headers.put(securityProperties.getTokenHeader(), token); + HttpResponse res = HttpRequest.get(dataUrl) + .addHeaders(headers) + .setConnectionTimeout(60 * 1000) + .setReadTimeout(120 * 1000) + .execute(); + if (res.getStatus() != 200) { + log.error("报表数据,网络请求错误!", res.body()); + throw new GridReportException("报表数据,网络请求错误!"); + } + String body = res.body(); + CommonResult dataR = JSON.parseObject(body, CommonResult.class); + if (dataR != null && dataR.getCode() == 0) { + if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) { + reportData = JSON.toJSONString(dataR); + } else { + reportData = JSON.toJSONString(dataR.getData()); + } + } else { + log.error("获取报表数据错误!", dataR.getMsg()); + throw new GridReportException("获取报表数据错误!"); + } + } + + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase())); + byte[] docBytes = null; + //文件扩展名 + String fileExtName = type.toLowerCase(); + switch (type.toUpperCase()) { + case "PDF": + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "OFD": + docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf()); + break; + case "RTF": + fileExtName = "doc"; + docBytes = binaryObject.getDataBuf(); + break; + case "IMG": + fileExtName = "png"; + docBytes = binaryObject.getDataBuf(); + break; + default: + docBytes = binaryObject.getDataBuf(); + break; + } + String fileName = gridppReportFile.getName(); + if (StrUtil.isNotBlank(exportName)) { + fileName = exportName; + } + return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName); + } + + /** + * 生成Base64图片 + * @return + */ + @PostMapping("/gen-report-png-image-base64") + @Operation(summary = "生成Base64图片") + public CommonResult genReportPngImageBase64(@RequestBody GenReportBody body) { + ConfigReportTemplateDO gridppReportFile = null; + if (body.getReportId() != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); + } else if (StrUtil.isNotBlank(body.getReportKey())) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + + String imgBase64 = null; + try { + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi()); + imgBase64 = binaryObject.getAsBase64Text(); + } catch (Exception e) { + log.error("生成base64图片失败", e); + } + if (StringUtils.isBlank(imgBase64)) { + return CommonResult.error(1_032_100_000, "生成Base64图片失败"); + } + return success(imgBase64); + } + + /** + * 生成Base64图片 + * @return + */ + @PostMapping("/gen-report-png-image-base64-by-pdf") + @Operation(summary = "生成Base64图片") + public CommonResult genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) { + ConfigReportTemplateDO gridppReportFile = null; + if (body.getReportId() != null) { + gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId()); + } else if (StrUtil.isNotBlank(body.getReportKey())) { + gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey()); + } + if (ObjectUtil.isEmpty(gridppReportFile)) { + throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS); + } + + String imgBase64 = null; + try { + BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF); + byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi()); + //String encodeHexStr = HexUtil.encodeHexStr(pngBytes); + //System.out.println(encodeHexStr); + imgBase64 = Base64.encode(pngBytes); + } catch (Exception e) { + log.error("生成base64图片失败", e); + } + if (StringUtils.isBlank(imgBase64)) { + return CommonResult.error(1_032_100_000, "生成Base64图片失败"); + } + return success(imgBase64); + } /** * 下载文件 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java index 6bafd4b..e6284ef 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigReportTypeController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建报表类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:create')") public CommonResult createConfigReportType(@Valid @RequestBody ConfigReportTypeSaveReqVO createReqVO) { return success(configReportTypeService.createConfigReportType(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新报表类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:update')") public CommonResult updateConfigReportType(@Valid @RequestBody ConfigReportTypeSaveReqVO updateReqVO) { configReportTypeService.updateConfigReportType(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除报表类型配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-report-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:delete')") public CommonResult deleteConfigReportType(@RequestParam("id") Long id) { configReportTypeService.deleteConfigReportType(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除报表类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:delete')") public CommonResult deleteConfigReportTypeList(@RequestBody BatchDeleteReqVO req) { configReportTypeService.deleteConfigReportTypeListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得报表类型配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:query')") public CommonResult getConfigReportType(@RequestParam("id") Long id) { ConfigReportTypeDO configReportType = configReportTypeService.getConfigReportType(id); return success(BeanUtils.toBean(configReportType, ConfigReportTypeRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得报表类型配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:query')") public CommonResult> getConfigReportTypePage(@Valid ConfigReportTypePageReqVO pageReqVO) { PageResult pageResult = configReportTypeService.getConfigReportTypePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigReportTypeRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigReportTypeController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出报表类型配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-report-type:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-report-type:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigReportTypeExcel(@Valid ConfigReportTypePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java new file mode 100644 index 0000000..08667d8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigRuleController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; +import com.zt.plat.module.qms.business.config.service.ConfigRuleService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 规则配置") +@RestController +@RequestMapping("/qms/config-rule") +@Validated +public class ConfigRuleController implements BusinessControllerMarker { + + + @Resource + private ConfigRuleService configRuleService; + + @PostMapping("/create") + @Operation(summary = "创建规则配置") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:create')") + public CommonResult createConfigRule(@Valid @RequestBody ConfigRuleSaveReqVO createReqVO) { + return success(configRuleService.createConfigRule(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新规则配置") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:update')") + public CommonResult updateConfigRule(@Valid @RequestBody ConfigRuleSaveReqVO updateReqVO) { + configRuleService.updateConfigRule(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除规则配置") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:config-rule:delete')") + public CommonResult deleteConfigRule(@RequestParam("id") Long id) { + configRuleService.deleteConfigRule(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除规则配置") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:delete')") + public CommonResult deleteConfigRuleList(@RequestBody BatchDeleteReqVO req) { + configRuleService.deleteConfigRuleListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得规则配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:query')") + public CommonResult getConfigRule(@RequestParam("id") Long id) { + ConfigRuleDO configRule = configRuleService.getConfigRule(id); + return success(BeanUtils.toBean(configRule, ConfigRuleRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得规则配置分页") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:query')") + public CommonResult> getConfigRulePage(@Valid ConfigRulePageReqVO pageReqVO) { + PageResult pageResult = configRuleService.getConfigRulePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigRuleRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出规则配置 Excel") + //@PreAuthorize("@ss.hasPermission('qms:config-rule:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigRuleExcel(@Valid ConfigRulePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configRuleService.getConfigRulePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "规则配置.xls", "数据", ConfigRuleRespVO.class, + BeanUtils.toBean(list, ConfigRuleRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java index baa790d..51aa002 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleFlowController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建样品流程配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:create')") public CommonResult createConfigSampleFlow(@Valid @RequestBody ConfigSampleFlowSaveReqVO createReqVO) { return success(configSampleFlowService.createConfigSampleFlow(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品流程配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:update')") public CommonResult updateConfigSampleFlow(@Valid @RequestBody ConfigSampleFlowSaveReqVO updateReqVO) { configSampleFlowService.updateConfigSampleFlow(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除样品流程配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:delete')") public CommonResult deleteConfigSampleFlow(@RequestParam("id") Long id) { configSampleFlowService.deleteConfigSampleFlow(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品流程配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:delete')") public CommonResult deleteConfigSampleFlowList(@RequestBody BatchDeleteReqVO req) { configSampleFlowService.deleteConfigSampleFlowListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得样品流程配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:query')") public CommonResult getConfigSampleFlow(@RequestParam("id") Long id) { ConfigSampleFlowDO configSampleFlow = configSampleFlowService.getConfigSampleFlow(id); return success(BeanUtils.toBean(configSampleFlow, ConfigSampleFlowRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得样品流程配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:query')") public CommonResult> getConfigSampleFlowPage(@Valid ConfigSampleFlowPageReqVO pageReqVO) { PageResult pageResult = configSampleFlowService.getConfigSampleFlowPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSampleFlowRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigSampleFlowController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出样品流程配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sample-flow:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-flow:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSampleFlowExcel(@Valid ConfigSampleFlowPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java index 68ea815..c4205e5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleHandoverController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -42,14 +44,14 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建样品交接配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:create')") public CommonResult createConfigSampleHandover(@Valid @RequestBody ConfigSampleHandoverSaveReqVO createReqVO) { return success(configSampleHandoverService.createConfigSampleHandover(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品交接配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:update')") public CommonResult updateConfigSampleHandover(@Valid @RequestBody ConfigSampleHandoverSaveReqVO updateReqVO) { configSampleHandoverService.updateConfigSampleHandover(updateReqVO); return success(true); @@ -58,7 +60,7 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除样品交接配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:delete')") public CommonResult deleteConfigSampleHandover(@RequestParam("id") Long id) { configSampleHandoverService.deleteConfigSampleHandover(id); return success(true); @@ -67,7 +69,7 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品交接配置") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:delete')") public CommonResult deleteConfigSampleHandoverList(@RequestBody BatchDeleteReqVO req) { configSampleHandoverService.deleteConfigSampleHandoverListByIds(req.getIds()); return success(true); @@ -76,7 +78,7 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得样品交接配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:query')") public CommonResult getConfigSampleHandover(@RequestParam("id") Long id) { ConfigSampleHandoverDO configSampleHandover = configSampleHandoverService.getConfigSampleHandover(id); return success(BeanUtils.toBean(configSampleHandover, ConfigSampleHandoverRespVO.class)); @@ -84,7 +86,7 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得样品交接配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:query')") public CommonResult> getConfigSampleHandoverPage(@Valid ConfigSampleHandoverPageReqVO pageReqVO) { PageResult pageResult = configSampleHandoverService.getConfigSampleHandoverPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSampleHandoverRespVO.class)); @@ -92,7 +94,7 @@ public class ConfigSampleHandoverController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出样品交接配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sample-handover:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-handover:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSampleHandoverExcel(@Valid ConfigSampleHandoverPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java index 1ada838..4451939 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSampleReportController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建样品报表关系") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:create')") public CommonResult createConfigSampleReport(@Valid @RequestBody ConfigSampleReportSaveReqVO createReqVO) { return success(configSampleReportService.createConfigSampleReport(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品报表关系") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:update')") public CommonResult updateConfigSampleReport(@Valid @RequestBody ConfigSampleReportSaveReqVO updateReqVO) { configSampleReportService.updateConfigSampleReport(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除样品报表关系") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:delete')") public CommonResult deleteConfigSampleReport(@RequestParam("id") Long id) { configSampleReportService.deleteConfigSampleReport(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品报表关系") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:delete')") public CommonResult deleteConfigSampleReportList(@RequestBody BatchDeleteReqVO req) { configSampleReportService.deleteConfigSampleReportListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得样品报表关系") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:query')") public CommonResult getConfigSampleReport(@RequestParam("id") Long id) { ConfigSampleReportDO configSampleReport = configSampleReportService.getConfigSampleReport(id); return success(BeanUtils.toBean(configSampleReport, ConfigSampleReportRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得样品报表关系分页") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:query')") public CommonResult> getConfigSampleReportPage(@Valid ConfigSampleReportPageReqVO pageReqVO) { PageResult pageResult = configSampleReportService.getConfigSampleReportPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSampleReportRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigSampleReportController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出样品报表关系 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sample-report:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sample-report:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSampleReportExcel(@Valid ConfigSampleReportPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java index b51f69b..dcb867a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowCodeController.java @@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +43,14 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建LiteFlow脚本配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:create')") public CommonResult createConfigSimpleFlowCode(@Valid @RequestBody ConfigSimpleFlowCodeSaveReqVO createReqVO) { return success(configSimpleFlowCodeService.createConfigSimpleFlowCode(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新LiteFlow脚本配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:update')") public CommonResult updateConfigSimpleFlowCode(@Valid @RequestBody ConfigSimpleFlowCodeSaveReqVO updateReqVO) { configSimpleFlowCodeService.updateConfigSimpleFlowCode(updateReqVO); return success(true); @@ -60,7 +59,7 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除LiteFlow脚本配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:delete')") public CommonResult deleteConfigSimpleFlowCode(@RequestParam("id") Long id) { configSimpleFlowCodeService.deleteConfigSimpleFlowCode(id); return success(true); @@ -69,7 +68,7 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除LiteFlow脚本配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:delete')") public CommonResult deleteConfigSimpleFlowCodeList(@RequestBody BatchDeleteReqVO req) { configSimpleFlowCodeService.deleteConfigSimpleFlowCodeListByIds(req.getIds()); return success(true); @@ -78,7 +77,7 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得LiteFlow脚本配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:query')") public CommonResult getConfigSimpleFlowCode(@RequestParam("id") Long id) { ConfigSimpleFlowCodeDO configSimpleFlowCode = configSimpleFlowCodeService.getConfigSimpleFlowCode(id); return success(BeanUtils.toBean(configSimpleFlowCode, ConfigSimpleFlowCodeRespVO.class)); @@ -86,7 +85,7 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得LiteFlow脚本配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:query')") public CommonResult> getConfigSimpleFlowCodePage(@Valid ConfigSimpleFlowCodePageReqVO pageReqVO) { PageResult pageResult = configSimpleFlowCodeService.getConfigSimpleFlowCodePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSimpleFlowCodeRespVO.class)); @@ -94,7 +93,7 @@ public class ConfigSimpleFlowCodeController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出LiteFlow脚本配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-code:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSimpleFlowCodeExcel(@Valid ConfigSimpleFlowCodePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java index 8fc0f79..012700c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSimpleFlowRuleController.java @@ -46,14 +46,14 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建LiteFlow规则配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:create')") public CommonResult createConfigSimpleFlowRule(@Valid @RequestBody ConfigSimpleFlowRuleSaveReqVO createReqVO) { return success(configSimpleFlowRuleService.createConfigSimpleFlowRule(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新LiteFlow规则配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:update')") public CommonResult updateConfigSimpleFlowRule(@Valid @RequestBody ConfigSimpleFlowRuleSaveReqVO updateReqVO) { configSimpleFlowRuleService.updateConfigSimpleFlowRule(updateReqVO); return success(true); @@ -62,7 +62,7 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除LiteFlow规则配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:delete')") public CommonResult deleteConfigSimpleFlowRule(@RequestParam("id") Long id) { configSimpleFlowRuleService.deleteConfigSimpleFlowRule(id); return success(true); @@ -71,7 +71,7 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除LiteFlow规则配置") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:delete')") public CommonResult deleteConfigSimpleFlowRuleList(@RequestBody BatchDeleteReqVO req) { configSimpleFlowRuleService.deleteConfigSimpleFlowRuleListByIds(req.getIds()); return success(true); @@ -80,7 +80,7 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得LiteFlow规则配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:query')") public CommonResult getConfigSimpleFlowRule(@RequestParam("id") Long id) { ConfigSimpleFlowRuleDO configSimpleFlowRule = configSimpleFlowRuleService.getConfigSimpleFlowRule(id); return success(BeanUtils.toBean(configSimpleFlowRule, ConfigSimpleFlowRuleRespVO.class)); @@ -88,7 +88,7 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得LiteFlow规则配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:query')") public CommonResult> getConfigSimpleFlowRulePage(@Valid ConfigSimpleFlowRulePageReqVO pageReqVO) { PageResult pageResult = configSimpleFlowRuleService.getConfigSimpleFlowRulePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSimpleFlowRuleRespVO.class)); @@ -108,7 +108,7 @@ public class ConfigSimpleFlowRuleController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出LiteFlow规则配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-simple-flow-rule:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSimpleFlowRuleExcel(@Valid ConfigSimpleFlowRulePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java index 962cee3..4ead6ba 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleProjectController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigStandardSampleProjectController implements BusinessController @PostMapping("/create") @Operation(summary = "创建标准样检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:create')") public CommonResult createConfigStandardSampleProject(@Valid @RequestBody ConfigStandardSampleProjectSaveReqVO createReqVO) { return success(configStandardSampleProjectService.createConfigStandardSampleProject(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新标准样检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:update')") public CommonResult updateConfigStandardSampleProject(@Valid @RequestBody ConfigStandardSampleProjectSaveReqVO updateReqVO) { configStandardSampleProjectService.updateConfigStandardSampleProject(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigStandardSampleProjectController implements BusinessController @DeleteMapping("/delete") @Operation(summary = "删除标准样检测项目配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:delete')") public CommonResult deleteConfigStandardSampleProject(@RequestParam("id") Long id) { configStandardSampleProjectService.deleteConfigStandardSampleProject(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigStandardSampleProjectController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除标准样检测项目配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:delete')") public CommonResult deleteConfigStandardSampleProjectList(@RequestBody BatchDeleteReqVO req) { configStandardSampleProjectService.deleteConfigStandardSampleProjectListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigStandardSampleProjectController implements BusinessController @GetMapping("/get") @Operation(summary = "获得标准样检测项目配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:query')") public CommonResult getConfigStandardSampleProject(@RequestParam("id") Long id) { ConfigStandardSampleProjectDO configStandardSampleProject = configStandardSampleProjectService.getConfigStandardSampleProject(id); return success(BeanUtils.toBean(configStandardSampleProject, ConfigStandardSampleProjectRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigStandardSampleProjectController implements BusinessController @GetMapping("/page") @Operation(summary = "获得标准样检测项目配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:query')") public CommonResult> getConfigStandardSampleProjectPage(@Valid ConfigStandardSampleProjectPageReqVO pageReqVO) { PageResult pageResult = configStandardSampleProjectService.getConfigStandardSampleProjectPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigStandardSampleProjectRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigStandardSampleProjectController implements BusinessController @GetMapping("/export-excel") @Operation(summary = "导出标准样检测项目配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-project:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigStandardSampleProjectExcel(@Valid ConfigStandardSampleProjectPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java index 14a7f71..7ab0a5d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigStandardSampleTypeController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @PostMapping("/create") @Operation(summary = "创建标准样类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:create')") public CommonResult createConfigStandardSampleType(@Valid @RequestBody ConfigStandardSampleTypeSaveReqVO createReqVO) { return success(configStandardSampleTypeService.createConfigStandardSampleType(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新标准样类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:update')") public CommonResult updateConfigStandardSampleType(@Valid @RequestBody ConfigStandardSampleTypeSaveReqVO updateReqVO) { configStandardSampleTypeService.updateConfigStandardSampleType(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @DeleteMapping("/delete") @Operation(summary = "删除标准样类型配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:delete')") public CommonResult deleteConfigStandardSampleType(@RequestParam("id") Long id) { configStandardSampleTypeService.deleteConfigStandardSampleType(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除标准样类型配置") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:delete')") public CommonResult deleteConfigStandardSampleTypeList(@RequestBody BatchDeleteReqVO req) { configStandardSampleTypeService.deleteConfigStandardSampleTypeListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @GetMapping("/get") @Operation(summary = "获得标准样类型配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:query')") public CommonResult getConfigStandardSampleType(@RequestParam("id") Long id) { ConfigStandardSampleTypeDO configStandardSampleType = configStandardSampleTypeService.getConfigStandardSampleType(id); return success(BeanUtils.toBean(configStandardSampleType, ConfigStandardSampleTypeRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得标准样类型配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:query')") public CommonResult> getConfigStandardSampleTypePage(@Valid ConfigStandardSampleTypePageReqVO pageReqVO) { PageResult pageResult = configStandardSampleTypeService.getConfigStandardSampleTypePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigStandardSampleTypeRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigStandardSampleTypeController implements BusinessControllerMar @GetMapping("/export-excel") @Operation(summary = "导出标准样类型配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-standard-sample-type:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigStandardSampleTypeExcel(@Valid ConfigStandardSampleTypePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java index 694ef2e..69af5fd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建子样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:create')") public CommonResult createConfigSubSample(@Valid @RequestBody ConfigSubSampleSaveReqVO createReqVO) { return success(configSubSampleService.createConfigSubSample(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:update')") public CommonResult updateConfigSubSample(@Valid @RequestBody ConfigSubSampleSaveReqVO updateReqVO) { configSubSampleService.updateConfigSubSample(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除子样配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:delete')") public CommonResult deleteConfigSubSample(@RequestParam("id") Long id) { configSubSampleService.deleteConfigSubSample(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:delete')") public CommonResult deleteConfigSubSampleList(@RequestBody BatchDeleteReqVO req) { configSubSampleService.deleteConfigSubSampleListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得子样配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:query')") public CommonResult getConfigSubSample(@RequestParam("id") Long id) { ConfigSubSampleDO configSubSample = configSubSampleService.getConfigSubSample(id); return success(BeanUtils.toBean(configSubSample, ConfigSubSampleRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得子样配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:query')") public CommonResult> getConfigSubSamplePage(@Valid ConfigSubSamplePageReqVO pageReqVO) { PageResult pageResult = configSubSampleService.getConfigSubSamplePage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSubSampleRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigSubSampleController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出子样配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSubSampleExcel(@Valid ConfigSubSamplePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java index c4a4fbb..6bbe270 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleMethodController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建子样与检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:create')") public CommonResult createConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO createReqVO) { return success(configSubSampleMethodService.createConfigSubSampleMethod(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新子样与检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:update')") public CommonResult updateConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO updateReqVO) { configSubSampleMethodService.updateConfigSubSampleMethod(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除子样与检测方法配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") public CommonResult deleteConfigSubSampleMethod(@RequestParam("id") Long id) { configSubSampleMethodService.deleteConfigSubSampleMethod(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除子样与检测方法配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')") public CommonResult deleteConfigSubSampleMethodList(@RequestBody BatchDeleteReqVO req) { configSubSampleMethodService.deleteConfigSubSampleMethodListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得子样与检测方法配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") public CommonResult getConfigSubSampleMethod(@RequestParam("id") Long id) { ConfigSubSampleMethodDO configSubSampleMethod = configSubSampleMethodService.getConfigSubSampleMethod(id); return success(BeanUtils.toBean(configSubSampleMethod, ConfigSubSampleMethodRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得子样与检测方法配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')") public CommonResult> getConfigSubSampleMethodPage(@Valid ConfigSubSampleMethodPageReqVO pageReqVO) { PageResult pageResult = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSubSampleMethodRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出子样与检测方法配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSubSampleMethodExcel(@Valid ConfigSubSampleMethodPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java index f1558d5..042d3d6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentController.java @@ -1,5 +1,8 @@ package com.zt.plat.module.qms.business.config.controller.admin; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentSaveReqVO; import org.springframework.web.bind.annotation.*; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -10,7 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.constraints.*; import jakarta.validation.*; import jakarta.servlet.http.*; import java.util.*; @@ -44,14 +46,14 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建分样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:create')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:create')") public CommonResult createConfigSubSampleParent(@Valid @RequestBody ConfigSubSampleParentSaveReqVO createReqVO) { return success(configSubSampleParentService.createConfigSubSampleParent(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新分样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:update')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:update')") public CommonResult updateConfigSubSampleParent(@Valid @RequestBody ConfigSubSampleParentSaveReqVO updateReqVO) { configSubSampleParentService.updateConfigSubSampleParent(updateReqVO); return success(true); @@ -60,7 +62,7 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除分样配置") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:delete')") public CommonResult deleteConfigSubSampleParent(@RequestParam("id") Long id) { configSubSampleParentService.deleteConfigSubSampleParent(id); return success(true); @@ -69,7 +71,7 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除分样配置") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:delete')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:delete')") public CommonResult deleteConfigSubSampleParentList(@RequestBody BatchDeleteReqVO req) { configSubSampleParentService.deleteConfigSubSampleParentListByIds(req.getIds()); return success(true); @@ -78,7 +80,7 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得分样配置") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:query')") public CommonResult getConfigSubSampleParent(@RequestParam("id") Long id) { ConfigSubSampleParentDO configSubSampleParent = configSubSampleParentService.getConfigSubSampleParent(id); return success(BeanUtils.toBean(configSubSampleParent, ConfigSubSampleParentRespVO.class)); @@ -86,7 +88,7 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得分样配置分页") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:query')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:query')") public CommonResult> getConfigSubSampleParentPage(@Valid ConfigSubSampleParentPageReqVO pageReqVO) { PageResult pageResult = configSubSampleParentService.getConfigSubSampleParentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ConfigSubSampleParentRespVO.class)); @@ -94,7 +96,7 @@ public class ConfigSubSampleParentController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出分样配置 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:export')") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent:export')") @ApiAccessLog(operateType = EXPORT) public void exportConfigSubSampleParentExcel(@Valid ConfigSubSampleParentPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java new file mode 100644 index 0000000..34bef7d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigSubSampleParentMethodController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; +import com.zt.plat.module.qms.business.config.service.ConfigSubSampleParentMethodService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 分样与检测方法配置") +@RestController +@RequestMapping("/qms/config-sub-sample-parent-method") +@Validated +public class ConfigSubSampleParentMethodController implements BusinessControllerMarker { + + + @Resource + private ConfigSubSampleParentMethodService configSubSampleParentMethodService; + + @PostMapping("/create") + @Operation(summary = "创建分样与检测方法配置") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:create')") + public CommonResult createConfigSubSampleParentMethod(@Valid @RequestBody ConfigSubSampleParentMethodSaveReqVO createReqVO) { + return success(configSubSampleParentMethodService.createConfigSubSampleParentMethod(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新分样与检测方法配置") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:update')") + public CommonResult updateConfigSubSampleParentMethod(@Valid @RequestBody ConfigSubSampleParentMethodSaveReqVO updateReqVO) { + configSubSampleParentMethodService.updateConfigSubSampleParentMethod(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除分样与检测方法配置") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:delete')") + public CommonResult deleteConfigSubSampleParentMethod(@RequestParam("id") Long id) { + configSubSampleParentMethodService.deleteConfigSubSampleParentMethod(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除分样与检测方法配置") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:delete')") + public CommonResult deleteConfigSubSampleParentMethodList(@RequestBody BatchDeleteReqVO req) { + configSubSampleParentMethodService.deleteConfigSubSampleParentMethodListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得分样与检测方法配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:query')") + public CommonResult getConfigSubSampleParentMethod(@RequestParam("id") Long id) { + ConfigSubSampleParentMethodDO configSubSampleParentMethod = configSubSampleParentMethodService.getConfigSubSampleParentMethod(id); + return success(BeanUtils.toBean(configSubSampleParentMethod, ConfigSubSampleParentMethodRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得分样与检测方法配置分页") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:query')") + public CommonResult> getConfigSubSampleParentMethodPage(@Valid ConfigSubSampleParentMethodPageReqVO pageReqVO) { + PageResult pageResult = configSubSampleParentMethodService.getConfigSubSampleParentMethodPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigSubSampleParentMethodRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出分样与检测方法配置 Excel") + //@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigSubSampleParentMethodExcel(@Valid ConfigSubSampleParentMethodPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configSubSampleParentMethodService.getConfigSubSampleParentMethodPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "分样与检测方法配置.xls", "数据", ConfigSubSampleParentMethodRespVO.class, + BeanUtils.toBean(list, ConfigSubSampleParentMethodRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java new file mode 100644 index 0000000..52982bd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigUserSignatureController.java @@ -0,0 +1,117 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; + +@Tag(name = "管理后台 - 手写签名配置") +@RestController +@RequestMapping("/qms/config-user-signature") +@Validated +@FileUploadController(source = "qms.configusersignature") +public class ConfigUserSignatureController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = ConfigUserSignatureController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private ConfigUserSignatureService configUserSignatureService; + + @PostMapping("/create") + @Operation(summary = "创建手写签名配置") + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:create')") + public CommonResult createConfigUserSignature(@Valid @RequestBody ConfigUserSignatureSaveReqVO createReqVO) { + return success(configUserSignatureService.createConfigUserSignature(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新手写签名配置") + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:update')") + public CommonResult updateConfigUserSignature(@Valid @RequestBody ConfigUserSignatureSaveReqVO updateReqVO) { + configUserSignatureService.updateConfigUserSignature(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除手写签名配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:delete')") + public CommonResult deleteConfigUserSignature(@RequestParam("id") Long id) { + configUserSignatureService.deleteConfigUserSignature(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除手写签名配置") + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:delete')") + public CommonResult deleteConfigUserSignatureList(@RequestBody BatchDeleteReqVO req) { + configUserSignatureService.deleteConfigUserSignatureListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得手写签名配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getConfigUserSignature(@RequestParam("id") Long id) { + ConfigUserSignatureDO configUserSignature = configUserSignatureService.getConfigUserSignature(id); + return success(BeanUtils.toBean(configUserSignature, ConfigUserSignatureRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得手写签名配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:query')") + public CommonResult> getConfigUserSignaturePage(@Valid ConfigUserSignaturePageReqVO pageReqVO) { + PageResult pageResult = configUserSignatureService.getConfigUserSignaturePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigUserSignatureRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出手写签名配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-user-signature:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigUserSignatureExcel(@Valid ConfigUserSignaturePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configUserSignatureService.getConfigUserSignaturePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "手写签名配置.xls", "数据", ConfigUserSignatureRespVO.class, + BeanUtils.toBean(list, ConfigUserSignatureRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java new file mode 100644 index 0000000..53b4614 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationController.java @@ -0,0 +1,109 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; + +@Tag(name = "管理后台 - 存放位置") +@RestController +@RequestMapping("/qms/config-warehouse-location") +@Validated +public class ConfigWarehouseLocationController implements BusinessControllerMarker { + + + @Resource + private ConfigWarehouseLocationService configWarehouseLocationService; + + @PostMapping("/create") + @Operation(summary = "创建存放位置") +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:create')") + public CommonResult createConfigWarehouseLocation(@Valid @RequestBody ConfigWarehouseLocationSaveReqVO createReqVO) { + return success(configWarehouseLocationService.createConfigWarehouseLocation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新存放位置") +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:update')") + public CommonResult updateConfigWarehouseLocation(@Valid @RequestBody ConfigWarehouseLocationSaveReqVO updateReqVO) { + configWarehouseLocationService.updateConfigWarehouseLocation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除存放位置") + @Parameter(name = "id", description = "编号", required = true) +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:delete')") + public CommonResult deleteConfigWarehouseLocation(@RequestParam("id") Long id) { + configWarehouseLocationService.deleteConfigWarehouseLocation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除存放位置") + @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:delete')") + public CommonResult deleteConfigWarehouseLocationList(@RequestBody BatchDeleteReqVO req) { + configWarehouseLocationService.deleteConfigWarehouseLocationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得存放位置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") + public CommonResult getConfigWarehouseLocation(@RequestParam("id") Long id) { + ConfigWarehouseLocationDO configWarehouseLocation = configWarehouseLocationService.getConfigWarehouseLocation(id); + return success(BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得存放位置分页") +// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") + public CommonResult> getConfigWarehouseLocationPage(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) { + PageResult pageResult = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigWarehouseLocationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出存放位置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigWarehouseLocationExcel(@Valid ConfigWarehouseLocationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "存放位置.xls", "数据", ConfigWarehouseLocationRespVO.class, + BeanUtils.toBean(list, ConfigWarehouseLocationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationInfomationController.java deleted file mode 100644 index 7f4abcd..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigWarehouseLocationInfomationController.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.zt.plat.module.qms.business.config.controller.admin; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import jakarta.validation.constraints.*; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.qms.business.config.controller.vo.*; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationInfomationDO; -import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationInfomationService; - -@Tag(name = "管理后台 - 样品库位信息") -@RestController -@RequestMapping("/qms/config-warehouse-location-infomation") -@Validated -public class ConfigWarehouseLocationInfomationController implements BusinessControllerMarker { - - - @Resource - private ConfigWarehouseLocationInfomationService configWarehouseLocationInfomationService; - - @PostMapping("/create") - @Operation(summary = "创建样品库位信息") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:create')") - public CommonResult createConfigWarehouseLocationInfomation(@Valid @RequestBody ConfigWarehouseLocationInfomationSaveReqVO createReqVO) { - return success(configWarehouseLocationInfomationService.createConfigWarehouseLocationInfomation(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新样品库位信息") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:update')") - public CommonResult updateConfigWarehouseLocationInfomation(@Valid @RequestBody ConfigWarehouseLocationInfomationSaveReqVO updateReqVO) { - configWarehouseLocationInfomationService.updateConfigWarehouseLocationInfomation(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除样品库位信息") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:delete')") - public CommonResult deleteConfigWarehouseLocationInfomation(@RequestParam("id") Long id) { - configWarehouseLocationInfomationService.deleteConfigWarehouseLocationInfomation(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除样品库位信息") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:delete')") - public CommonResult deleteConfigWarehouseLocationInfomationList(@RequestBody BatchDeleteReqVO req) { - configWarehouseLocationInfomationService.deleteConfigWarehouseLocationInfomationListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得样品库位信息") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:query')") - public CommonResult getConfigWarehouseLocationInfomation(@RequestParam("id") Long id) { - ConfigWarehouseLocationInfomationDO configWarehouseLocationInfomation = configWarehouseLocationInfomationService.getConfigWarehouseLocationInfomation(id); - return success(BeanUtils.toBean(configWarehouseLocationInfomation, ConfigWarehouseLocationInfomationRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得样品库位信息分页") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:query')") - public CommonResult> getConfigWarehouseLocationInfomationPage(@Valid ConfigWarehouseLocationInfomationPageReqVO pageReqVO) { - PageResult pageResult = configWarehouseLocationInfomationService.getConfigWarehouseLocationInfomationPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, ConfigWarehouseLocationInfomationRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出样品库位信息 Excel") - @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location-infomation:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportConfigWarehouseLocationInfomationExcel(@Valid ConfigWarehouseLocationInfomationPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = configWarehouseLocationInfomationService.getConfigWarehouseLocationInfomationPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "样品库位信息.xls", "数据", ConfigWarehouseLocationInfomationRespVO.class, - BeanUtils.toBean(list, ConfigWarehouseLocationInfomationRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java new file mode 100644 index 0000000..fb25d2a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFConversionRateController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFConversionRateService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 荧光数据采集特殊检测项目转换率配置") +@RestController +@RequestMapping("/qms/config-xrf-conversion-rate") +@Validated +public class ConfigXRFConversionRateController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFConversionRateService configXRFConversionRateService; + + @PostMapping("/create") + @Operation(summary = "创建荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:create')") + public CommonResult createConfigXRFConversionRate(@Valid @RequestBody ConfigXRFConversionRateSaveReqVO createReqVO) { + return success(configXRFConversionRateService.createConfigXRFConversionRate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:update')") + public CommonResult updateConfigXRFConversionRate(@Valid @RequestBody ConfigXRFConversionRateSaveReqVO updateReqVO) { + configXRFConversionRateService.updateConfigXRFConversionRate(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光数据采集特殊检测项目转换率配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:delete')") + public CommonResult deleteConfigXRFConversionRate(@RequestParam("id") Long id) { + configXRFConversionRateService.deleteConfigXRFConversionRate(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光数据采集特殊检测项目转换率配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:delete')") + public CommonResult deleteConfigXRFConversionRateList(@RequestBody BatchDeleteReqVO req) { + configXRFConversionRateService.deleteConfigXRFConversionRateListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光数据采集特殊检测项目转换率配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:query')") + public CommonResult getConfigXRFConversionRate(@RequestParam("id") Long id) { + ConfigXRFConversionRateDO configXRFConversionRate = configXRFConversionRateService.getConfigXRFConversionRate(id); + return success(BeanUtils.toBean(configXRFConversionRate, ConfigXRFConversionRateRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光数据采集特殊检测项目转换率配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:query')") + public CommonResult> getConfigXRFConversionRatePage(@Valid ConfigXRFConversionRatePageReqVO pageReqVO) { + PageResult pageResult = configXRFConversionRateService.getConfigXRFConversionRatePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFConversionRateRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光数据采集特殊检测项目转换率配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-conversion-rate:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFConversionRateExcel(@Valid ConfigXRFConversionRatePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFConversionRateService.getConfigXRFConversionRatePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光数据采集特殊检测项目转换率配置.xls", "数据", ConfigXRFConversionRateRespVO.class, + BeanUtils.toBean(list, ConfigXRFConversionRateRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java new file mode 100644 index 0000000..b562b9d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFLineController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFLineService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 荧光分析线") +@RestController +@RequestMapping("/qms/config-xrf-line") +@Validated +public class ConfigXRFLineController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFLineService configXRFLineService; + + @PostMapping("/create") + @Operation(summary = "创建荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:create')") + public CommonResult createConfigXRFLine(@Valid @RequestBody ConfigXRFLineSaveReqVO createReqVO) { + return success(configXRFLineService.createConfigXRFLine(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:update')") + public CommonResult updateConfigXRFLine(@Valid @RequestBody ConfigXRFLineSaveReqVO updateReqVO) { + configXRFLineService.updateConfigXRFLine(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光分析线") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:delete')") + public CommonResult deleteConfigXRFLine(@RequestParam("id") Long id) { + configXRFLineService.deleteConfigXRFLine(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光分析线") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:delete')") + public CommonResult deleteConfigXRFLineList(@RequestBody BatchDeleteReqVO req) { + configXRFLineService.deleteConfigXRFLineListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光分析线") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:query')") + public CommonResult getConfigXRFLine(@RequestParam("id") Long id) { + ConfigXRFLineDO configXRFLine = configXRFLineService.getConfigXRFLine(id); + return success(BeanUtils.toBean(configXRFLine, ConfigXRFLineRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光分析线分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:query')") + public CommonResult> getConfigXRFLinePage(@Valid ConfigXRFLinePageReqVO pageReqVO) { + PageResult pageResult = configXRFLineService.getConfigXRFLinePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFLineRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光分析线 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-line:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFLineExcel(@Valid ConfigXRFLinePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFLineService.getConfigXRFLinePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光分析线.xls", "数据", ConfigXRFLineRespVO.class, + BeanUtils.toBean(list, ConfigXRFLineRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java new file mode 100644 index 0000000..44f806d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/ConfigXRFProjectController.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.constraints.*; +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; +import com.zt.plat.module.qms.business.config.service.ConfigXRFProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 荧光采集检测项目配置") +@RestController +@RequestMapping("/qms/config-xrf-project") +@Validated +public class ConfigXRFProjectController implements BusinessControllerMarker { + + + @Resource + private ConfigXRFProjectService configXRFProjectService; + + @PostMapping("/create") + @Operation(summary = "创建荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:create')") + public CommonResult createConfigXRFProject(@Valid @RequestBody ConfigXRFProjectSaveReqVO createReqVO) { + return success(configXRFProjectService.createConfigXRFProject(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:update')") + public CommonResult updateConfigXRFProject(@Valid @RequestBody ConfigXRFProjectSaveReqVO updateReqVO) { + configXRFProjectService.updateConfigXRFProject(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除荧光采集检测项目配置") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:delete')") + public CommonResult deleteConfigXRFProject(@RequestParam("id") Long id) { + configXRFProjectService.deleteConfigXRFProject(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除荧光采集检测项目配置") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:delete')") + public CommonResult deleteConfigXRFProjectList(@RequestBody BatchDeleteReqVO req) { + configXRFProjectService.deleteConfigXRFProjectListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得荧光采集检测项目配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:query')") + public CommonResult getConfigXRFProject(@RequestParam("id") Long id) { + ConfigXRFProjectDO configXRFProject = configXRFProjectService.getConfigXRFProject(id); + return success(BeanUtils.toBean(configXRFProject, ConfigXRFProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得荧光采集检测项目配置分页") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:query')") + public CommonResult> getConfigXRFProjectPage(@Valid ConfigXRFProjectPageReqVO pageReqVO) { + PageResult pageResult = configXRFProjectService.getConfigXRFProjectPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ConfigXRFProjectRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出荧光采集检测项目配置 Excel") + @PreAuthorize("@ss.hasPermission('qms:config-XRF-project:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportConfigXRFProjectExcel(@Valid ConfigXRFProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = configXRFProjectService.getConfigXRFProjectPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "荧光采集检测项目配置.xls", "数据", ConfigXRFProjectRespVO.class, + BeanUtils.toBean(list, ConfigXRFProjectRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java index c70b3a7..b4d9fc4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardController.java @@ -49,7 +49,7 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @PostMapping("/createTempData") @Operation(summary = "创建检测标准临时数据") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:create')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:create')") public CommonResult createTempData() { MaterialAssayStandardSaveReqVO vo = new MaterialAssayStandardSaveReqVO(); vo.setRemark(MaterialAssayStandardMapper.tempDataKey); @@ -61,14 +61,14 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建检测标准") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:create')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:create')") public CommonResult createMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO createReqVO) { return success(materialAssayStandardService.createMaterialAssayStandard(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测标准") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')") public CommonResult updateMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO updateReqVO) { materialAssayStandardService.updateMaterialAssayStandard(updateReqVO); return success(true); @@ -77,7 +77,7 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除检测标准") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:delete')") public CommonResult deleteMaterialAssayStandard(@RequestParam("id") Long id) { materialAssayStandardService.deleteMaterialAssayStandard(id); return success(true); @@ -86,7 +86,7 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测标准") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:delete')") public CommonResult deleteMaterialAssayStandardList(@RequestBody BatchDeleteReqVO req) { materialAssayStandardService.deleteMaterialAssayStandardListByIds(req.getIds()); return success(true); @@ -95,7 +95,7 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得检测标准") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:query')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:query')") public CommonResult getMaterialAssayStandard(@RequestParam("id") Long id) { MaterialAssayStandardDO materialAssayStandard = materialAssayStandardService.getMaterialAssayStandard(id); return success(BeanUtils.toBean(materialAssayStandard, MaterialAssayStandardRespVO.class)); @@ -132,7 +132,7 @@ public class MaterialAssayStandardController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出检测标准 Excel") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard:export')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:export')") @ApiAccessLog(operateType = EXPORT) public void exportMaterialAssayStandardExcel(@Valid MaterialAssayStandardPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java index 91dd233..4e326f8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardDetailController.java @@ -76,14 +76,14 @@ public class MaterialAssayStandardDetailController implements BusinessController @PostMapping("/create") @Operation(summary = "创建物料检测标准检测项目") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')") public CommonResult createMaterialAssayStandardDetail(@Valid @RequestBody MaterialAssayStandardDetailSaveReqVO createReqVO) { return success(materialAssayStandardDetailService.createMaterialAssayStandardDetail(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新物料检测标准检测项目") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:update')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:update')") public CommonResult updateMaterialAssayStandardDetail(@Valid @RequestBody MaterialAssayStandardDetailSaveReqVO updateReqVO) { materialAssayStandardDetailService.updateMaterialAssayStandardDetail(updateReqVO); return success(true); @@ -92,7 +92,7 @@ public class MaterialAssayStandardDetailController implements BusinessController @DeleteMapping("/delete") @Operation(summary = "删除物料检测标准检测项目") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:delete')") public CommonResult deleteMaterialAssayStandardDetail(@RequestParam("id") Long id) { materialAssayStandardDetailService.deleteMaterialAssayStandardDetail(id); return success(true); @@ -101,7 +101,7 @@ public class MaterialAssayStandardDetailController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除物料检测标准检测项目") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:delete')") public CommonResult deleteMaterialAssayStandardDetailList(@RequestBody BatchDeleteReqVO req) { materialAssayStandardDetailService.deleteMaterialAssayStandardDetailListByIds(req.getIds()); return success(true); @@ -110,7 +110,7 @@ public class MaterialAssayStandardDetailController implements BusinessController @GetMapping("/get") @Operation(summary = "获得物料检测标准检测项目") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')") public CommonResult getMaterialAssayStandardDetail(@RequestParam("id") Long id) { MaterialAssayStandardDetailDO materialAssayStandardDetail = materialAssayStandardDetailService.getMaterialAssayStandardDetail(id); return success(BeanUtils.toBean(materialAssayStandardDetail, MaterialAssayStandardDetailRespVO.class)); @@ -118,7 +118,7 @@ public class MaterialAssayStandardDetailController implements BusinessController @GetMapping("/page") @Operation(summary = "获得物料检测标准检测项目分页") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')") public CommonResult> getMaterialAssayStandardDetailPage(@Valid MaterialAssayStandardDetailPageReqVO pageReqVO) { PageResult pageResult = materialAssayStandardDetailService.getMaterialAssayStandardDetailPage(pageReqVO); return success(BeanUtils.toBean(pageResult, MaterialAssayStandardDetailRespVO.class)); @@ -126,7 +126,7 @@ public class MaterialAssayStandardDetailController implements BusinessController @GetMapping("/export-excel") @Operation(summary = "导出物料检测标准检测项目 Excel") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:export')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:export')") @ApiAccessLog(operateType = EXPORT) public void exportMaterialAssayStandardDetailExcel(@Valid MaterialAssayStandardDetailPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java new file mode 100644 index 0000000..a0fbf10 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardForecastProjectController.java @@ -0,0 +1,114 @@ +package com.zt.plat.module.qms.business.config.controller.admin; + +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardForecastProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardForecastProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardForecastProjectSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardForecastProjectDO; +import com.zt.plat.module.qms.business.config.service.MaterialAssayStandardForecastProjectService; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +@Tag(name = "管理后台 - 物料检测标准来样品位配置") +@RestController +@RequestMapping("/qms/material-assay-standard-forecast-project") +@Validated +public class MaterialAssayStandardForecastProjectController implements BusinessControllerMarker { + + + @Resource + private MaterialAssayStandardForecastProjectService materialAssayStandardForecastProjectService; + + @PostMapping("/create") + @Operation(summary = "创建物料检测标准来样品位配置") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:create')") + public CommonResult createMaterialAssayStandardForecastProject(@Valid @RequestBody MaterialAssayStandardForecastProjectSaveReqVO createReqVO) { + return success(materialAssayStandardForecastProjectService.createMaterialAssayStandardForecastProject(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料检测标准来样品位配置") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:update')") + public CommonResult updateMaterialAssayStandardForecastProject(@Valid @RequestBody MaterialAssayStandardForecastProjectSaveReqVO updateReqVO) { + materialAssayStandardForecastProjectService.updateMaterialAssayStandardForecastProject(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料检测标准来样品位配置") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:delete')") + public CommonResult deleteMaterialAssayStandardForecastProject(@RequestParam("id") Long id) { + materialAssayStandardForecastProjectService.deleteMaterialAssayStandardForecastProject(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料检测标准来样品位配置") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:delete')") + public CommonResult deleteMaterialAssayStandardForecastProjectList(@RequestBody BatchDeleteReqVO req) { + materialAssayStandardForecastProjectService.deleteMaterialAssayStandardForecastProjectListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料检测标准来样品位配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:query')") + public CommonResult getMaterialAssayStandardForecastProject(@RequestParam("id") Long id) { + MaterialAssayStandardForecastProjectDO materialAssayStandardForecastProject = materialAssayStandardForecastProjectService.getMaterialAssayStandardForecastProject(id); + return success(BeanUtils.toBean(materialAssayStandardForecastProject, MaterialAssayStandardForecastProjectRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料检测标准来样品位配置分页") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:query')") + public CommonResult> getMaterialAssayStandardForecastProjectPage(@Valid MaterialAssayStandardForecastProjectPageReqVO pageReqVO) { + PageResult pageResult = materialAssayStandardForecastProjectService.getMaterialAssayStandardForecastProjectPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialAssayStandardForecastProjectRespVO.class)); + } + + @GetMapping("/list") + public CommonResult getMaterialAssayStandardForecastProjectList(MaterialAssayStandardForecastProjectReqVO reqVO) { + List list = materialAssayStandardForecastProjectService.getMaterialAssayStandardForecastProjectList(reqVO); + return success(list); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料检测标准来样品位配置 Excel") + //@PreAuthorize("@ss.hasPermission('t:material-assay-standard-forecast-project:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialAssayStandardForecastProjectExcel(@Valid MaterialAssayStandardForecastProjectPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialAssayStandardForecastProjectService.getMaterialAssayStandardForecastProjectPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料检测标准来样品位配置.xls", "数据", MaterialAssayStandardForecastProjectRespVO.class, + BeanUtils.toBean(list, MaterialAssayStandardForecastProjectRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java index 1b04b04..1cdeb1b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/admin/MaterialAssayStandardMethodController.java @@ -45,14 +45,14 @@ public class MaterialAssayStandardMethodController implements BusinessController @PostMapping("/create") @Operation(summary = "创建物料检测标准与方法") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:create')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:create')") public CommonResult createMaterialAssayStandardMethod(@Valid @RequestBody MaterialAssayStandardMethodSaveReqVO createReqVO) { return success(materialAssayStandardMethodService.createMaterialAssayStandardMethod(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新物料检测标准与方法") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:update')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:update')") public CommonResult updateMaterialAssayStandardMethod(@Valid @RequestBody MaterialAssayStandardMethodSaveReqVO updateReqVO) { materialAssayStandardMethodService.updateMaterialAssayStandardMethod(updateReqVO); return success(true); @@ -61,7 +61,7 @@ public class MaterialAssayStandardMethodController implements BusinessController @DeleteMapping("/delete") @Operation(summary = "删除物料检测标准与方法") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:delete')") public CommonResult deleteMaterialAssayStandardMethod(@RequestParam("id") Long id) { materialAssayStandardMethodService.deleteMaterialAssayStandardMethod(id); return success(true); @@ -70,7 +70,7 @@ public class MaterialAssayStandardMethodController implements BusinessController @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除物料检测标准与方法") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:delete')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:delete')") public CommonResult deleteMaterialAssayStandardMethodList(@RequestBody BatchDeleteReqVO req) { materialAssayStandardMethodService.deleteMaterialAssayStandardMethodListByIds(req.getIds()); return success(true); @@ -79,7 +79,7 @@ public class MaterialAssayStandardMethodController implements BusinessController @GetMapping("/get") @Operation(summary = "获得物料检测标准与方法") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:query')") public CommonResult getMaterialAssayStandardMethod(@RequestParam("id") Long id) { MaterialAssayStandardMethodDO materialAssayStandardMethod = materialAssayStandardMethodService.getMaterialAssayStandardMethod(id); return success(BeanUtils.toBean(materialAssayStandardMethod, MaterialAssayStandardMethodRespVO.class)); @@ -87,7 +87,7 @@ public class MaterialAssayStandardMethodController implements BusinessController @GetMapping("/page") @Operation(summary = "获得物料检测标准与方法分页") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:query')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:query')") public CommonResult> getMaterialAssayStandardMethodPage(@Valid MaterialAssayStandardMethodPageReqVO pageReqVO) { PageResult pageResult = materialAssayStandardMethodService.getMaterialAssayStandardMethodPage(pageReqVO); return success(BeanUtils.toBean(pageResult, MaterialAssayStandardMethodRespVO.class)); @@ -95,7 +95,7 @@ public class MaterialAssayStandardMethodController implements BusinessController @GetMapping("/export-excel") @Operation(summary = "导出物料检测标准与方法 Excel") - @PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:export')") + //@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-method:export')") @ApiAccessLog(operateType = EXPORT) public void exportMaterialAssayStandardMethodExcel(@Valid MaterialAssayStandardMethodPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java index 5a403cf..d5f78f4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSamplePageReqVO.java @@ -1,6 +1,7 @@ package com.zt.plat.module.qms.business.config.controller.vo; import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; @@ -12,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BaseSamplePageReqVO extends PageParam { - @Schema(description = "大类名称", example = "王五") - private String sampleName; + @Schema(description = "样品大类名称", example = "王五") + private String name; - @Schema(description = "物料ID", example = "12840") + @Schema(description = "物料ID", example = "16711") private Long materialId; @Schema(description = "物料代码") @@ -24,13 +25,13 @@ public class BaseSamplePageReqVO extends PageParam { @Schema(description = "物料名称", example = "芋艿") private String materialName; - @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", example = "19234") + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", example = "29325") private Long dictionaryBusinessId; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleRespVO.java index 0e3f74f..fab165e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleRespVO.java @@ -14,15 +14,15 @@ import static com.zt.plat.module.qms.core.constant.DataTypeConstant.DICT_ANNOTAT @ExcelIgnoreUnannotated public class BaseSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6009") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14383") @ExcelProperty("ID") private Long id; - @Schema(description = "大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @ExcelProperty("大类名称") - private String sampleName; + @Schema(description = "样品大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("样品大类名称") + private String name; - @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12840") + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16711") @ExcelProperty("物料ID") private Long materialId; @@ -34,17 +34,17 @@ public class BaseSampleRespVO { @ExcelProperty("物料名称") private String materialName; - @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", requiredMode = Schema.RequiredMode.REQUIRED, example = "19234") + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", requiredMode = Schema.RequiredMode.REQUIRED, example = "29325") @ExcelProperty("样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样") @Dict(dicCode = "sampleType", keyOrID = DICT_ANNOTATION_KEY_TYPE_ID) private Long dictionaryBusinessId; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleSaveReqVO.java index ca7e405..31b9280 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BaseSampleSaveReqVO.java @@ -2,20 +2,21 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import java.util.*; import jakarta.validation.constraints.*; @Schema(description = "管理后台 - 样品大类管理新增/修改 Request VO") @Data public class BaseSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6009") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14383") private Long id; - @Schema(description = "大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "大类名称不能为空") - private String sampleName; + @Schema(description = "样品大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "样品大类名称不能为空") + private String name; - @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12840") + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16711") @NotNull(message = "物料ID不能为空") private Long materialId; @@ -25,11 +26,11 @@ public class BaseSampleSaveReqVO { @Schema(description = "物料名称", example = "芋艿") private String materialName; - @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", requiredMode = Schema.RequiredMode.REQUIRED, example = "19234") + @Schema(description = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样", requiredMode = Schema.RequiredMode.REQUIRED, example = "29325") @NotNull(message = "样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样不能为空") private Long dictionaryBusinessId; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BusinessAssayTaskAnalysisDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BusinessAssayTaskAnalysisDataRespVO.java new file mode 100644 index 0000000..45fb2a9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/BusinessAssayTaskAnalysisDataRespVO.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import java.util.List; +import java.util.Map; + +import com.zt.plat.module.qms.business.bus.controller.vo.BatchSampleAnalysisColumnRespVO; + +import lombok.Data; + +/** + * 分析数据 + */ +@Data +public class BusinessAssayTaskAnalysisDataRespVO { + + /** 分析类型 **/ + private String analysisType; + + /** 分析名称 **/ + private String analysisName; + + /** 排序号 **/ + private Integer sortNo; + + /** 质控方法 **/ + private ConfigQCSampleMethodExtendRespVO configQCSampleMethod; + + /** 分析的列 **/ + private List columns; + + /** 分析的数据 **/ + private List> datas; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodExtendRespVO.java index 505fe45..1978d9b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodExtendRespVO.java @@ -2,7 +2,6 @@ package com.zt.plat.module.qms.business.config.controller.vo; import java.util.List; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import lombok.Data; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java index 1a9f71b..662d05e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodPageReqVO.java @@ -13,10 +13,16 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigAssayMethodPageReqVO extends PageParam { - @Schema(description = "方法库ID", example = "31274") + @Schema(description = "方法库ID", example = "9346") private Long methodConfigId; - @Schema(description = "方法名称", example = "王五") + @Schema(description = "方法类别ID,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等", example = "9102") + private Long dictionaryBusinessId; + + @Schema(description = "方法类别KEY,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等") + private String dictionaryBusinessKey; + + @Schema(description = "方法名称", example = "李四") private String name; @Schema(description = "方法编号") @@ -25,17 +31,23 @@ public class ConfigAssayMethodPageReqVO extends PageParam { @Schema(description = "描述") private String description; + @Schema(description = "数据集Key,T_DAT_COLT_FLD") + private String dataCollectionKey; + @Schema(description = "是否启用,1-启用,0-不启用") private Integer isEnabled; - @Schema(description = "任务模版key") - private String templateKey; + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; @Schema(description = "任务单编号规则") private String codeRule; @Schema(description = "分配方式,【字典】【jy_assay_method_assign_way】随机分配,按顺序分配,自动分配") - private Integer assignWay; + private String assignWay; @Schema(description = "展示平台,【字典】【jy_assay_method_assign_platform】pad、pc、pad&pc") private String assignPlatform; @@ -43,13 +55,16 @@ public class ConfigAssayMethodPageReqVO extends PageParam { @Schema(description = "任务分配表单配置信息,是否添加质控样;是否过筛;是否预览打印;是否查询S值范围;是否需要流程审批;流程审批编码;退回样品审批流程编码:任务完成时的提交方式;指派单抬头key") private String assayTaskInfomation; - @Schema(description = "检测部门编号") - private String assayDepartmentCode; + @Schema(description = "分析部门ID", example = "31510") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java new file mode 100644 index 0000000..fd7b1b6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentPageReqVO.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测方法分析项目判定分页 Request VO") +@Data +public class ConfigAssayMethodProjectAssessmentPageReqVO extends PageParam { + + @Schema(description = "检测方法配置ID", example = "18120") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", example = "10083") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "31414") + private Long dictionaryProjectId; + + @Schema(description = "级别") + private Integer assessmentLevel; + + @Schema(description = "范围") + private String assessmentRange; + + @Schema(description = "最小允差值") + private String minimumToleraanceValue; + + @Schema(description = "最大允差值") + private String maximumToleraanceValue; + + @Schema(description = "最小值") + private String minimumValue; + + @Schema(description = "最大值") + private String maximumValue; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "是否使用公式计算计算允差值,1-是,0-否") + private Integer isUseFormula; + + @Schema(description = "允差值调整参数") + private String toleraanceAdjustmentValue; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java new file mode 100644 index 0000000..2501d8e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentRespVO.java @@ -0,0 +1,83 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 检测方法分析项目判定 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigAssayMethodProjectAssessmentRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "912") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18120") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10083") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "31414") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "级别") + @ExcelProperty("级别") + private Integer assessmentLevel; + + @Schema(description = "范围") + @ExcelProperty("范围") + private String assessmentRange; + + @Schema(description = "最小允差值") + @ExcelProperty("最小允差值") + private String minimumToleraanceValue; + + @Schema(description = "最大允差值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("最大允差值") + private String maximumToleraanceValue; + + @Schema(description = "最小值") + @ExcelProperty("最小值") + private String minimumValue; + + @Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("最大值") + private String maximumValue; + + @Schema(description = "计算公式") + @ExcelProperty("计算公式") + private String formula; + + @Schema(description = "是否使用公式计算计算允差值,1-是,0-否") + @ExcelProperty("是否使用公式计算计算允差值,1-是,0-否") + private Integer isUseFormula; + + @Schema(description = "允差值调整参数") + @ExcelProperty("允差值调整参数") + private String toleraanceAdjustmentValue; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java new file mode 100644 index 0000000..efd5e17 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectAssessmentSaveReqVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 检测方法分析项目判定新增/修改 Request VO") +@Data +public class ConfigAssayMethodProjectAssessmentSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "912") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18120") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10083") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "31414") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "级别") + private Integer assessmentLevel; + + @Schema(description = "范围") + private String assessmentRange; + + @Schema(description = "最小允差值") + private String minimumToleraanceValue; + + @Schema(description = "最大允差值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "最大允差值不能为空") + private String maximumToleraanceValue; + + @Schema(description = "最小值") + private String minimumValue; + + @Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "最大值不能为空") + private String maximumValue; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "是否使用公式计算计算允差值,1-是,0-否") + private Integer isUseFormula; + + @Schema(description = "允差值调整参数") + private String toleraanceAdjustmentValue; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java new file mode 100644 index 0000000..716b853 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测方法分析项目补正系数分页 Request VO") +@Data +public class ConfigAssayMethodProjectCoefficientPageReqVO extends PageParam { + + @Schema(description = "检测方法配置ID", example = "10243") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", example = "2854") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "23760") + private Long dictionaryProjectId; + + @Schema(description = "检测项目缩写", example = "李四") + private String projectSimpleName; + + @Schema(description = "范围") + private String range; + + @Schema(description = "最小值") + private String minimumValue; + + @Schema(description = "最大值") + private String maximumValue; + + @Schema(description = "补正系数") + private BigDecimal coefficient; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java new file mode 100644 index 0000000..83cd2c9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java @@ -0,0 +1,68 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 检测方法分析项目补正系数 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigAssayMethodProjectCoefficientRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26850") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2854") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "23760") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测项目缩写", example = "李四") + @ExcelProperty("检测项目缩写") + private String projectSimpleName; + + @Schema(description = "范围") + @ExcelProperty("范围") + private String range; + + @Schema(description = "最小值") + @ExcelProperty("最小值") + private String minimumValue; + + @Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("最大值") + private String maximumValue; + + @Schema(description = "补正系数") + @ExcelProperty("补正系数") + private BigDecimal coefficient; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java new file mode 100644 index 0000000..d588ce5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 检测方法分析项目补正系数新增/修改 Request VO") +@Data +public class ConfigAssayMethodProjectCoefficientSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26850") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10243") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2854") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "23760") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目缩写", example = "李四") + private String projectSimpleName; + + @Schema(description = "范围") + private String range; + + @Schema(description = "最小值") + private String minimumValue; + + @Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "最大值不能为空") + private String maximumValue; + + @Schema(description = "补正系数") + private BigDecimal coefficient; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java new file mode 100644 index 0000000..73e938d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProjectRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectPageReqVO.java index 9ef7a4e..d3d0d07 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectPageReqVO.java @@ -13,13 +13,13 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigAssayMethodProjectPageReqVO extends PageParam { - @Schema(description = "检测方法ID", example = "30102") + @Schema(description = "检测方法配置ID", example = "5225") private Long configAssayMethodId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "906") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "32510") private Long dictionaryProjectId; - @Schema(description = "检测单位ID,UNT表", example = "15001") + @Schema(description = "检测单位ID,UNT表", example = "8007") private Long unitId; @Schema(description = "单位") @@ -43,13 +43,22 @@ public class ConfigAssayMethodProjectPageReqVO extends PageParam { @Schema(description = "是否默认启用,1-启用,0-不启用") private Integer isDefaultEnabled; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; + + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "排序号") + private Integer sortNo; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java index ad3326e..36a97b8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterPageReqVO.java @@ -13,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam { - @Schema(description = "检测方法分析项目ID", example = "4278") + @Schema(description = "检测方法分析项目配置ID", example = "29746") private Long configAssayMethodProjectId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "8889") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "1283") private Long dictionaryParameterId; @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2") @@ -37,13 +37,19 @@ public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam { @Schema(description = "pc界面是否显示") private Integer isShow; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java index 6cc965a..c134894 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterRespVO.java @@ -12,15 +12,15 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigAssayMethodProjectParameterRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18320") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14738") @ExcelProperty("ID") private Long id; - @Schema(description = "检测方法分析项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4278") - @ExcelProperty("检测方法分析项目ID") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29746") + @ExcelProperty("检测方法分析项目配置ID") private Long configAssayMethodProjectId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "8889") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "1283") @ExcelProperty("参数ID,字典表【T_DIC_PRM】") private Long dictionaryParameterId; @@ -48,16 +48,22 @@ public class ConfigAssayMethodProjectParameterRespVO { @ExcelProperty("pc界面是否显示") private Integer isShow; - @Schema(description = "排序") - @ExcelProperty("排序") - private Integer sort; + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java index 95e37ab..bc46b2c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectParameterSaveReqVO.java @@ -9,14 +9,14 @@ import jakarta.validation.constraints.*; @Data public class ConfigAssayMethodProjectParameterSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18320") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14738") private Long id; - @Schema(description = "检测方法分析项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4278") - @NotNull(message = "检测方法分析项目ID不能为空") + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29746") + @NotNull(message = "检测方法分析项目配置ID不能为空") private Long configAssayMethodProjectId; - @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "8889") + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "1283") @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") private Long dictionaryParameterId; @@ -41,11 +41,16 @@ public class ConfigAssayMethodProjectParameterSaveReqVO { @NotNull(message = "pc界面是否显示不能为空") private Integer isShow; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "排序号") + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangePageReqVO.java new file mode 100644 index 0000000..d476294 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangePageReqVO.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测方法分析项目区间分页 Request VO") +@Data +public class ConfigAssayMethodProjectRangePageReqVO extends PageParam { + + @Schema(description = "检测方法配置ID", example = "6862") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", example = "11556") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "2925") + private Long dictionaryProjectId; + + @Schema(description = "范围类型,控制范围类型(0-不控制;1-只警告;2-只限制;3-警告+限制)", example = "2") + private String rangeType; + + @Schema(description = "最小限制值") + private String minimumValue; + + @Schema(description = "最小警告值") + private String minimumWarningValue; + + @Schema(description = "最大警告值") + private String maximumWarningValue; + + @Schema(description = "最大限制值") + private String maximumValue; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeRespVO.java new file mode 100644 index 0000000..d03ffb1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeRespVO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 检测方法分析项目区间 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigAssayMethodProjectRangeRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25632") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6862") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11556") + @ExcelProperty("检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "2925") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "范围类型,控制范围类型(0-不控制;1-只警告;2-只限制;3-警告+限制)", example = "2") + @ExcelProperty("范围类型,控制范围类型(0-不控制;1-只警告;2-只限制;3-警告+限制)") + private String rangeType; + + @Schema(description = "最小限制值") + @ExcelProperty("最小限制值") + private String minimumValue; + + @Schema(description = "最小警告值") + @ExcelProperty("最小警告值") + private String minimumWarningValue; + + @Schema(description = "最大警告值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("最大警告值") + private String maximumWarningValue; + + @Schema(description = "最大限制值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("最大限制值") + private String maximumValue; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeSaveReqVO.java new file mode 100644 index 0000000..b063629 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRangeSaveReqVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 检测方法分析项目区间新增/修改 Request VO") +@Data +public class ConfigAssayMethodProjectRangeSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25632") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6862") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11556") + @NotNull(message = "检测方法分析项目配置ID不能为空") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "2925") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "范围类型,控制范围类型(0-不控制;1-只警告;2-只限制;3-警告+限制)", example = "2") + private String rangeType; + + @Schema(description = "最小限制值") + private String minimumValue; + + @Schema(description = "最小警告值") + private String minimumWarningValue; + + @Schema(description = "最大警告值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "最大警告值不能为空") + private String maximumWarningValue; + + @Schema(description = "最大限制值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "最大限制值不能为空") + private String maximumValue; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRespVO.java index bf9c593..10efb98 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectRespVO.java @@ -12,19 +12,19 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigAssayMethodProjectRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24391") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12771") @ExcelProperty("ID") private Long id; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30102") - @ExcelProperty("检测方法ID") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5225") + @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "906") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32510") @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") private Long dictionaryProjectId; - @Schema(description = "检测单位ID,UNT表", example = "15001") + @Schema(description = "检测单位ID,UNT表", example = "8007") @ExcelProperty("检测单位ID,UNT表") private Long unitId; @@ -56,16 +56,25 @@ public class ConfigAssayMethodProjectRespVO { @ExcelProperty("是否默认启用,1-启用,0-不启用") private Integer isDefaultEnabled; - @Schema(description = "排序") - @ExcelProperty("排序") - private Integer sort; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectSaveReqVO.java index f6725b6..6cdaf11 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectSaveReqVO.java @@ -9,18 +9,18 @@ import jakarta.validation.constraints.*; @Data public class ConfigAssayMethodProjectSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24391") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12771") private Long id; - @Schema(description = "检测方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30102") - @NotNull(message = "检测方法ID不能为空") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5225") + @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; - @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "906") + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "32510") @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") private Long dictionaryProjectId; - @Schema(description = "检测单位ID,UNT表", example = "15001") + @Schema(description = "检测单位ID,UNT表", example = "8007") private Long unitId; @Schema(description = "单位") @@ -47,11 +47,19 @@ public class ConfigAssayMethodProjectSaveReqVO { @NotNull(message = "是否默认启用,1-启用,0-不启用不能为空") private Integer isDefaultEnabled; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "方法检出下限值") + private String minimumLimitValue; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java index 44b4e24..da30560 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodReqVO.java @@ -11,12 +11,18 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Schema(description = "管理后台 - 检测方法配置分页 Request VO") @Data -public class ConfigAssayMethodReqVO extends PageParam { +public class ConfigAssayMethodReqVO { - @Schema(description = "方法库ID", example = "31274") + @Schema(description = "方法库ID", example = "9346") private Long methodConfigId; - @Schema(description = "方法名称", example = "王五") + @Schema(description = "方法类别ID,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等", example = "9102") + private Long dictionaryBusinessId; + + @Schema(description = "方法类别KEY,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等") + private String dictionaryBusinessKey; + + @Schema(description = "方法名称", example = "李四") private String name; @Schema(description = "方法编号") @@ -25,11 +31,17 @@ public class ConfigAssayMethodReqVO extends PageParam { @Schema(description = "描述") private String description; + @Schema(description = "数据集Key,T_DAT_COLT_FLD") + private String dataCollectionKey; + @Schema(description = "是否启用,1-启用,0-不启用") private Integer isEnabled; - @Schema(description = "任务模版key") - private String templateKey; + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; @Schema(description = "任务单编号规则") private String codeRule; @@ -43,13 +55,16 @@ public class ConfigAssayMethodReqVO extends PageParam { @Schema(description = "任务分配表单配置信息,是否添加质控样;是否过筛;是否预览打印;是否查询S值范围;是否需要流程审批;流程审批编码;退回样品审批流程编码:任务完成时的提交方式;指派单抬头key") private String assayTaskInfomation; - @Schema(description = "检测部门编号") - private String assayDepartmentCode; + @Schema(description = "分析部门ID", example = "31510") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java index b60fd94..08bfc94 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodRespVO.java @@ -12,15 +12,21 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigAssayMethodRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31987") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3640") @ExcelProperty("ID") private Long id; - @Schema(description = "方法库ID", example = "31274") + @Schema(description = "方法库ID", example = "9346") @ExcelProperty("方法库ID") private Long methodConfigId; - @Schema(description = "方法名称", example = "王五") + @Schema(description = "方法类别ID,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等", example = "9102") + private Long dictionaryBusinessId; + + @Schema(description = "方法类别KEY,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等") + private String dictionaryBusinessKey; + + @Schema(description = "方法名称", example = "李四") @ExcelProperty("方法名称") private String name; @@ -32,13 +38,20 @@ public class ConfigAssayMethodRespVO { @ExcelProperty("描述") private String description; + @Schema(description = "数据集Key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数据集Key,T_DAT_COLT_FLD") + private String dataCollectionKey; + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否启用,1-启用,0-不启用") private Integer isEnabled; - @Schema(description = "任务模版key") - @ExcelProperty("任务模版key") - private String templateKey; + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "任务单模板key") + @ExcelProperty("任务单模板key") + private String configReportTemplateKey; @Schema(description = "任务单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("任务单编号规则") @@ -56,16 +69,20 @@ public class ConfigAssayMethodRespVO { @ExcelProperty("任务分配表单配置信息,是否添加质控样;是否过筛;是否预览打印;是否查询S值范围;是否需要流程审批;流程审批编码;退回样品审批流程编码:任务完成时的提交方式;指派单抬头key") private String assayTaskInfomation; - @Schema(description = "检测部门编号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("检测部门编号") - private String assayDepartmentCode; + @Schema(description = "分析部门ID", example = "31510") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "分析部门名称", example = "张三") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java index f6b0e39..91fff24 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodSaveReqVO.java @@ -9,13 +9,19 @@ import jakarta.validation.constraints.*; @Data public class ConfigAssayMethodSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31987") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3640") private Long id; - @Schema(description = "方法库ID", example = "31274") + @Schema(description = "方法库ID", example = "9346") private Long methodConfigId; - @Schema(description = "方法名称", example = "王五") + @Schema(description = "方法类别ID,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等", example = "9102") + private Long dictionaryBusinessId; + + @Schema(description = "方法类别KEY,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等") + private String dictionaryBusinessKey; + + @Schema(description = "方法名称", example = "李四") private String name; @Schema(description = "方法编号") @@ -24,19 +30,26 @@ public class ConfigAssayMethodSaveReqVO { @Schema(description = "描述") private String description; + @Schema(description = "数据集Key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "数据集Key,T_DAT_COLT_FLD不能为空") + private String dataCollectionKey; + @Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否启用,1-启用,0-不启用不能为空") private Integer isEnabled; - @Schema(description = "任务模版key") - private String templateKey; + @Schema(description = "是否配料,1-是,0-否") + private Integer isIngredients; + + @Schema(description = "任务单模板key") + private String configReportTemplateKey; @Schema(description = "任务单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "任务单编号规则不能为空") private String codeRule; @Schema(description = "分配方式,【字典】【jy_assay_method_assign_way】随机分配,按顺序分配,自动分配", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "分配方式,【字典】【jy_assay_method_assign_way】随机分配,按顺序分配,自动分配不能为空") + @NotEmpty(message = "分配方式,【字典】【jy_assay_method_assign_way】随机分配,按顺序分配,自动分配不能为空") private String assignWay; @Schema(description = "展示平台,【字典】【jy_assay_method_assign_platform】pad、pc、pad&pc", requiredMode = Schema.RequiredMode.REQUIRED) @@ -46,12 +59,13 @@ public class ConfigAssayMethodSaveReqVO { @Schema(description = "任务分配表单配置信息,是否添加质控样;是否过筛;是否预览打印;是否查询S值范围;是否需要流程审批;流程审批编码;退回样品审批流程编码:任务完成时的提交方式;指派单抬头key") private String assayTaskInfomation; - @Schema(description = "检测部门编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "检测部门编号不能为空") - private String assayDepartmentCode; + @Schema(description = "分析部门ID", example = "31510") + private Long assayDepartmentId; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; + + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSamplePageReqVO.java index 219c897..0854a3d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSamplePageReqVO.java @@ -13,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigBaseSamplePageReqVO extends PageParam { - @Schema(description = "样品ID", example = "18277") + @Schema(description = "样品大类ID", example = "15112") private Long baseSampleId; - @Schema(description = "父级ID", example = "17109") + @Schema(description = "父级ID", example = "25043") private Long parentId; @Schema(description = "编码规则") @@ -29,15 +29,15 @@ public class ConfigBaseSamplePageReqVO extends PageParam { private String printTemplate; @Schema(description = "样品标签打印份数") - private Integer codePrintQuantity; + private byte[] codePrintQuantity; - @Schema(description = "样品名称", example = "张三") + @Schema(description = "样品名称", example = "芋艿") private String sampleName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleRespVO.java index b679d36..f6f102e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleRespVO.java @@ -12,15 +12,15 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigBaseSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12819") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1552") @ExcelProperty("ID") private Long id; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18277") - @ExcelProperty("样品ID") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15112") + @ExcelProperty("样品大类ID") private Long baseSampleId; - @Schema(description = "父级ID", example = "17109") + @Schema(description = "父级ID", example = "25043") @ExcelProperty("父级ID") private Long parentId; @@ -38,18 +38,18 @@ public class ConfigBaseSampleRespVO { @Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("样品标签打印份数") - private Integer codePrintQuantity; + private byte[] codePrintQuantity; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("样品名称") private String sampleName; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleSaveReqVO.java index 77aa160..64918f8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigBaseSampleSaveReqVO.java @@ -9,14 +9,14 @@ import jakarta.validation.constraints.*; @Data public class ConfigBaseSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12819") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1552") private Long id; - @Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18277") - @NotNull(message = "样品ID不能为空") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15112") + @NotNull(message = "样品大类ID不能为空") private Long baseSampleId; - @Schema(description = "父级ID", example = "17109") + @Schema(description = "父级ID", example = "25043") private Long parentId; @Schema(description = "编码规则", requiredMode = Schema.RequiredMode.REQUIRED) @@ -33,14 +33,13 @@ public class ConfigBaseSampleSaveReqVO { @Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "样品标签打印份数不能为空") - private Integer codePrintQuantity; + private byte[] codePrintQuantity; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "样品名称不能为空") private String sampleName; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeRespVO.java deleted file mode 100644 index b3cbd16..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeRespVO.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.zt.plat.module.qms.business.config.controller.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 报告类型配置 Response VO") -@Data -@ExcelIgnoreUnannotated -public class ConfigDocumentTypeRespVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32458") - @ExcelProperty("ID") - private Long id; - - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21445") - @ExcelProperty("报表类型ID") - private Long configReportTypeId; - - @Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @ExcelProperty("类型名称") - private String name; - - @Schema(description = "流程模型key", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("流程模型key") - private String flowModelKey; - - @Schema(description = "流程表单key", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("流程表单key") - private String flowFormKey; - - @Schema(description = "报告模板key", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("报告模板key") - private String reportKey; - - @Schema(description = "报告编号规则", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("报告编号规则") - private String codeRule; - - @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告") - private String type; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("所属部门") - private String systemDepartmentCode; - - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") - private LocalDateTime createTime; - - @Schema(description = "备注") - @ExcelProperty("备注") - private String remark; - - @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("版本") - private Integer version; - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeSaveReqVO.java deleted file mode 100644 index f4d2668..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypeSaveReqVO.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.zt.plat.module.qms.business.config.controller.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 报告类型配置新增/修改 Request VO") -@Data -public class ConfigDocumentTypeSaveReqVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32458") - private Long id; - - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21445") - @NotNull(message = "报表类型ID不能为空") - private Long configReportTypeId; - - @Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "类型名称不能为空") - private String name; - - @Schema(description = "流程模型key", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "流程模型key不能为空") - private String flowModelKey; - - @Schema(description = "流程表单key", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "流程表单key不能为空") - private String flowFormKey; - - @Schema(description = "报告模板key", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "报告模板key不能为空") - private String reportKey; - - @Schema(description = "报告编号规则", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "报告编号规则不能为空") - private String codeRule; - - @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告不能为空") - private String type; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") - private String systemDepartmentCode; - - @Schema(description = "备注") - private String remark; - - @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "版本不能为空") - private Integer version; - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourcePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourcePageReqVO.java index 1011668..59b51d3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourcePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourcePageReqVO.java @@ -13,25 +13,31 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigEntrustSourcePageReqVO extends PageParam { - @Schema(description = "名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "李四") + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1") + private String entrustType; + + @Schema(description = "委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "赵六") private String name; - @Schema(description = "模版Key") + @Schema(description = "委托来源Key") private String key; - @Schema(description = "数据集key,T_DAT_COLT_FLD") + @Schema(description = "数据集Key,T_DAT_COLT_FLD") private String dataCollectionKey; - @Schema(description = "委托单模版") - private String template; + @Schema(description = "委托单模版Key") + private String configReportTemplateKey; @Schema(description = "委托单号规则") private String codeRule; + @Schema(description = "委托单号引用字段") + private String codeField; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceReqVO.java index f74c551..5412b8c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceReqVO.java @@ -13,28 +13,35 @@ import lombok.Data; @Data public class ConfigEntrustSourceReqVO { - @Schema(description = "名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "王五") + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1") + private String entrustType; + + @Schema(description = "委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", example = "赵六") private String name; - @Schema(description = "模版Key") + @Schema(description = "委托来源Key") private String key; - @Schema(description = "数据集key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "数据集Key,T_DAT_COLT_FLD") private String dataCollectionKey; - @Schema(description = "委托单模版") - private String template; + @Schema(description = "委托单模版Key") + private String configReportTemplateKey; @Schema(description = "委托单号规则") private String codeRule; + @Schema(description = "委托单号引用字段") + private String codeField; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; @Schema(description = "备注") private String remark; + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceRespVO.java index 8a411a6..11c0761 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceRespVO.java @@ -12,36 +12,43 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigEntrustSourceRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6861") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1702") @ExcelProperty("ID") private Long id; - @Schema(description = "名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @ExcelProperty("名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托") + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1") + @ExcelProperty("委托类型,委托登记-entrust_registration、检验委托-entrust_inspection") + private String entrustType; + + @Schema(description = "委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托") private String name; - @Schema(description = "模版Key", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("模版Key") + @Schema(description = "委托来源Key", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("委托来源Key") private String key; - @Schema(description = "数据集key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("数据集key,T_DAT_COLT_FLD") + @Schema(description = "数据集Key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数据集Key,T_DAT_COLT_FLD") private String dataCollectionKey; - @Schema(description = "委托单模版") - @ExcelProperty("委托单模版") - private String template; + @Schema(description = "委托单模版Key") + @ExcelProperty("委托单模版Key") + private String configReportTemplateKey; @Schema(description = "委托单号规则") @ExcelProperty("委托单号规则") private String codeRule; + @Schema(description = "委托单号引用字段") + private String codeField; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSaveReqVO.java index 76bfda0..f4d0fcc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigEntrustSourceSaveReqVO.java @@ -9,32 +9,37 @@ import jakarta.validation.constraints.*; @Data public class ConfigEntrustSourceSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6861") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1702") private Long id; - @Schema(description = "名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托不能为空") + @Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1") + private String entrustType; + + @Schema(description = "委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托不能为空") private String name; - @Schema(description = "模版Key", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "模版Key不能为空") + @Schema(description = "委托来源Key", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "委托来源Key不能为空") private String key; - @Schema(description = "数据集key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "数据集key,T_DAT_COLT_FLD不能为空") + @Schema(description = "数据集Key,T_DAT_COLT_FLD", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "数据集Key,T_DAT_COLT_FLD不能为空") private String dataCollectionKey; - @Schema(description = "委托单模版") - private String template; + @Schema(description = "委托单模版Key") + private String configReportTemplateKey; @Schema(description = "委托单号规则") private String codeRule; + @Schema(description = "委托单号引用字段") + private String codeField; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") private String remark; - + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionPageReqVO.java new file mode 100644 index 0000000..ac63c80 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionPageReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 权限配置,通用权限配置分页 Request VO") +@Data +public class ConfigPermissionPageReqVO extends PageParam { + + @Schema(description = "主数据id", example = "31572") + private Long sourceId; + + @Schema(description = "主数据类型", example = "1") + private String sourceType; + + @Schema(description = "关联id", example = "20071") + private Long targetId; + + @Schema(description = "关联name", example = "1") + private String targetName; + + @Schema(description = "关联数据类型", example = "1") + private String targetType; + + @Schema(description = "权限类型", example = "2") + private String permissionType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionRespVO.java new file mode 100644 index 0000000..ec23cc1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionRespVO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 权限配置,通用权限配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigPermissionRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16806") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "主数据id", example = "31572") + @ExcelProperty("主数据id") + private Long sourceId; + + @Schema(description = "主数据类型", example = "1") + @ExcelProperty("主数据类型") + private String sourceType; + + @Schema(description = "关联id", example = "20071") + @ExcelProperty("关联id") + private Long targetId; + + @Schema(description = "关联name", example = "1") + @ExcelProperty("关联name") + private String targetName; + + @Schema(description = "关联数据类型", example = "1") + @ExcelProperty("关联数据类型") + private String targetType; + + @Schema(description = "权限类型", example = "2") + @ExcelProperty("权限类型") + private String permissionType; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionSaveReqVO.java new file mode 100644 index 0000000..46be031 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigPermissionSaveReqVO.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 权限配置,通用权限配置新增/修改 Request VO") +@Data +public class ConfigPermissionSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16806") + private Long id; + + @Schema(description = "主数据id", example = "31572") + private Long sourceId; + + @Schema(description = "主数据类型", example = "1") + private String sourceType; + + @Schema(description = "关联id", example = "20071") + private Long targetId; + + @Schema(description = "关联name", example = "1") + private String targetName; + + @Schema(description = "关联数据类型", example = "1") + private String targetType; + + @Schema(description = "权限类型", example = "2") + private String permissionType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java new file mode 100644 index 0000000..256390a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigProjectExtendRespVO extends ConfigProjectRespVO { + + @Schema(description = "检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String dictionaryProjectSimpleName; + + @Schema(description = "检测项目显示名称") + private String dictionaryProjectShowName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectPageReqVO.java index fb609de..62531e2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectPageReqVO.java @@ -13,10 +13,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigProjectPageReqVO extends PageParam { - @Schema(description = "检测项目ID", example = "6630") + @Schema(description = "检测项目ID", example = "4822") private Long dictionaryProjectId; - @Schema(description = "检测方法配置ID", example = "5185") + @Schema(description = "检测方法配置ID", example = "22238") private Long configAssayMethodId; @Schema(description = "上报列字段") @@ -25,7 +25,7 @@ public class ConfigProjectPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectRespVO.java index bfa7f4b..d351204 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectRespVO.java @@ -12,15 +12,15 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigProjectRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27310") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5291") @ExcelProperty("ID") private Long id; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6630") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4822") @ExcelProperty("检测项目ID") private Long dictionaryProjectId; - @Schema(description = "检测方法配置ID", example = "5185") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22238") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; @@ -28,12 +28,12 @@ public class ConfigProjectRespVO { @ExcelProperty("上报列字段") private String saveColumn; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectSaveReqVO.java index 843ae38..4a731fb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectSaveReqVO.java @@ -9,22 +9,22 @@ import jakarta.validation.constraints.*; @Data public class ConfigProjectSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27310") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5291") private Long id; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6630") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4822") @NotNull(message = "检测项目ID不能为空") private Long dictionaryProjectId; - @Schema(description = "检测方法配置ID", example = "5185") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22238") + @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; @Schema(description = "上报列字段", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "上报列字段不能为空") private String saveColumn; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java new file mode 100644 index 0000000..277078a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodExtendRespVO.java @@ -0,0 +1,11 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.Data; + +@Data +public class ConfigQCSampleMethodExtendRespVO extends ConfigQCSampleMethodRespVO { + + private String dictionaryBusinessName; + + private String configAssayMethodName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java new file mode 100644 index 0000000..71fa079 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodPageReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样与检测方法配置分页 Request VO") +@Data +public class ConfigQCSampleMethodPageReqVO extends PageParam { + + @Schema(description = "检测方法配置ID", example = "21368") + private Long configAssayMethodId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", example = "9549") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "编码规则") + private String codeRule; + + @Schema(description = "默认个数,1-是,0-否", example = "484") + private Integer defaultCount; + + @Schema(description = "分配提交最小个数", example = "28377") + private Integer taskMinimumCount; + + @Schema(description = "分析提交最小个数", example = "31499") + private Integer assayMinimumCount; + + @Schema(description = "是否关联定值样,1-是,0-否") + private Integer isCorrelation; + + @Schema(description = "映射检测信息配置") + private String configInfomation; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java new file mode 100644 index 0000000..df03866 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterExtendRespVO.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigQCSampleMethodParameterExtendRespVO extends ConfigQCSampleMethodParameterRespVO { + + @Schema(description = "参数序号") + private Integer dictionaryParameterNo; + + @Schema(description = "名称", example = "王五") + private String dictionaryParameterName; + + @Schema(description = "键值") + private String dictionaryParameterKey; + + @Schema(description = "检测单位ID,UNT表", example = "20894") + private Long dictionaryParameterUnitId; + + @Schema(description = "单位") + private String dictionaryParameterUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java new file mode 100644 index 0000000..31af65f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterPageReqVO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 质控样检测方法参数配置分页 Request VO") +@Data +public class ConfigQCSampleMethodParameterPageReqVO extends PageParam { + + @Schema(description = "检测方法与质控样类型配置ID", example = "28109") + private Long configQCSampleMethodId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "29135") + private Long dictionaryParameterId; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空") + private Integer isNull; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java new file mode 100644 index 0000000..3fedc3d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterRespVO.java @@ -0,0 +1,77 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样检测方法参数配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigQCSampleMethodParameterRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26251") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法与质控样类型配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28109") + @ExcelProperty("检测方法与质控样类型配置ID") + private Long configQCSampleMethodId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29135") + @ExcelProperty("参数ID,字典表【T_DIC_PRM】") + private Long dictionaryParameterId; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + @ExcelProperty("默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否允许为空") + private Integer isNull; + + @Schema(description = "计算公式") + @ExcelProperty("计算公式") + private String formula; + + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("pc界面是否显示") + private Integer isShow; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java new file mode 100644 index 0000000..1b00378 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodParameterSaveReqVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样检测方法参数配置新增/修改 Request VO") +@Data +public class ConfigQCSampleMethodParameterSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26251") + private Long id; + + @Schema(description = "检测方法与质控样类型配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28109") + @NotNull(message = "检测方法与质控样类型配置ID不能为空") + private Long configQCSampleMethodId; + + @Schema(description = "参数ID,字典表【T_DIC_PRM】", requiredMode = Schema.RequiredMode.REQUIRED, example = "29135") + @NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空") + private Long dictionaryParameterId; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "默认值") + private String defaultValue; + + @Schema(description = "是否允许为空", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否允许为空不能为空") + private Integer isNull; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "pc界面是否显示不能为空") + private Integer isShow; + + @Schema(description = "参数分组_ID") + private Long dictionaryBusinessId; + + @Schema(description = "参数分组_Key") + private String dictionaryBusinessKey; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java new file mode 100644 index 0000000..34eb738 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodRespVO.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控样与检测方法配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigQCSampleMethodRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11823") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21368") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "9549") + @ExcelProperty("质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + @ExcelProperty("质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "编码规则", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("编码规则") + private String codeRule; + + @Schema(description = "默认个数,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED, example = "484") + @ExcelProperty("默认个数,1-是,0-否") + private Integer defaultCount; + + @Schema(description = "分配提交最小个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "28377") + @ExcelProperty("分配提交最小个数") + private Integer taskMinimumCount; + + @Schema(description = "分析提交最小个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "31499") + @ExcelProperty("分析提交最小个数") + private Integer assayMinimumCount; + + @Schema(description = "是否关联定值样,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否关联定值样,1-是,0-否") + private Integer isCorrelation; + + @Schema(description = "映射检测信息配置") + @ExcelProperty("映射检测信息配置") + private String configInfomation; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java new file mode 100644 index 0000000..2be5344 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCSampleMethodSaveReqVO.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控样与检测方法配置新增/修改 Request VO") +@Data +public class ConfigQCSampleMethodSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11823") + private Long id; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21368") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样", requiredMode = Schema.RequiredMode.REQUIRED, example = "9549") + @NotNull(message = "质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样不能为空") + private Long dictionaryBusinessId; + + @Schema(description = "质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样") + private String dictionaryBusinessKey; + + @Schema(description = "编码规则", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "编码规则不能为空") + private String codeRule; + + @Schema(description = "默认个数,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED, example = "484") + @NotNull(message = "默认个数,1-是,0-否不能为空") + private Integer defaultCount; + + @Schema(description = "分配提交最小个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "28377") + @NotNull(message = "分配提交最小个数不能为空") + private Integer taskMinimumCount; + + @Schema(description = "分析提交最小个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "31499") + @NotNull(message = "分析提交最小个数不能为空") + private Integer assayMinimumCount; + + @Schema(description = "是否关联定值样,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否关联定值样,1-是,0-否不能为空") + private Integer isCorrelation; + + @Schema(description = "映射检测信息配置") + private String configInfomation; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSamplePageReqVO.java similarity index 57% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationPageReqVO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSamplePageReqVO.java index ccad34b..836e379 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSamplePageReqVO.java @@ -9,26 +9,20 @@ import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 样品库位信息分页 Request VO") +@Schema(description = "管理后台 - 质控与定值样关系分页 Request VO") @Data -public class ConfigWarehouseLocationInfomationPageReqVO extends PageParam { +public class ConfigQCStandardSamplePageReqVO extends PageParam { - @Schema(description = "样品库名称", example = "张三") - private String name; + @Schema(description = "质控样与检测方法配置ID", example = "16254") + private Long configQCSampleMethodId; - @Schema(description = "库位编号") - private String code; - - @Schema(description = "仓库编码") - private String warehouseCoding; - - @Schema(description = "样品容量") - private Integer capacity; + @Schema(description = "定值样业务ID", example = "24895") + private Long businessStandardSampleId; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleRespVO.java new file mode 100644 index 0000000..8983721 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleRespVO.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 质控与定值样关系 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigQCStandardSampleRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28136") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "质控样与检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16254") + @ExcelProperty("质控样与检测方法配置ID") + private Long configQCSampleMethodId; + + @Schema(description = "定值样业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24895") + @ExcelProperty("定值样业务ID") + private Long businessStandardSampleId; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleSaveReqVO.java new file mode 100644 index 0000000..309e9df --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigQCStandardSampleSaveReqVO.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 质控与定值样关系新增/修改 Request VO") +@Data +public class ConfigQCStandardSampleSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28136") + private Long id; + + @Schema(description = "质控样与检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16254") + @NotNull(message = "质控样与检测方法配置ID不能为空") + private Long configQCSampleMethodId; + + @Schema(description = "定值样业务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24895") + @NotNull(message = "定值样业务ID") + private Long businessStandardSampleId; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java index 4bbb60d..3cc7fdc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java @@ -13,30 +13,33 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigReportFieldPageReqVO extends PageParam { - @Schema(description = "报表类型ID", example = "28419") + @Schema(description = "报表类型ID", example = "27695") private Long configReportTypeId; @Schema(description = "绑定字段") private String field; - @Schema(description = "标题名称", example = "张三") + @Schema(description = "标题名称", example = "王五") private String fieldName; - @Schema(description = "排序号") - private Integer no; - - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2") - private Integer dataType; - - @Schema(description = "小数位") - private Integer decimal; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; @Schema(description = "列宽") private Integer fieldWidth; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + @Schema(description = "是否分组") private Integer isGroup; + @Schema(description = "表头分组") + private String titleGroup; + @Schema(description = "是否可修改") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Integer[] isUpdate; @@ -44,13 +47,13 @@ public class ConfigReportFieldPageReqVO extends PageParam { @Schema(description = "计算公式") private String formula; - @Schema(description = "表头分组") - private String titleGroup; + @Schema(description = "排序号") + private Integer no; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java new file mode 100644 index 0000000..8177542 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 报表字段配置分页 Request VO") +@Data +public class ConfigReportFieldReqVO { + + @Schema(description = "报表类型ID", example = "27695") + private Long configReportTypeId; + + @Schema(description = "绑定字段") + private String field; + + @Schema(description = "标题名称", example = "王五") + private String fieldName; + + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; + + @Schema(description = "列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否分组") + private Integer isGroup; + + @Schema(description = "表头分组") + private String titleGroup; + + @Schema(description = "是否可修改") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Integer[] isUpdate; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "排序号") + private Integer no; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注,1-是,0-否") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java index 4a59fd4..ff10a94 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigReportFieldRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6012") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4375") @ExcelProperty("ID") private Long id; - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28419") + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27695") @ExcelProperty("报表类型ID") private Long configReportTypeId; @@ -24,48 +24,52 @@ public class ConfigReportFieldRespVO { @ExcelProperty("绑定字段") private String field; - @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("标题名称") private String fieldName; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + @ExcelProperty("字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated") + private String fieldType; + + @Schema(description = "列宽") + @ExcelProperty("列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "是否分组") + @ExcelProperty("是否分组") + private Integer isGroup; + + @Schema(description = "表头分组") + @ExcelProperty("表头分组") + private String titleGroup; + + @Schema(description = "是否可修改") + @ExcelProperty("是否可修改") + private Integer isUpdate; + + @Schema(description = "计算公式") + @ExcelProperty("计算公式") + private String formula; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("排序号") private Integer no; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") - private Integer dataType; - - @Schema(description = "小数位") - @ExcelProperty("小数位") - private Integer decimal; - - @Schema(description = "列宽", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("列宽") - private Integer fieldWidth; - - @Schema(description = "是否分组", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否分组") - private Integer isGroup; - - @Schema(description = "是否可修改", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否可修改") - private Integer isUpdate; - - @Schema(description = "计算公式", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("计算公式") - private String formula; - - @Schema(description = "表头分组", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("表头分组") - private String titleGroup; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java index 7404ae0..b8faf47 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java @@ -9,10 +9,10 @@ import jakarta.validation.constraints.*; @Data public class ConfigReportFieldSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6012") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4375") private Long id; - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28419") + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27695") @NotNull(message = "报表类型ID不能为空") private Long configReportTypeId; @@ -20,43 +20,40 @@ public class ConfigReportFieldSaveReqVO { @NotEmpty(message = "绑定字段不能为空") private String field; - @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "标题名称不能为空") private String fieldName; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; + + @Schema(description = "列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否分组") + private Integer isGroup; + + @Schema(description = "表头分组") + private String titleGroup; + + @Schema(description = "是否可修改") + private Integer isUpdate; + + @Schema(description = "计算公式") + private String formula; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "排序号不能为空") private Integer no; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotNull(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") - private Integer dataType; - - @Schema(description = "小数位") - private Integer decimal; - - @Schema(description = "列宽", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "列宽不能为空") - private Integer fieldWidth; - - @Schema(description = "是否分组", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否分组不能为空") - private Integer isGroup; - - @Schema(description = "是否可修改", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否可修改不能为空") - private Integer isUpdate; - - @Schema(description = "计算公式", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "计算公式不能为空") - private String formula; - - @Schema(description = "表头分组", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "表头分组不能为空") - private String titleGroup; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplatePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplatePageReqVO.java index 90bc7c2..2a115a5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplatePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplatePageReqVO.java @@ -1,21 +1,19 @@ package com.zt.plat.module.qms.business.config.controller.vo; import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; - -import com.alibaba.excel.annotation.ExcelProperty; - import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 报表模版配置分页 Request VO") +@Schema(description = "管理后台 - 锐浪报表模版配置分页 Request VO") @Data public class ConfigReportTemplatePageReqVO extends PageParam { - @Schema(description = "模版名称", example = "赵六") + @Schema(description = "模版名称", example = "李四") private String name; @Schema(description = "模版Key") @@ -30,17 +28,17 @@ public class ConfigReportTemplatePageReqVO extends PageParam { @Schema(description = "数据") private String data; - @Schema(description = "模板是否已授权") + @Schema(description = "是否授权,1-是,0否") private Integer isAuthority; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "乐观锁", example = "15082") + @Schema(description = "乐观锁", example = "1790") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateRespVO.java index 626b1a0..417ae0f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateRespVO.java @@ -2,20 +2,21 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; - +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 报表模版配置 Response VO") +@Schema(description = "管理后台 - 锐浪报表模版配置 Response VO") @Data @ExcelIgnoreUnannotated public class ConfigReportTemplateRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2363") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15119") @ExcelProperty("ID") private Long id; - @Schema(description = "模版名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "模版名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @ExcelProperty("模版名称") private String name; @@ -35,19 +36,19 @@ public class ConfigReportTemplateRespVO { @ExcelProperty("数据") private String data; - @Schema(description = "模板是否已授权") - @ExcelProperty("模板是否已授权") + @Schema(description = "是否授权,1-是,0否") + @ExcelProperty("是否授权,1-是,0否") private Integer isAuthority; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "15082") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "1790") @ExcelProperty("乐观锁") private Integer updateCount; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateSaveReqVO.java index 67ff026..04c5378 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTemplateSaveReqVO.java @@ -1,20 +1,18 @@ package com.zt.plat.module.qms.business.config.controller.vo; -import com.alibaba.excel.annotation.ExcelProperty; - import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; - +import java.util.*; import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 报表模版配置新增/修改 Request VO") +@Schema(description = "管理后台 - 锐浪报表模版配置新增/修改 Request VO") @Data public class ConfigReportTemplateSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2363") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15119") private Long id; - @Schema(description = "模版名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "模版名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @NotEmpty(message = "模版名称不能为空") private String name; @@ -32,14 +30,13 @@ public class ConfigReportTemplateSaveReqVO { @Schema(description = "数据") private String data; - @Schema(description = "模板是否已授权") + @Schema(description = "是否授权,1-是,0否") private Integer isAuthority; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - //@NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; - @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "15082") + @Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "1790") private Integer updateCount; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypePageReqVO.java index 055ab7a..af56996 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypePageReqVO.java @@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigReportTypePageReqVO extends PageParam { - @Schema(description = "报表名称", example = "李四") + @Schema(description = "报表名称", example = "芋艿") private String name; @Schema(description = "键值") @@ -25,7 +25,7 @@ public class ConfigReportTypePageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeRespVO.java index 38aace0..04dc089 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigReportTypeRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9946") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19298") @ExcelProperty("ID") private Long id; - @Schema(description = "报表名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "报表名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("报表名称") private String name; @@ -28,12 +28,12 @@ public class ConfigReportTypeRespVO { @ExcelProperty("报表模版") private String template; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeSaveReqVO.java index 840caf8..82148f3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportTypeSaveReqVO.java @@ -9,10 +9,10 @@ import jakarta.validation.constraints.*; @Data public class ConfigReportTypeSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9946") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19298") private Long id; - @Schema(description = "报表名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "报表名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "报表名称不能为空") private String name; @@ -23,8 +23,7 @@ public class ConfigReportTypeSaveReqVO { @NotEmpty(message = "报表模版不能为空") private String template; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java similarity index 50% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypePageReqVO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java index dc2a425..ed81719 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigDocumentTypePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java @@ -9,42 +9,39 @@ import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 报告类型配置分页 Request VO") +@Schema(description = "管理后台 - 规则配置分页 Request VO") @Data -public class ConfigDocumentTypePageReqVO extends PageParam { +public class ConfigRulePageReqVO extends PageParam { - @Schema(description = "报表类型ID", example = "21445") - private Long configReportTypeId; + @Schema(description = "编码") + private String code; - @Schema(description = "类型名称", example = "王五") + @Schema(description = "名称", example = "芋艿") private String name; - @Schema(description = "流程模型key") - private String flowModelKey; + @Schema(description = "描述") + private String description; - @Schema(description = "流程表单key") - private String flowFormKey; - - @Schema(description = "报告模板key") - private String reportKey; - - @Schema(description = "报告编号规则") - private String codeRule; - - @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", example = "1") + @Schema(description = "类型", example = "2") private String type; + @Schema(description = "表达式") + private String expression; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + private Integer isLast; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; @Schema(description = "备注") private String remark; - @Schema(description = "版本") - private Integer version; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java new file mode 100644 index 0000000..ce6c2dd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 规则配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigRuleRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21005") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "编码") + @ExcelProperty("编码") + private String code; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("名称") + private String name; + + @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("描述") + private String description; + + @Schema(description = "类型", example = "2") + @ExcelProperty("类型") + private String type; + + @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("表达式") + private String expression; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + @ExcelProperty("是否最新版本,1-是,0-否") + private Integer isLast; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java new file mode 100644 index 0000000..44a8871 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 规则配置新增/修改 Request VO") +@Data +public class ConfigRuleSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21005") + private Long id; + + @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "编码不能为空") + private String code; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "名称不能为空") + private String name; + + @Schema(description = "描述") + @NotEmpty(message = "描述不能为空") + private String description; + + @Schema(description = "类型", example = "2") + private String type; + + @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "表达式不能为空") + private String expression; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + private Integer isLast; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowPageReqVO.java index bdbb9e1..a74932f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowPageReqVO.java @@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSampleFlowPageReqVO extends PageParam { - @Schema(description = "流程名称", example = "芋艿") + @Schema(description = "流程名称", example = "王五") private String name; @Schema(description = "流程Key") @@ -25,17 +25,23 @@ public class ConfigSampleFlowPageReqVO extends PageParam { @Schema(description = "流程描述") private String description; - @Schema(description = "类型,主样、子样", example = "1") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") private String type; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; @Schema(description = "备注") private String remark; + @Schema(description = "版本") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + private Integer isLast; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowRespVO.java index 6367aec..6620bdb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSampleFlowRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10654") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10354") @ExcelProperty("ID") private Long id; - @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("流程名称") private String name; @@ -32,20 +32,28 @@ public class ConfigSampleFlowRespVO { @ExcelProperty("流程描述") private String description; - @Schema(description = "类型,主样、子样", example = "1") - @ExcelProperty("类型,主样、子样") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") + @ExcelProperty("类型,主样base_sample、子样sub_sample") private String type; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") @ExcelProperty("备注") private String remark; + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + @ExcelProperty("是否最新版本,1-是,0-否") + private Integer isLast; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowSaveReqVO.java index 199e316..84a6d82 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleFlowSaveReqVO.java @@ -9,10 +9,10 @@ import jakarta.validation.constraints.*; @Data public class ConfigSampleFlowSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10654") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10354") private Long id; - @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "流程名称不能为空") private String name; @@ -26,7 +26,7 @@ public class ConfigSampleFlowSaveReqVO { @Schema(description = "流程描述") private String description; - @Schema(description = "类型,主样、子样", example = "1") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") private String type; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @@ -35,4 +35,11 @@ public class ConfigSampleFlowSaveReqVO { @Schema(description = "备注") private String remark; + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "版本不能为空") + private Integer version; + + @Schema(description = "是否最新版本,1-是,0-否") + private Integer isLast; + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverPageReqVO.java index e4d6eff..ca63ff5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverPageReqVO.java @@ -9,18 +9,18 @@ import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 样品交接配置分页 Request VO") +@Schema(description = "管理后台 - 样品交接单配置分页 Request VO") @Data public class ConfigSampleHandoverPageReqVO extends PageParam { - @Schema(description = "交接单名称", example = "张三") + @Schema(description = "交接单名称", example = "芋艿") private String name; @Schema(description = "流程节点KY") private String dictionarySampleFlowNodeKey; @Schema(description = "交接模版key") - private String templateKey; + private String configReportTemplateKey; @Schema(description = "交接单编号规则") private String codeRule; @@ -31,7 +31,7 @@ public class ConfigSampleHandoverPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverRespVO.java index d384178..eae7dc8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverRespVO.java @@ -7,16 +7,16 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 样品交接配置 Response VO") +@Schema(description = "管理后台 - 样品交接单配置 Response VO") @Data @ExcelIgnoreUnannotated public class ConfigSampleHandoverRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12423") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11869") @ExcelProperty("ID") private Long id; - @Schema(description = "交接单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "交接单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("交接单名称") private String name; @@ -24,9 +24,9 @@ public class ConfigSampleHandoverRespVO { @ExcelProperty("流程节点KY") private String dictionarySampleFlowNodeKey; - @Schema(description = "交接模版key", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "交接模版key") @ExcelProperty("交接模版key") - private String templateKey; + private String configReportTemplateKey; @Schema(description = "交接单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("交接单编号规则") @@ -36,12 +36,12 @@ public class ConfigSampleHandoverRespVO { @ExcelProperty("是否预览打印") private Integer isPrint; - @Schema(description = "所属部门") + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverSaveReqVO.java index f6b25dd..2140392 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleHandoverSaveReqVO.java @@ -5,14 +5,14 @@ import lombok.*; import java.util.*; import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 样品交接配置新增/修改 Request VO") +@Schema(description = "管理后台 - 样品交接单配置新增/修改 Request VO") @Data public class ConfigSampleHandoverSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12423") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11869") private Long id; - @Schema(description = "交接单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "交接单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "交接单名称不能为空") private String name; @@ -20,9 +20,8 @@ public class ConfigSampleHandoverSaveReqVO { @NotEmpty(message = "流程节点KY不能为空") private String dictionarySampleFlowNodeKey; - @Schema(description = "交接模版key", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "交接模版key不能为空") - private String templateKey; + @Schema(description = "交接模版key") + private String configReportTemplateKey; @Schema(description = "交接单编号规则", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "交接单编号规则不能为空") @@ -31,7 +30,7 @@ public class ConfigSampleHandoverSaveReqVO { @Schema(description = "是否预览打印") private Integer isPrint; - @Schema(description = "所属部门") + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java new file mode 100644 index 0000000..31ea903 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigSampleReportExtendRespVO extends ConfigSampleReportRespVO { + + @Schema(description = "报表类型ID", example = "15805") + private Long configReportTypeId; + + @Schema(description = "报表类型Key", example = "15805") + private String configReportTypeKey; + + @Schema(description = "报表类型Name", example = "15805") + private String configReportTypeName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportPageReqVO.java index 77d9d76..5eedc88 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportPageReqVO.java @@ -13,13 +13,13 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSampleReportPageReqVO extends PageParam { - @Schema(description = "报表类型", example = "23048") + @Schema(description = "报表类型", example = "30219") private Long configReportTypeId; - @Schema(description = "主样配置ID", example = "10803") + @Schema(description = "主样配置ID", example = "29156") private Long configBaseSampleId; - @Schema(description = "样品名称", example = "李四") + @Schema(description = "样品名称", example = "张三") private String sampleName; @Schema(description = "数据来源") @@ -28,7 +28,7 @@ public class ConfigSampleReportPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java new file mode 100644 index 0000000..d773fb9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 样品报表关系分页 Request VO") +@Data +public class ConfigSampleReportReqVO { + + @Schema(description = "报表类型", example = "30219") + private Long configReportTypeId; + + @Schema(description = "主样配置ID", example = "29156") + private Long configBaseSampleId; + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "数据来源") + private String dataSource; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportRespVO.java index 5f2563e..049c310 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportRespVO.java @@ -12,19 +12,19 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSampleReportRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17737") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24222") @ExcelProperty("ID") private Long id; - @Schema(description = "报表类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "23048") + @Schema(description = "报表类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "30219") @ExcelProperty("报表类型") private Long configReportTypeId; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10803") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29156") @ExcelProperty("主样配置ID") private Long configBaseSampleId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("样品名称") private String sampleName; @@ -32,12 +32,12 @@ public class ConfigSampleReportRespVO { @ExcelProperty("数据来源") private String dataSource; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportSaveReqVO.java index 72a0cc6..2a02f3d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportSaveReqVO.java @@ -9,26 +9,25 @@ import jakarta.validation.constraints.*; @Data public class ConfigSampleReportSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17737") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24222") private Long id; - @Schema(description = "报表类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "23048") + @Schema(description = "报表类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "30219") @NotNull(message = "报表类型不能为空") private Long configReportTypeId; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10803") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29156") @NotNull(message = "主样配置ID不能为空") private Long configBaseSampleId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @NotEmpty(message = "样品名称不能为空") private String sampleName; @Schema(description = "数据来源") private String dataSource; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodePageReqVO.java index 031584b..ec6ca7f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodePageReqVO.java @@ -16,7 +16,7 @@ public class ConfigSimpleFlowCodePageReqVO extends PageParam { @Schema(description = "脚本序号") private String codeNo; - @Schema(description = "脚本名称", example = "李四") + @Schema(description = "脚本名称", example = "张三") private String codeName; @Schema(description = "脚本数据") @@ -31,7 +31,7 @@ public class ConfigSimpleFlowCodePageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeRespVO.java index 00bb5aa..3e7c6ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeRespVO.java @@ -2,17 +2,17 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; + @Schema(description = "管理后台 - LiteFlow脚本配置 Response VO") @Data @ExcelIgnoreUnannotated public class ConfigSimpleFlowCodeRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17472") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21610") @ExcelProperty("ID") private Long id; @@ -20,7 +20,7 @@ public class ConfigSimpleFlowCodeRespVO { @ExcelProperty("脚本序号") private String codeNo; - @Schema(description = "脚本名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "脚本名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("脚本名称") private String codeName; @@ -30,18 +30,20 @@ public class ConfigSimpleFlowCodeRespVO { @Schema(description = "脚本类型,【字典】【jy_simple_flow_code_type】普通脚本、选择脚本、条件脚本、数量循环、条件循环、退出循环节", example = "1") @ExcelProperty("脚本类型,【字典】【jy_simple_flow_code_type】普通脚本、选择脚本、条件脚本、数量循环、条件循环、退出循环节") + @Dict(dicCode = "liteflow_code_type") private String codeType; @Schema(description = "脚本语言,【字典】【jy_simple_flow_code_language】Java,Groovy,QLExpress") @ExcelProperty("脚本语言,【字典】【jy_simple_flow_code_language】Java,Groovy,QLExpress") + @Dict(dicCode = "liteflow_code_language") private String codeLanguage; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeSaveReqVO.java index 93d0124..53fd350 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowCodeSaveReqVO.java @@ -9,30 +9,28 @@ import jakarta.validation.constraints.*; @Data public class ConfigSimpleFlowCodeSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17472") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21610") private Long id; - @Schema(description = "脚本名称", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "脚本名称不能为空") + @Schema(description = "脚本序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "脚本序号不能为空") private String codeNo; - @Schema(description = "脚本描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "脚本描述不能为空") + @Schema(description = "脚本名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "脚本名称不能为空") private String codeName; - @Schema(description = "脚本类型,【字典】【jy_simple_flow_code_type】普通脚本、选择脚本、条件脚本、数量循环、条件循环、退出循环节", example = "1") - @NotEmpty(message = "脚本类型不能为空") - private String codeType; - - @Schema(description = "脚本语言,【字典】【jy_simple_flow_code_language】Java,Groovy,QLExpress") - @NotEmpty(message = "脚本语言不能为空") - private String codeLanguage; - @Schema(description = "脚本数据", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "脚本数据不能为空") private String codeData; - @Schema(description = "所属部门") + @Schema(description = "脚本类型,【字典】【jy_simple_flow_code_type】普通脚本、选择脚本、条件脚本、数量循环、条件循环、退出循环节", example = "1") + private String codeType; + + @Schema(description = "脚本语言,【字典】【jy_simple_flow_code_language】Java,Groovy,QLExpress") + private String codeLanguage; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRulePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRulePageReqVO.java index 4d0d321..acd083c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRulePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRulePageReqVO.java @@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSimpleFlowRulePageReqVO extends PageParam { - @Schema(description = "名称", example = "王五") + @Schema(description = "名称", example = "张三") private String name; @Schema(description = "描述") @@ -22,19 +22,19 @@ public class ConfigSimpleFlowRulePageReqVO extends PageParam { @Schema(description = "EL表达式") private String data; + @Schema(description = "流程图") + private String flow; + @Schema(description = "路由") private String route; - @Schema(description = "组") - private String group; - - @Schema(description = "流程图") - private String flow; + @Schema(description = "组", example = "芋艿") + private String groupName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleReqVO.java index 28d436b..cdfda74 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleReqVO.java @@ -13,7 +13,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSimpleFlowRuleReqVO { - @Schema(description = "名称", example = "王五") + @Schema(description = "名称", example = "张三") private String name; @Schema(description = "描述") @@ -22,19 +22,19 @@ public class ConfigSimpleFlowRuleReqVO { @Schema(description = "EL表达式") private String data; + @Schema(description = "流程图") + private String flow; + @Schema(description = "路由") private String route; - @Schema(description = "组") - private String group; - - @Schema(description = "流程图") - private String flow; + @Schema(description = "组", example = "芋艿") + private String groupName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleRespVO.java index a2830dd..6405a9e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSimpleFlowRuleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26561") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15976") @ExcelProperty("ID") private Long id; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @ExcelProperty("名称") private String name; @@ -28,24 +28,24 @@ public class ConfigSimpleFlowRuleRespVO { @ExcelProperty("EL表达式") private String data; + @Schema(description = "流程图") + @ExcelProperty("流程图") + private String flow; + @Schema(description = "路由") @ExcelProperty("路由") private String route; - @Schema(description = "组") + @Schema(description = "组", example = "芋艿") @ExcelProperty("组") - private String group; - - @Schema(description = "流程图") - @ExcelProperty("流程图") - private String flow; + private String groupName; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleSaveReqVO.java index 980ab35..bae63c6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSimpleFlowRuleSaveReqVO.java @@ -9,30 +9,31 @@ import jakarta.validation.constraints.*; @Data public class ConfigSimpleFlowRuleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26561") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15976") private Long id; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @NotEmpty(message = "名称不能为空") private String name; @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "描述不能为空") private String description; @Schema(description = "EL表达式", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "EL表达式不能为空") private String data; - @Schema(description = "路由") - private String route; - - @Schema(description = "组") - private String group; - @Schema(description = "流程图") private String flow; - @Schema(description = "所属部门") + @Schema(description = "路由") + private String route; + + @Schema(description = "组", example = "芋艿") + private String groupName; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectPageReqVO.java index 7d4bb9f..9e20deb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectPageReqVO.java @@ -13,16 +13,16 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigStandardSampleProjectPageReqVO extends PageParam { - @Schema(description = "标准样类型ID", example = "31807") + @Schema(description = "标准样类型ID", example = "12426") private Long configStandardSampleTypeId; - @Schema(description = "检测项目ID", example = "7405") + @Schema(description = "检测项目ID", example = "8525") private Long dictionaryProjectId; - @Schema(description = "检测项目名称", example = "张三") + @Schema(description = "检测项目名称", example = "芋艿") private String dictionaryProjectName; - @Schema(description = "检测单位ID,UNT表", example = "25945") + @Schema(description = "检测单位ID,UNT表", example = "31396") private Long unitId; @Schema(description = "检测项目单位") @@ -32,12 +32,12 @@ public class ConfigStandardSampleProjectPageReqVO extends PageParam { private Integer accuracy; @Schema(description = "排序号") - private String sort; + private Integer sortNo; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectRespVO.java index ac9c4e2..e59e050 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectRespVO.java @@ -12,23 +12,23 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigStandardSampleProjectRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13401") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6168") @ExcelProperty("ID") private Long id; - @Schema(description = "标准样类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31807") + @Schema(description = "标准样类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12426") @ExcelProperty("标准样类型ID") private Long configStandardSampleTypeId; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7405") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525") @ExcelProperty("检测项目ID") private Long dictionaryProjectId; - @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("检测项目名称") private String dictionaryProjectName; - @Schema(description = "检测单位ID,UNT表", example = "25945") + @Schema(description = "检测单位ID,UNT表", example = "31396") @ExcelProperty("检测单位ID,UNT表") private Long unitId; @@ -40,16 +40,16 @@ public class ConfigStandardSampleProjectRespVO { @ExcelProperty("小数精度") private Integer accuracy; - @Schema(description = "排序号") + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("排序号") - private String sort; + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectSaveReqVO.java index 19e069e..672c57e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleProjectSaveReqVO.java @@ -9,22 +9,22 @@ import jakarta.validation.constraints.*; @Data public class ConfigStandardSampleProjectSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13401") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6168") private Long id; - @Schema(description = "标准样类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31807") + @Schema(description = "标准样类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12426") @NotNull(message = "标准样类型ID不能为空") private Long configStandardSampleTypeId; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7405") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8525") @NotNull(message = "检测项目ID不能为空") private Long dictionaryProjectId; - @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "检测项目名称不能为空") private String dictionaryProjectName; - @Schema(description = "检测单位ID,UNT表", example = "25945") + @Schema(description = "检测单位ID,UNT表", example = "31396") private Long unitId; @Schema(description = "检测项目单位") @@ -34,11 +34,11 @@ public class ConfigStandardSampleProjectSaveReqVO { @NotNull(message = "小数精度不能为空") private Integer accuracy; - @Schema(description = "排序号") - private String sort; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "排序号不能为空") + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypePageReqVO.java index 6a8cc53..eacee6a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypePageReqVO.java @@ -13,25 +13,28 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigStandardSampleTypePageReqVO extends PageParam { - @Schema(description = "主样配置ID", example = "7034") + @Schema(description = "主样配置ID", example = "9270") private Long configBaseSampleId; - @Schema(description = "标准样类型名称", example = "赵六") + @Schema(description = "标准样类型名称", example = "芋艿") private String name; @Schema(description = "编码规则") private String codeRule; + @Schema(description = "分析部门ID", example = "765") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @Schema(description = "化验部门编号") - private String assayDepartmentCode; - @Schema(description = "备注") private String remark; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeRespVO.java index e77be14..cc8e578 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeRespVO.java @@ -12,15 +12,15 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigStandardSampleTypeRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22010") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "408") @ExcelProperty("ID") private Long id; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7034") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9270") @ExcelProperty("主样配置ID") private Long configBaseSampleId; - @Schema(description = "标准样类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "标准样类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("标准样类型名称") private String name; @@ -28,18 +28,22 @@ public class ConfigStandardSampleTypeRespVO { @ExcelProperty("编码规则") private String codeRule; + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "765") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; - @Schema(description = "化验部门编号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("化验部门编号") - private String assayDepartmentCode; - @Schema(description = "备注") @ExcelProperty("备注") private String remark; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeSaveReqVO.java index 649ad47..7ac094f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigStandardSampleTypeSaveReqVO.java @@ -9,14 +9,14 @@ import jakarta.validation.constraints.*; @Data public class ConfigStandardSampleTypeSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22010") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "408") private Long id; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7034") + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9270") @NotNull(message = "主样配置ID不能为空") private Long configBaseSampleId; - @Schema(description = "标准样类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "标准样类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "标准样类型名称不能为空") private String name; @@ -24,13 +24,16 @@ public class ConfigStandardSampleTypeSaveReqVO { @NotEmpty(message = "编码规则不能为空") private String codeRule; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") - private String systemDepartmentCode; + @Schema(description = "分析部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "765") + @NotNull(message = "分析部门ID不能为空") + private Long assayDepartmentId; - @Schema(description = "化验部门编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "化验部门编号不能为空") - private String assayDepartmentCode; + @Schema(description = "分析部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "分析部门名称不能为空") + private String assayDepartmentName; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; @Schema(description = "备注") private String remark; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java new file mode 100644 index 0000000..9cce8d3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodExtendRespVO.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodRespVO { + + /** 分析方法名称 **/ + @Schema(description = "分析方法名称") + private String configAssayMethodName; + + /** 分析方法编号 **/ + @Schema(description = "分析方法编号") + private String configAssayMethodCode; + + @Schema(description = "检测项目") + private String assayProject; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java index 97e7ff4..8fd05b4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodPageReqVO.java @@ -13,22 +13,34 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSubSampleMethodPageReqVO extends PageParam { - @Schema(description = "子样配置ID", example = "19245") + @Schema(description = "子样配置ID", example = "27079") private Long configSubSampleId; - @Schema(description = "分析方法ID", example = "15616") + @Schema(description = "检测方法配置ID", example = "30543") private Long configAssayMethodId; @Schema(description = "是否默认使用,1-启用,0-不启用") private Integer isDefaultUse; - @Schema(description = "任务数", example = "3171") + @Schema(description = "任务数", example = "27414") private Integer taskCount; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "判定方法,default-默认,other-其他(扩展)") + private String assessmentMethod; + + @Schema(description = "计算方法,calculateAverageValue-平均值,来自T_CFG_RUL的编码") + private String calculateMethod; + + @Schema(description = "映射检测信息配置") + private String configInfomation; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java index ddee9df..9b5f322 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodRespVO.java @@ -12,32 +12,44 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSubSampleMethodRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26039") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6150") @ExcelProperty("ID") private Long id; - @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19245") + @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27079") @ExcelProperty("子样配置ID") private Long configSubSampleId; - @Schema(description = "分析方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15616") - @ExcelProperty("分析方法ID") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543") + @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; @Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("是否默认使用,1-启用,0-不启用") private Integer isDefaultUse; - @Schema(description = "任务数", example = "3171") + @Schema(description = "任务数", example = "27414") @ExcelProperty("任务数") private Integer taskCount; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "判定方法,default-默认,other-其他(扩展)") + private String assessmentMethod; + + @Schema(description = "计算方法,calculateAverageValue-平均值,来自T_CFG_RUL的编码") + private String calculateMethod; + + @Schema(description = "映射检测信息配置") + private String configInfomation; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java index 4067c3c..84f588c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleMethodSaveReqVO.java @@ -9,26 +9,37 @@ import jakarta.validation.constraints.*; @Data public class ConfigSubSampleMethodSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26039") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6150") private Long id; - @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19245") + @Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27079") @NotNull(message = "子样配置ID不能为空") private Long configSubSampleId; - @Schema(description = "分析方法ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15616") - @NotNull(message = "分析方法ID不能为空") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543") + @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; @Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否默认使用,1-启用,0-不启用不能为空") private Integer isDefaultUse; - @Schema(description = "任务数", example = "3171") + @Schema(description = "任务数", example = "27414") private Integer taskCount; + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "判定方法,default-默认,other-其他(扩展)") + private String assessmentMethod; + + @Schema(description = "计算方法,calculateAverageValue-平均值,来自T_CFG_RUL的编码") + private String calculateMethod; + + @Schema(description = "映射检测信息配置") + private String configInfomation; + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java index c2fcfc6..d42eb27 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSamplePageReqVO.java @@ -13,10 +13,16 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSubSamplePageReqVO extends PageParam { - @Schema(description = "分样配置ID", example = "19927") + @Schema(description = "样品大类ID", example = "15082") + private Long baseSampleId; + + @Schema(description = "主样配置ID", example = "1906") + private Long configBaseSampleId; + + @Schema(description = "分样配置ID", example = "13652") private Long configSubSampleParentId; - @Schema(description = "样品类型ID", example = "3267") + @Schema(description = "样品类型ID", example = "28450") private Long dictionaryBusinessId; @Schema(description = "子样流程Key,样品流转流程key") @@ -31,10 +37,13 @@ public class ConfigSubSamplePageReqVO extends PageParam { @Schema(description = "是否打印") private Integer isPrint; - @Schema(description = "复检节点") - private String recheckFlowCode; + @Schema(description = "样品标签打印模版") + private String printTemplate; - @Schema(description = "样品名称", example = "张三") + @Schema(description = "复检节点") + private String recheckFlowNodeKey; + + @Schema(description = "样品名称", example = "芋艿") private String sampleName; @Schema(description = "样品保存天数") @@ -43,7 +52,7 @@ public class ConfigSubSamplePageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java new file mode 100644 index 0000000..4fa8bd4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodPageReqVO.java @@ -0,0 +1,38 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 分样与检测方法配置分页 Request VO") +@Data +public class ConfigSubSampleParentMethodPageReqVO extends PageParam { + + @Schema(description = "分样配置ID", example = "14933") + private Long configSubSampleParentId; + + @Schema(description = "检测方法配置ID", example = "24094") + private Long configAssayMethodId; + + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "计算方法,average-平均值,other-其他(扩展)") + private String calculateMethod; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java new file mode 100644 index 0000000..87dc823 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodRespVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 分样与检测方法配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigSubSampleParentMethodRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25289") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14933") + @ExcelProperty("分样配置ID") + private Long configSubSampleParentId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24094") + @ExcelProperty("检测方法配置ID") + private Long configAssayMethodId; + + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + @ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "计算方法,average-平均值,other-其他(扩展)") + @ExcelProperty("计算方法,average-平均值,other-其他(扩展)") + private String calculateMethod; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java new file mode 100644 index 0000000..f13c75a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentMethodSaveReqVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 分样与检测方法配置新增/修改 Request VO") +@Data +public class ConfigSubSampleParentMethodSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25289") + private Long id; + + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14933") + @NotNull(message = "分样配置ID不能为空") + private Long configSubSampleParentId; + + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24094") + @NotNull(message = "检测方法配置ID不能为空") + private Long configAssayMethodId; + + @Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改") + private String resultTreatmentWay; + + @Schema(description = "计算方法,average-平均值,other-其他(扩展)") + private String calculateMethod; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentPageReqVO.java index e7537c2..1af6112 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentPageReqVO.java @@ -13,13 +13,16 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigSubSampleParentPageReqVO extends PageParam { - @Schema(description = "主样配置ID", example = "24881") + @Schema(description = "样品大类ID", example = "9295") + private Long baseSampleId; + + @Schema(description = "主样配置ID", example = "12856") private Long configBaseSampleId; - @Schema(description = "样品类型ID", example = "5105") + @Schema(description = "样品类型ID", example = "15013") private Long dictionaryBusinessId; - @Schema(description = "样品名称", example = "张三") + @Schema(description = "样品名称", example = "李四") private String sampleName; @Schema(description = "是否默认启用") @@ -31,7 +34,7 @@ public class ConfigSubSampleParentPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentRespVO.java index a8fcb48..4d806ae 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentRespVO.java @@ -12,19 +12,23 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSubSampleParentRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7218") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2689") @ExcelProperty("ID") private Long id; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24881") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9295") + @ExcelProperty("样品大类ID") + private Long baseSampleId; + + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12856") @ExcelProperty("主样配置ID") private Long configBaseSampleId; - @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5105") + @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15013") @ExcelProperty("样品类型ID") private Long dictionaryBusinessId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @ExcelProperty("样品名称") private String sampleName; @@ -36,12 +40,12 @@ public class ConfigSubSampleParentRespVO { @ExcelProperty("审核方式,多个流程用|分隔") private Integer auditWay; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentSaveReqVO.java index 14f92d3..b87cbb3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleParentSaveReqVO.java @@ -9,18 +9,22 @@ import jakarta.validation.constraints.*; @Data public class ConfigSubSampleParentSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7218") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2689") private Long id; - @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24881") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9295") + @NotNull(message = "样品大类ID不能为空") + private Long baseSampleId; + + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12856") @NotNull(message = "主样配置ID不能为空") private Long configBaseSampleId; - @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5105") + @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15013") @NotNull(message = "样品类型ID不能为空") private Long dictionaryBusinessId; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @NotEmpty(message = "样品名称不能为空") private String sampleName; @@ -31,8 +35,7 @@ public class ConfigSubSampleParentSaveReqVO { @Schema(description = "审核方式,多个流程用|分隔") private Integer auditWay; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java index 1f011cb..49b6f91 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleRespVO.java @@ -12,15 +12,23 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigSubSampleRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18604") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27982") @ExcelProperty("ID") private Long id; - @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19927") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15082") + @ExcelProperty("样品大类ID") + private Long baseSampleId; + + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1906") + @ExcelProperty("主样配置ID") + private Long configBaseSampleId; + + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13652") @ExcelProperty("分样配置ID") private Long configSubSampleParentId; - @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3267") + @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28450") @ExcelProperty("样品类型ID") private Long dictionaryBusinessId; @@ -40,11 +48,14 @@ public class ConfigSubSampleRespVO { @ExcelProperty("是否打印") private Integer isPrint; + @Schema(description = "样品标签打印模版") + private String printTemplate; + @Schema(description = "复检节点") @ExcelProperty("复检节点") - private String recheckFlowCode; + private String recheckFlowNodeKey; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("样品名称") private String sampleName; @@ -52,12 +63,12 @@ public class ConfigSubSampleRespVO { @ExcelProperty("样品保存天数") private Integer sampleSaveDay; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java index 9406ef6..861450e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSubSampleSaveReqVO.java @@ -9,14 +9,22 @@ import jakarta.validation.constraints.*; @Data public class ConfigSubSampleSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18604") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27982") private Long id; - @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19927") + @Schema(description = "样品大类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15082") + @NotNull(message = "样品大类ID不能为空") + private Long baseSampleId; + + @Schema(description = "主样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1906") + @NotNull(message = "主样配置ID不能为空") + private Long configBaseSampleId; + + @Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13652") @NotNull(message = "分样配置ID不能为空") private Long configSubSampleParentId; - @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3267") + @Schema(description = "样品类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28450") @NotNull(message = "样品类型ID不能为空") private Long dictionaryBusinessId; @@ -35,10 +43,13 @@ public class ConfigSubSampleSaveReqVO { @Schema(description = "是否打印") private Integer isPrint; - @Schema(description = "复检节点") - private String recheckFlowCode; + @Schema(description = "样品标签打印模版") + private String printTemplate; - @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @Schema(description = "复检节点") + private String recheckFlowNodeKey; + + @Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "样品名称不能为空") private String sampleName; @@ -46,8 +57,7 @@ public class ConfigSubSampleSaveReqVO { @NotNull(message = "样品保存天数不能为空") private Integer sampleSaveDay; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignaturePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignaturePageReqVO.java new file mode 100644 index 0000000..0d30517 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignaturePageReqVO.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 手写签名配置分页 Request VO") +@Data +public class ConfigUserSignaturePageReqVO extends PageParam { + + @Schema(description = "用户id", example = "2926") + private String userId; + + @Schema(description = "用户姓名", example = "赵六") + private String userName; + + @Schema(description = "文件id", example = "9170") + private Long fileId; + + @Schema(description = "签名内容") + private String signatureContent; + + @Schema(description = "禁用标识") + private Integer cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureRespVO.java new file mode 100644 index 0000000..a2d5533 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureRespVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 手写签名配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigUserSignatureRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17765") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "用户id", example = "2926") + @ExcelProperty("用户id") + private String userId; + + @Schema(description = "用户姓名", example = "赵六") + @ExcelProperty("用户姓名") + private String userName; + + @Schema(description = "文件id", example = "9170") + @ExcelProperty("文件id") + private Long fileId; + + @Schema(description = "签名内容") + @ExcelProperty("签名内容") + private String signatureContent; + + @Schema(description = "禁用标识") + @ExcelProperty("禁用标识") + private Integer cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureSaveReqVO.java new file mode 100644 index 0000000..feb1f4e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigUserSignatureSaveReqVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 手写签名配置新增/修改 Request VO") +@Data +public class ConfigUserSignatureSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17765") + private Long id; + + @Schema(description = "用户id", example = "2926") + private String userId; + + @Schema(description = "用户姓名", example = "赵六") + private String userName; + + @Schema(description = "文件id", example = "9170") + private Long fileId; + + @Schema(description = "签名内容") + private String signatureContent; + + @Schema(description = "禁用标识") + private Integer cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationRespVO.java deleted file mode 100644 index 77f3ad0..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationRespVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.zt.plat.module.qms.business.config.controller.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 样品库位信息 Response VO") -@Data -@ExcelIgnoreUnannotated -public class ConfigWarehouseLocationInfomationRespVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22903") - @ExcelProperty("ID") - private Long id; - - @Schema(description = "样品库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @ExcelProperty("样品库名称") - private String name; - - @Schema(description = "库位编号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("库位编号") - private String code; - - @Schema(description = "仓库编码") - @ExcelProperty("仓库编码") - private String warehouseCoding; - - @Schema(description = "样品容量", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("样品容量") - private Integer capacity; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("所属部门") - private String systemDepartmentCode; - - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") - private LocalDateTime createTime; - - @Schema(description = "备注") - @ExcelProperty("备注") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationSaveReqVO.java deleted file mode 100644 index 6f4a4bb..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationInfomationSaveReqVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zt.plat.module.qms.business.config.controller.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 样品库位信息新增/修改 Request VO") -@Data -public class ConfigWarehouseLocationInfomationSaveReqVO { - - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22903") - private Long id; - - @Schema(description = "样品库名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @NotEmpty(message = "样品库名称不能为空") - private String name; - - @Schema(description = "库位编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "库位编号不能为空") - private String code; - - @Schema(description = "仓库编码") - private String warehouseCoding; - - @Schema(description = "样品容量", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "样品容量不能为空") - private Integer capacity; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") - private String systemDepartmentCode; - - @Schema(description = "备注") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java new file mode 100644 index 0000000..28861de --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationPageReqVO.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 存放位置分页 Request VO") +@Data +public class ConfigWarehouseLocationPageReqVO extends PageParam { + + @Schema(description = "父ID", example = "31498") + private Long parentId; + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "编码") + private String code; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "容量") + private Integer capacity; + + @Schema(description = "主管部门id", example = "12738") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "张三") + private String mainDepartmentName; + + @Schema(description = "数据类型(仓库、库位)", example = "2") + private String dataType; + + @Schema(description = "仓库分类", example = "2") + private String warehouseType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java new file mode 100644 index 0000000..5080ffb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationRespVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 存放位置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigWarehouseLocationRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13212") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "父ID", example = "31498") + @ExcelProperty("父ID") + private Long parentId; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @ExcelProperty("名称") + private String name; + + @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("编码") + private String code; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "容量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("容量") + private Integer capacity; + + @Schema(description = "主管部门id", example = "12738") + @ExcelProperty("主管部门id") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "张三") + @ExcelProperty("主管部门名称") + private String mainDepartmentName; + + @Schema(description = "数据类型(仓库、库位)", example = "2") + @ExcelProperty("数据类型(仓库、库位)") + private String dataType; + + @Schema(description = "仓库分类", example = "2") + @ExcelProperty("仓库分类") + private String warehouseType; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java new file mode 100644 index 0000000..01ff684 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigWarehouseLocationSaveReqVO.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 存放位置新增/修改 Request VO") +@Data +public class ConfigWarehouseLocationSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13212") + private Long id; + + @Schema(description = "父ID", example = "31498") + private Long parentId; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "名称不能为空") + private String name; + + @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotEmpty(message = "编码不能为空") + private String code; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "容量", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "容量不能为空") + private Integer capacity; + + @Schema(description = "主管部门id", example = "12738") + private Long mainDepartmentId; + + @Schema(description = "主管部门名称", example = "张三") + private String mainDepartmentName; + + @Schema(description = "数据类型(仓库、库位)", example = "2") + private String dataType; + + @Schema(description = "仓库分类", example = "2") + @NotEmpty(message = "仓库分类不能为空") + private String warehouseType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java new file mode 100644 index 0000000..e346dc6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRatePageReqVO.java @@ -0,0 +1,38 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 荧光数据采集特殊检测项目转换率配置分页 Request VO") +@Data +public class ConfigXRFConversionRatePageReqVO extends PageParam { + + @Schema(description = "设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", example = "张三") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java new file mode 100644 index 0000000..bc27f10 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateRespVO.java @@ -0,0 +1,47 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 荧光数据采集特殊检测项目转换率配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigXRFConversionRateRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12818") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + @ExcelProperty("荧光仪器采集系统检测项目名称") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + @ExcelProperty("转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java new file mode 100644 index 0000000..26d624f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFConversionRateSaveReqVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 荧光数据采集特殊检测项目转换率配置新增/修改 Request VO") +@Data +public class ConfigXRFConversionRateSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12818") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "张三") + private String xRFProjectName; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java new file mode 100644 index 0000000..5187c55 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLinePageReqVO.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 荧光分析线分页 Request VO") +@Data +public class ConfigXRFLinePageReqVO extends PageParam { + + @Schema(description = "设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", example = "芋艿") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] lastCheckDataTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java new file mode 100644 index 0000000..a06b15a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineRespVO.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 荧光分析线 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigXRFLineRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10711") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("荧光线名称") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + @ExcelProperty("是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + @ExcelProperty("连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + @ExcelProperty("数据源类型,(1:rdb,2:mdb)") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + @ExcelProperty("末次同步数据时间") + private LocalDateTime lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + @ExcelProperty("末次检查数据时间") + private LocalDateTime lastCheckDataTime; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java new file mode 100644 index 0000000..09a603a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFLineSaveReqVO.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 荧光分析线新增/修改 Request VO") +@Data +public class ConfigXRFLineSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10711") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @NotEmpty(message = "荧光线名称不能为空") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + private LocalDateTime lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + private LocalDateTime lastCheckDataTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java new file mode 100644 index 0000000..7f9ab6b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectPageReqVO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 荧光采集检测项目配置分页 Request VO") +@Data +public class ConfigXRFProjectPageReqVO extends PageParam { + + @Schema(description = "设备编号") + private String deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "12325") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "上报列字段") + private String saveColumn; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java new file mode 100644 index 0000000..1463360 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectRespVO.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 荧光采集检测项目配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ConfigXRFProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15989") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("设备编号") + private String deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325") + @ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + @ExcelProperty("检测项目显示名称") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + @ExcelProperty("荧光仪器采集系统检测项目名称") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + @ExcelProperty("荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + @ExcelProperty("转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "上报列字段") + private String saveColumn; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java new file mode 100644 index 0000000..713670b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigXRFProjectSaveReqVO.java @@ -0,0 +1,53 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 荧光采集检测项目配置新增/修改 Request VO") +@Data +public class ConfigXRFProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15989") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "设备编号不能为空") + private String deviceNo; + + @Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325") + @NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目显示名称", example = "李四") + private String showName; + + @Schema(description = "荧光仪器采集系统检测项目名称", example = "赵六") + private String xRFProjectName; + + @Schema(description = "荧光仪器采集系统检测项目单位") + private String xRFProjectUnit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "转换率(乘数)") + private Integer conversionRate; + + @Schema(description = "上报列字段") + private String saveColumn; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailPageReqVO.java index 4d0c528..b621e1b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailPageReqVO.java @@ -1,12 +1,11 @@ package com.zt.plat.module.qms.business.config.controller.vo; -import com.baomidou.mybatisplus.annotation.TableField; import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; -import java.util.List; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -14,28 +13,28 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class MaterialAssayStandardDetailPageReqVO extends PageParam { - @Schema(description = "物料检测标准ID", example = "30312") + @Schema(description = "物料检测标准ID", example = "3494") private Long materialAssayStandardId; - @Schema(description = "检测项目ID", example = "22587") + @Schema(description = "检测项目ID", example = "27840") private Long dictionaryProjectId; @Schema(description = "检测项目编码") private String dictionaryProjectCode; - @Schema(description = "检测结果单位ID", example = "29303") + @Schema(description = "检测结果单位ID", example = "18156") private Long unitId; @Schema(description = "检测结果单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") private String dataType; @Schema(description = "小数位") private Integer decimalPosition; - @Schema(description = "检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检") + @Schema(description = "检测分类,字典表【T_DIC_BSN】化学;仪器;外检") private String assayCategory; @Schema(description = "是否默认选择,委托时是否默认选择;1-是,0-否") @@ -44,7 +43,7 @@ public class MaterialAssayStandardDetailPageReqVO extends PageParam { @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailRespVO.java index 92498c7..7cdbb53 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailRespVO.java @@ -2,7 +2,8 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; - +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; @@ -11,15 +12,15 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class MaterialAssayStandardDetailRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2831") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12586") @ExcelProperty("ID") private Long id; - @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30312") + @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3494") @ExcelProperty("物料检测标准ID") private Long materialAssayStandardId; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22587") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27840") @ExcelProperty("检测项目ID") private Long dictionaryProjectId; @@ -27,7 +28,7 @@ public class MaterialAssayStandardDetailRespVO { @ExcelProperty("检测项目编码") private String dictionaryProjectCode; - @Schema(description = "检测结果单位ID", example = "29303") + @Schema(description = "检测结果单位ID", example = "18156") @ExcelProperty("检测结果单位ID") private Long unitId; @@ -35,16 +36,16 @@ public class MaterialAssayStandardDetailRespVO { @ExcelProperty("检测结果单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") private String dataType; @Schema(description = "小数位") @ExcelProperty("小数位") private Integer decimalPosition; - @Schema(description = "检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检") + @Schema(description = "检测分类,字典表【T_DIC_BSN】化学;仪器;外检", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测分类,字典表【T_DIC_BSN】化学;仪器;外检") private String assayCategory; @Schema(description = "是否默认选择,委托时是否默认选择;1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) @@ -55,8 +56,8 @@ public class MaterialAssayStandardDetailRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") @@ -70,6 +71,9 @@ public class MaterialAssayStandardDetailRespVO { @Schema(description = "检测项简称") private String dictionaryProjectSimpleName; + @Schema(description = "检测项显示名") + private String dictionaryProjectShowName; + @Schema(description = "数据类型") private String dataTypeName; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailSaveReqVO.java index 29e9f77..6e09837 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardDetailSaveReqVO.java @@ -2,22 +2,21 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import java.util.*; import jakarta.validation.constraints.*; -import java.util.List; - @Schema(description = "管理后台 - 物料检测标准检测项目新增/修改 Request VO") @Data public class MaterialAssayStandardDetailSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2831") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12586") private Long id; - @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30312") + @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3494") @NotNull(message = "物料检测标准ID不能为空") private Long materialAssayStandardId; - @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22587") + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27840") @NotNull(message = "检测项目ID不能为空") private Long dictionaryProjectId; @@ -25,21 +24,21 @@ public class MaterialAssayStandardDetailSaveReqVO { @NotEmpty(message = "检测项目编码不能为空") private String dictionaryProjectCode; - @Schema(description = "检测结果单位ID", example = "29303") + @Schema(description = "检测结果单位ID", example = "18156") private Long unitId; @Schema(description = "检测结果单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") private String dataType; @Schema(description = "小数位") private Integer decimalPosition; - @Schema(description = "检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检不能为空") + @Schema(description = "检测分类,字典表【T_DIC_BSN】化学;仪器;外检", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测分类,字典表【T_DIC_BSN】化学;仪器;外检不能为空") private String assayCategory; @Schema(description = "是否默认选择,委托时是否默认选择;1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectExtendRespVO.java new file mode 100644 index 0000000..1db5b1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class MaterialAssayStandardForecastProjectExtendRespVO extends MaterialAssayStandardForecastProjectRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectPageReqVO.java new file mode 100644 index 0000000..c2c2f3c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectPageReqVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料检测标准来样品位配置分页 Request VO") +@Data +public class MaterialAssayStandardForecastProjectPageReqVO extends PageParam { + + @Schema(description = "物料检测标准ID", example = "28807") + private Long materialAssayStandardId; + + @Schema(description = "检测项目ID", example = "16539") + private Long dictionaryProjectId; + + @Schema(description = "检测项目编码") + private String dictionaryProjectCode; + + @Schema(description = "检测结果单位ID", example = "11072") + private Long unitId; + + @Schema(description = "检测结果单位") + private String unit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否必填,委托时是否必填;1-是,0-否") + private Integer isDefault; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectReqVO.java new file mode 100644 index 0000000..fbafc76 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectReqVO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料检测标准来样品位配置分页 Request VO") +@Data +public class MaterialAssayStandardForecastProjectReqVO { + + @Schema(description = "物料检测标准ID", example = "28807") + private Long materialAssayStandardId; + + @Schema(description = "检测项目ID", example = "16539") + private Long dictionaryProjectId; + + @Schema(description = "检测项目编码") + private String dictionaryProjectCode; + + @Schema(description = "检测结果单位ID", example = "11072") + private Long unitId; + + @Schema(description = "检测结果单位") + private String unit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否必填,委托时是否必填;1-是,0-否") + private Integer isDefault; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + + //=================样品大类属性==================== + @Schema(description = "样品大类ID", example = "1394") + private Long baseSampleId; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectRespVO.java new file mode 100644 index 0000000..1b4924e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectRespVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 物料检测标准来样品位配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialAssayStandardForecastProjectRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30597") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28807") + @ExcelProperty("物料检测标准ID") + private Long materialAssayStandardId; + + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16539") + @ExcelProperty("检测项目ID") + private Long dictionaryProjectId; + + @Schema(description = "检测项目编码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("检测项目编码") + private String dictionaryProjectCode; + + @Schema(description = "检测结果单位ID", example = "11072") + @ExcelProperty("检测结果单位ID") + private Long unitId; + + @Schema(description = "检测结果单位") + @ExcelProperty("检测结果单位") + private String unit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") + private String dataType; + + @Schema(description = "小数位") + @ExcelProperty("小数位") + private Integer decimalPosition; + + @Schema(description = "是否必填,委托时是否必填;1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否必填,委托时是否必填;1-是,0-否") + private Integer isDefault; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectSaveReqVO.java new file mode 100644 index 0000000..8ed36b4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardForecastProjectSaveReqVO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 物料检测标准来样品位配置新增/修改 Request VO") +@Data +public class MaterialAssayStandardForecastProjectSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30597") + private Long id; + + @Schema(description = "物料检测标准ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28807") + @NotNull(message = "物料检测标准ID不能为空") + private Long materialAssayStandardId; + + @Schema(description = "检测项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16539") + @NotNull(message = "检测项目ID不能为空") + private Long dictionaryProjectId; + + @Schema(description = "检测项目编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "检测项目编码不能为空") + private String dictionaryProjectCode; + + @Schema(description = "检测结果单位ID", example = "11072") + private Long unitId; + + @Schema(description = "检测结果单位") + private String unit; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否必填,委托时是否必填;1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否必填,委托时是否必填;1-是,0-否不能为空") + private Integer isDefault; + + @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodPageReqVO.java index 119c859..b6eac2e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodPageReqVO.java @@ -1,6 +1,7 @@ package com.zt.plat.module.qms.business.config.controller.vo; import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; @@ -12,22 +13,31 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class MaterialAssayStandardMethodPageReqVO extends PageParam { - @Schema(description = "物料检测标准明细项ID", example = "27123") + @Schema(description = "物料检测标准明细项ID", example = "19112") private Long materialAssayStandardDetailId; - @Schema(description = "检测方法配置ID", example = "32735") + @Schema(description = "检测方法配置ID", example = "30282") private Long configAssayMethodId; - @Schema(description = "是否默认,1-是,0-否") - private Integer isDefault; + @Schema(description = "分析部门ID", example = "3726") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; @Schema(description = "是否双杯分析,1-是,0-否") private Integer isDualCup; + @Schema(description = "是否默认,1-是,0-否") + private Integer isDefault; + + @Schema(description = "是否复检默认,1-是,0-否") + private Integer isRecheckDefault; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodRespVO.java index a2d5c17..9530f48 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodRespVO.java @@ -2,7 +2,8 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; - +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; @@ -11,32 +12,43 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class MaterialAssayStandardMethodRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21965") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23530") @ExcelProperty("ID") private Long id; - @Schema(description = "物料检测标准明细项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27123") + @Schema(description = "物料检测标准明细项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19112") @ExcelProperty("物料检测标准明细项ID") private Long materialAssayStandardDetailId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32735") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30282") @ExcelProperty("检测方法配置ID") private Long configAssayMethodId; - @Schema(description = "是否默认,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否默认,1-是,0-否") - private Integer isDefault; + @Schema(description = "分析部门ID", example = "3726") + @ExcelProperty("分析部门ID") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + @ExcelProperty("分析部门名称") + private String assayDepartmentName; @Schema(description = "是否双杯分析,1-是,0-否") @ExcelProperty("是否双杯分析,1-是,0-否") private Integer isDualCup; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否默认,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否默认,1-是,0-否") + private Integer isDefault; + + @Schema(description = "是否复检默认,1-是,0-否") + private Integer isRecheckDefault; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodSaveReqVO.java index b61a845..4a94bd4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardMethodSaveReqVO.java @@ -2,32 +2,41 @@ package com.zt.plat.module.qms.business.config.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import java.util.*; import jakarta.validation.constraints.*; @Schema(description = "管理后台 - 物料检测标准与方法新增/修改 Request VO") @Data public class MaterialAssayStandardMethodSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21965") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23530") private Long id; - @Schema(description = "物料检测标准明细项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27123") + @Schema(description = "物料检测标准明细项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19112") @NotNull(message = "物料检测标准明细项ID不能为空") private Long materialAssayStandardDetailId; - @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32735") + @Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30282") @NotNull(message = "检测方法配置ID不能为空") private Long configAssayMethodId; + @Schema(description = "分析部门ID", example = "3726") + private Long assayDepartmentId; + + @Schema(description = "分析部门名称", example = "张三") + private String assayDepartmentName; + + @Schema(description = "是否双杯分析,1-是,0-否") + private Integer isDualCup; + @Schema(description = "是否默认,1-是,0-否", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "是否默认,1-是,0-否不能为空") private Integer isDefault; - @Schema(description = "是否双杯分析,1-是,0-否") - private Integer isDualCup; + @Schema(description = "是否复检默认,1-是,0-否") + private Integer isRecheckDefault; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardRespVO.java index f8fdc90..0a56bcb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/MaterialAssayStandardRespVO.java @@ -4,7 +4,6 @@ import com.zt.plat.module.qms.core.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import com.alibaba.excel.annotation.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java index 8a65a95..9fd5436 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/BaseSampleDO.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.dal.dataobject; import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** @@ -29,10 +32,10 @@ public class BaseSampleDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 大类名称 + * 样品大类名称 */ - @TableField("SMP_NAME") - private String sampleName; + @TableField("NAME") + private String name; /** * 物料ID */ @@ -64,11 +67,4 @@ public class BaseSampleDO extends BusinessBaseDO { @TableField("RMK") private String remark; - - //===================扩展字段=================== - //检测标准数量 - @TableField(exist = false) - private String assayStandardCount; - - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java index a88e178..1d49e38 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodDO.java @@ -37,6 +37,16 @@ public class ConfigAssayMethodDO extends BusinessBaseDO { @TableField("MTHD_CFG_ID") private Long methodConfigId; /** + * 方法类别ID,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 方法类别KEY,字典表【T_DIC_BSN】方法类别:methodCategory,容量法、等离子发射光谱法、原子吸收分光光度等 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** * 方法名称 */ @TableField("NAME") @@ -52,15 +62,25 @@ public class ConfigAssayMethodDO extends BusinessBaseDO { @TableField("DSP") private String description; /** + * 数据集Key,T_DAT_COLT_FLD + */ + @TableField("DAT_COLT_KY") + private String dataCollectionKey; + /** * 是否启用,1-启用,0-不启用 */ @TableField("IS_ENBD") private Integer isEnabled; /** - * 任务模版key + * 是否配料,1-是,0-否 */ - @TableField("TMPL_KY") - private String templateKey; + @TableField("IS_IGDT") + private Integer isIngredients; + /** + * 任务单模板key + */ + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; /** * 任务单编号规则 */ @@ -82,10 +102,15 @@ public class ConfigAssayMethodDO extends BusinessBaseDO { @TableField("ASY_TSK_INF") private String assayTaskInfomation; /** - * 检测部门编号 + * 分析部门ID */ - @TableField("ASY_DEPT_CD") - private String assayDepartmentCode; + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java new file mode 100644 index 0000000..789f4b4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectAssessmentDO.java @@ -0,0 +1,110 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测方法分析项目判定 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_asy_mthd_prj_asmt") +@KeySequence("t_cfg_asy_mthd_prj_asmt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigAssayMethodProjectAssessmentDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 级别 + */ + @TableField("ASMT_LVL") + private Integer assessmentLevel; + /** + * 范围 + */ + @TableField("ASMT_RNG") + private String assessmentRange; + /** + * 最小允差值 + */ + @TableField("MIN_TLC_VAL") + private String minimumToleraanceValue; + /** + * 最大允差值 + */ + @TableField("MAX_TLC_VAL") + private String maximumToleraanceValue; + /** + * 最小值 + */ + @TableField("MIN_VAL") + private String minimumValue; + /** + * 最大值 + */ + @TableField("MAX_VAL") + private String maximumValue; + /** + * 计算公式 + */ + @TableField("FMU") + private String formula; + /** + * 是否使用公式计算计算允差值,1-是,0-否 + */ + @TableField("IS_USE_FMU") + private Integer isUseFormula; + /** + * 允差值调整参数 + */ + @TableField("TLC_ADJ_VAL") + private String toleraanceAdjustmentValue; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java new file mode 100644 index 0000000..8902230 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.math.BigDecimal; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测方法分析项目补正系数 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_asy_mthd_prj_coef") +@KeySequence("t_cfg_asy_mthd_prj_coef_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigAssayMethodProjectCoefficientDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目缩写 + */ + @TableField("PRJ_SMPL_NAME") + private String projectSimpleName; + /** + * 范围 + */ + @TableField("RNG") + private String range; + /** + * 最小值 + */ + @TableField("MIN_VAL") + private String minimumValue; + /** + * 最大值 + */ + @TableField("MAX_VAL") + private String maximumValue; + /** + * 补正系数 + */ + @TableField("COEF") + private BigDecimal coefficient; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectDO.java index 3a6dacf..46f8c9f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectDO.java @@ -32,7 +32,7 @@ public class ConfigAssayMethodProjectDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 检测方法ID + * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; @@ -82,10 +82,25 @@ public class ConfigAssayMethodProjectDO extends BusinessBaseDO { @TableField("IS_DFT_ENBD") private Integer isDefaultEnabled; /** - * 排序 + * 方法检出下限值 */ - @TableField("SRT") - private Integer sort; + @TableField("MIN_LIM_VAL") + private String minimumLimitValue; + /** + * 参数分组_ID + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java index f21668c..feaeb99 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectParameterDO.java @@ -32,7 +32,7 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 检测方法分析项目ID + * 检测方法分析项目配置ID */ @TableField("CFG_ASY_MTHD_PRJ_ID") private Long configAssayMethodProjectId; @@ -72,10 +72,20 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO { @TableField("IS_SHW") private Integer isShow; /** - * 排序 + * 排序号 */ - @TableField("SRT") - private Integer sort; + @TableField("SRT_NO") + private Integer sortNo; + /** + * 参数分组_ID + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectRangeDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectRangeDO.java new file mode 100644 index 0000000..066780e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectRangeDO.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测方法分析项目区间 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_asy_mthd_prj_rng") +@KeySequence("t_cfg_asy_mthd_prj_rng_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigAssayMethodProjectRangeDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 检测方法分析项目配置ID + */ + @TableField("CFG_ASY_MTHD_PRJ_ID") + private Long configAssayMethodProjectId; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 范围类型,控制范围类型(0-不控制;1-只警告;2-只限制;3-警告+限制) + */ + @TableField("RNG_TP") + private String rangeType; + /** + * 最小限制值 + */ + @TableField("MIN_VAL") + private String minimumValue; + /** + * 最小警告值 + */ + @TableField("MIN_WARN_VAL") + private String minimumWarningValue; + /** + * 最大警告值 + */ + @TableField("MAX_WARN_VAL") + private String maximumWarningValue; + /** + * 最大限制值 + */ + @TableField("MAX_VAL") + private String maximumValue; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigBaseSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigBaseSampleDO.java index ffeaee1..fef2da6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigBaseSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigBaseSampleDO.java @@ -32,7 +32,7 @@ public class ConfigBaseSampleDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 样品ID + * 样品大类ID */ @TableField("BSE_SMP_ID") private Long baseSampleId; @@ -60,7 +60,7 @@ public class ConfigBaseSampleDO extends BusinessBaseDO { * 样品标签打印份数 */ @TableField("CD_PRNT_QTY") - private Integer codePrintQuantity; + private byte[] codePrintQuantity; /** * 样品名称 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceDO.java index b3c5375..5d360c2 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigEntrustSourceDO.java @@ -25,38 +25,47 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; public class ConfigEntrustSourceDO extends BusinessBaseDO { - /** * ID */ @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托 + * 委托类型,委托登记-entrust_registration、检验委托-entrust_inspection + */ + @TableField("ENTT_TP") + private String entrustType; + /** + * 委托来源名称,西南铜委托、商检委托、内部委托、抽查委托、内审委托、生产委托 */ @TableField("NAME") private String name; /** - * 模版Key + * 委托来源Key */ @TableField("KY") private String key; /** - * 数据集key,T_DAT_COLT_FLD + * 数据集Key,T_DAT_COLT_FLD */ @TableField("DAT_COLT_KY") private String dataCollectionKey; /** - * 委托单模版 + * 委托单模版Key */ - @TableField("TMPL") - private String template; + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; /** * 委托单号规则 */ @TableField("CD_RUL") private String codeRule; /** + * 委托单号引用字段 + */ + @TableField("CD_FLD") + private String codeField; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigPermissionDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigPermissionDO.java new file mode 100644 index 0000000..5282ba8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigPermissionDO.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 权限配置,通用权限配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_perm") +@KeySequence("t_cfg_perm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigPermissionDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 主数据id + */ + @TableField("SRC_ID") + private Long sourceId; + /** + * 主数据类型 + */ + @TableField("SRC_TP") + private String sourceType; + /** + * 关联id + */ + @TableField("TGT_ID") + private Long targetId; + + @TableField("TGT_NAME") + private String targetName; + /** + * 关联数据类型 + */ + @TableField("TGT_TP") + private String targetType; + /** + * 权限类型 + */ + @TableField("PERM_TP") + private String permissionType; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java new file mode 100644 index 0000000..ba8720c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodDO.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样与检测方法配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_qc_smp_mthd") +@KeySequence("t_cfg_qc_smp_mthd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigQCSampleMethodDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 质控类型_ID,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 质控类型_Key,字典表【T_DIC_BSN】质控类型:空白样、管理样、标准样、标样 + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 编码规则 + */ + @TableField("CD_RUL") + private String codeRule; + /** + * 默认个数,1-是,0-否 + */ + @TableField("DFT_CNT") + private Integer defaultCount; + /** + * 分配提交最小个数 + */ + @TableField("TSK_MIN_CNT") + private Integer taskMinimumCount; + /** + * 分析提交最小个数 + */ + @TableField("ASY_MIN_CNT") + private Integer assayMinimumCount; + /** + * 是否关联定值样,1-是,0-否 + */ + @TableField("IS_CORR") + private Integer isCorrelation; + /** + * 映射检测信息配置 + */ + @TableField("CFG_INF") + private String configInfomation; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java new file mode 100644 index 0000000..5ba95d1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCSampleMethodParameterDO.java @@ -0,0 +1,105 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控样检测方法参数配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_qc_smp_mthd_prm") +@KeySequence("t_cfg_qc_smp_mthd_prm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigQCSampleMethodParameterDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 检测方法与质控样类型配置ID + */ + @TableField("CFG_QC_SMP_MTHD_ID") + private Long configQCSampleMethodId; + /** + * 参数ID,字典表【T_DIC_PRM】 + */ + @TableField("DIC_PRM_ID") + private Long dictionaryParameterId; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 默认值 + */ + @TableField("DFT_VAL") + private String defaultValue; + /** + * 是否允许为空 + */ + @TableField("IS_NLL") + private Integer isNull; + /** + * 计算公式 + */ + @TableField("FMU") + private String formula; + /** + * pc界面是否显示 + */ + @TableField("IS_SHW") + private Integer isShow; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 参数分组_ID + */ + @TableField("DIC_BSN_ID") + private Long dictionaryBusinessId; + /** + * 参数分组_Key + */ + @TableField("DIC_BSN_KY") + private String dictionaryBusinessKey; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCStandardSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCStandardSampleDO.java new file mode 100644 index 0000000..88a8fe4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigQCStandardSampleDO.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 质控与定值样关系 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_qc_std_smp") +@KeySequence("t_cfg_qc_std_smp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigQCStandardSampleDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 质控样与检测方法配置ID + */ + @TableField("CFG_QC_SMP_MTHD_ID") + private Long configQCSampleMethodId; + /** + * 定值样业务ID + */ + @TableField("BSN_STD_SMP_ID") + private Long businessStandardSampleId; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java index 55ecafc..c00706f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java @@ -47,31 +47,36 @@ public class ConfigReportFieldDO extends BusinessBaseDO { @TableField("FLD_NAME") private String fieldName; /** - * 排序号 + * 字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated */ - @TableField("NO") - private Integer no; - /** - * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 - */ - @TableField("DAT_TP") - private Integer dataType; - /** - * 小数位 - */ - @TableField("DEC") - private Integer decimal; + @TableField("FLD_TP") + private String fieldType; /** * 列宽 */ @TableField("FLD_WDTH") private Integer fieldWidth; /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** * 是否分组 */ @TableField("IS_GRP") private Integer isGroup; /** + * 表头分组 + */ + @TableField("TTL_GRP") + private String titleGroup; + /** * 是否可修改 */ @TableField("IS_UPD") @@ -82,10 +87,10 @@ public class ConfigReportFieldDO extends BusinessBaseDO { @TableField("FMU") private String formula; /** - * 表头分组 + * 排序号 */ - @TableField("TTL_GRP") - private String titleGroup; + @TableField("NO") + private Integer no; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportTemplateDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportTemplateDO.java index 399cbe0..fc26709 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportTemplateDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportTemplateDO.java @@ -1,10 +1,13 @@ package com.zt.plat.module.qms.business.config.dal.dataobject; import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 报表模版配置 DO +* 锐浪报表模版配置 DO * * @author 后台管理 */ @@ -54,8 +57,8 @@ public class ConfigReportTemplateDO extends BusinessBaseDO { @TableField("DAT") private String data; /** - * 模板是否认证 - */ + * 是否授权,1-是,0否 + */ @TableField("IS_AUTH") private Integer isAuthority; /** @@ -66,7 +69,6 @@ public class ConfigReportTemplateDO extends BusinessBaseDO { /** * 乐观锁 */ - @Version @TableField("UPD_CNT") private Integer updateCount; /** @@ -74,5 +76,15 @@ public class ConfigReportTemplateDO extends BusinessBaseDO { */ @TableField("RMK") private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + /** + * 是否最新版本,1-是,0-否 + */ + @TableField("IS_LST") + private Integer isLast; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java new file mode 100644 index 0000000..3ca9bf5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 规则配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_rul") +@KeySequence("t_cfg_rul_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigRuleDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 编码 + */ + @TableField("CD") + private String code; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 描述 + */ + @TableField("DSP") + private String description; + /** + * 类型 + */ + @TableField("TP") + private String type; + /** + * 表达式 + */ + @TableField("EPSSN") + private String expression; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + /** + * 是否最新版本,1-是,0-否 + */ + @TableField("IS_LST") + private Integer isLast; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleFlowDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleFlowDO.java index ed88dbc..2c0a7bd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleFlowDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleFlowDO.java @@ -52,7 +52,7 @@ public class ConfigSampleFlowDO extends BusinessBaseDO { @TableField("DSP") private String description; /** - * 类型,主样、子样 + * 类型,主样base_sample、子样sub_sample */ @TableField("TP") private String type; @@ -66,5 +66,15 @@ public class ConfigSampleFlowDO extends BusinessBaseDO { */ @TableField("RMK") private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + /** + * 是否最新版本,1-是,0-否 + */ + @TableField("IS_LST") + private Integer isLast; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleHandoverDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleHandoverDO.java index 53ef3fd..3dd5db4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleHandoverDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSampleHandoverDO.java @@ -7,7 +7,7 @@ import java.util.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 样品交接配置 DO +* 样品交接单配置 DO * * @author 后台管理 */ @@ -44,8 +44,8 @@ public class ConfigSampleHandoverDO extends BusinessBaseDO { /** * 交接模版key */ - @TableField("TMPL_KY") - private String templateKey; + @TableField("CFG_RPT_TMPL_KY") + private String configReportTemplateKey; /** * 交接单编号规则 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSimpleFlowRuleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSimpleFlowRuleDO.java index 1db893e..c1871e8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSimpleFlowRuleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSimpleFlowRuleDO.java @@ -47,6 +47,11 @@ public class ConfigSimpleFlowRuleDO extends BusinessBaseDO { @TableField("DAT") private String data; /** + * 流程图 + */ + @TableField("FLW") + private String flow; + /** * 路由 */ @TableField("RUT") @@ -57,11 +62,6 @@ public class ConfigSimpleFlowRuleDO extends BusinessBaseDO { @TableField("GRP_NAME") private String groupName; /** - * 流程图 - */ - @TableField("FLW") - private String flow; - /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleProjectDO.java index 8498332..33adb24 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleProjectDO.java @@ -64,8 +64,8 @@ public class ConfigStandardSampleProjectDO extends BusinessBaseDO { /** * 排序号 */ - @TableField("SRT") - private String sort; + @TableField("SRT_NO") + private Integer sortNo; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleTypeDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleTypeDO.java index df59cb2..f257bbf 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleTypeDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigStandardSampleTypeDO.java @@ -47,16 +47,21 @@ public class ConfigStandardSampleTypeDO extends BusinessBaseDO { @TableField("CD_RUL") private String codeRule; /** + * 分析部门ID + */ + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") private String systemDepartmentCode; /** - * 化验部门编号 - */ - @TableField("ASY_DEPT_CD") - private String assayDepartmentCode; - /** * 备注 */ @TableField("RMK") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java index e26948e..e7eb8c7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleDO.java @@ -32,6 +32,16 @@ public class ConfigSubSampleDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** + * 样品大类ID + */ + @TableField("BSE_SMP_ID") + private Long baseSampleId; + /** + * 主样配置ID + */ + @TableField("CFG_BSE_SMP_ID") + private Long configBaseSampleId; + /** * 分样配置ID */ @TableField("CFG_SB_SMP_PRN_ID") @@ -62,10 +72,15 @@ public class ConfigSubSampleDO extends BusinessBaseDO { @TableField("IS_PRNT") private Integer isPrint; /** + * 样品标签打印模版 + */ + @TableField("PRNT_TMPL") + private String printTemplate; + /** * 复检节点 */ - @TableField("RCHK_FLW_CD") - private String recheckFlowCode; + @TableField("RCHK_FLW_NDE_KY") + private String recheckFlowNodeKey; /** * 样品名称 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java index 415675e..9cd6934 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleMethodDO.java @@ -37,12 +37,12 @@ public class ConfigSubSampleMethodDO extends BusinessBaseDO { @TableField("CFG_SB_SMP_ID") private Long configSubSampleId; /** - * 分析方法ID + * 检测方法配置ID */ @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** - * 是否默认使用,1-启用,0-不启用 + * 是否默认使用,1-是,0-否 */ @TableField("IS_DFT_USE") private Integer isDefaultUse; @@ -52,6 +52,26 @@ public class ConfigSubSampleMethodDO extends BusinessBaseDO { @TableField("TSK_CNT") private Integer taskCount; /** + * 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改 + */ + @TableField("RSLT_TMT_WY") + private String resultTreatmentWay; + /** + * 判定方法,default-默认,other-其他(扩展) + */ + @TableField("ASMT_MTHD") + private String assessmentMethod; + /** + * 计算方法,calculateAverageValue-平均值,来自T_CFG_RUL的编码 + */ + @TableField("CALT_MTHD") + private String calculateMethod; + /** + * 映射检测信息配置 + */ + @TableField("CFG_INF") + private String configInfomation; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentDO.java index e6fc0df..24193a6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentDO.java @@ -32,6 +32,11 @@ public class ConfigSubSampleParentDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** + * 样品大类ID + */ + @TableField("BSE_SMP_ID") + private Long baseSampleId; + /** * 主样配置ID */ @TableField("CFG_BSE_SMP_ID") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java new file mode 100644 index 0000000..8fa3ebe --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigSubSampleParentMethodDO.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 分样与检测方法配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_sb_smp_prn_mthd") +@KeySequence("t_cfg_sb_smp_prn_mthd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigSubSampleParentMethodDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 分样配置ID + */ + @TableField("CFG_SB_SMP_PRN_ID") + private Long configSubSampleParentId; + /** + * 检测方法配置ID + */ + @TableField("CFG_ASY_MTHD_ID") + private Long configAssayMethodId; + /** + * 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改 + */ + @TableField("RSLT_TMT_WY") + private String resultTreatmentWay; + /** + * 计算方法,average-平均值,other-其他(扩展) + */ + @TableField("CALT_MTHD") + private String calculateMethod; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigUserSignatureDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigUserSignatureDO.java new file mode 100644 index 0000000..b067b51 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigUserSignatureDO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 手写签名配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_user_sig") +@KeySequence("t_cfg_user_sig_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigUserSignatureDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 用户id + */ + @TableField("USER_ID") + private String userId; + /** + * 用户姓名 + */ + @TableField("USER_NAME") + private String userName; + /** + * 文件id + */ + @TableField("FILE_ID") + private Long fileId; + /** + * 签名内容 + */ + @TableField("SIG_CNTT") + private String signatureContent; + /** + * 禁用标识 + */ + @TableField("CNL_FLG") + private Integer cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java new file mode 100644 index 0000000..6e980e1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationDO.java @@ -0,0 +1,88 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 存放位置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_wrh_loc") +@KeySequence("t_cfg_wrh_loc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigWarehouseLocationDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父ID + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 编码 + */ + @TableField("CD") + private String code; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 容量 + */ + @TableField("CPY") + private Integer capacity; + /** + * 主管部门id + */ + @TableField("MAIN_DEPT_ID") + private Long mainDepartmentId; + /** + * 主管部门名称 + */ + @TableField("MAIN_DEPT_NAME") + private String mainDepartmentName; + /** + * 数据类型(仓库、库位) + */ + @TableField("DAT_TP") + private String dataType; + + //仓库分类 + @TableField("WRH_TP") + private String warehouseType; + + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationParDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationParDO.java new file mode 100644 index 0000000..29f6390 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationParDO.java @@ -0,0 +1,10 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; + +@TableName("t_cfg_wrh_loc") +@Data +//用于join自关联 +public class ConfigWarehouseLocationParDO extends ConfigWarehouseLocationDO{ +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationInfomationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java similarity index 62% rename from zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationInfomationDO.java rename to zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java index 858226d..f66ceab 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigWarehouseLocationInfomationDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFConversionRateDO.java @@ -7,12 +7,12 @@ import java.util.*; import com.baomidou.mybatisplus.annotation.*; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 样品库位信息 DO +* 荧光数据采集特殊检测项目转换率配置 DO * * @author 后台管理 */ -@TableName("t_cfg_wrh_loc_inf") -@KeySequence("t_cfg_wrh_loc_inf_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@TableName("t_cfg_xrf_cnv_rte") +@KeySequence("t_cfg_xrf_cnv_rte_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -22,7 +22,7 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO */ -public class ConfigWarehouseLocationInfomationDO extends BusinessBaseDO { +public class ConfigXRFConversionRateDO extends BusinessBaseDO { @@ -32,25 +32,25 @@ public class ConfigWarehouseLocationInfomationDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * 样品库名称 + * 设备编号 */ - @TableField("NAME") - private String name; + @TableField("DEV_NO") + private String deviceNo; /** - * 库位编号 + * 荧光线名称 */ - @TableField("CD") - private String code; + @TableField("LINE_NAME") + private String lineName; /** - * 仓库编码 + * 荧光仪器采集系统检测项目名称 */ - @TableField("WRH_CDG") - private String warehouseCoding; + @TableField("XRF_PRJ_NAME") + private String xRFProjectName; /** - * 样品容量 + * 转换率(乘数) */ - @TableField("CPY") - private Integer capacity; + @TableField("CNV_RTE") + private Integer conversionRate; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java new file mode 100644 index 0000000..e4b1cc1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFLineDO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 荧光分析线 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_xrf_line") +@KeySequence("t_cfg_xrf_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigXRFLineDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private String deviceNo; + /** + * 荧光线名称 + */ + @TableField("LINE_NAME") + private String lineName; + /** + * 是否启用,0、未启用;1、启用; + */ + @TableField("IS_USE") + private Integer isUse; + /** + * 连接字符串 + */ + @TableField("CONN_STR") + private String connectString; + /** + * 数据源类型,(1:rdb,2:mdb) + */ + @TableField("DAT_SRC_TP") + private Integer dataSourceType; + /** + * 末次同步数据时间 + */ + @TableField("LST_SYNC_DAT_TM") + private LocalDateTime lastSynchronousDataTime; + /** + * 末次检查数据时间 + */ + @TableField("LST_CHK_DAT_TM") + private LocalDateTime lastCheckDataTime; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java new file mode 100644 index 0000000..118f6fa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigXRFProjectDO.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 荧光采集检测项目配置 DO +* +* @author 后台管理 +*/ +@TableName("t_cfg_xrf_prj") +@KeySequence("t_cfg_xrf_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ConfigXRFProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备编号 + */ + @TableField("DEV_NO") + private String deviceNo; + /** + * 检测项目ID,字典表【T_DIC_PRJ】 + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目显示名称 + */ + @TableField("SHW_NAME") + private String showName; + /** + * 荧光仪器采集系统检测项目名称 + */ + @TableField("XRF_PRJ_NAME") + private String xRFProjectName; + /** + * 荧光仪器采集系统检测项目单位 + */ + @TableField("XRF_PRJ_UNT") + private String xRFProjectUnit; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 转换率(乘数) + */ + @TableField("CNV_RTE") + private Integer conversionRate; + /** + * 上报列字段 + */ + @TableField("SVE_COLN") + private String saveColumn; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailDO.java index e616e38..51c3001 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailDO.java @@ -54,7 +54,7 @@ public class MaterialAssayStandardDetailDO extends BusinessBaseDO { @TableField("UNT") private String unit; /** - * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 */ @TableField("DAT_TP") private String dataType; @@ -64,7 +64,7 @@ public class MaterialAssayStandardDetailDO extends BusinessBaseDO { @TableField("DEC_POS") private Integer decimalPosition; /** - * 检测分类,【字典】【jy_assay_standard_category】化学;仪器;外检 + * 检测分类,字典表【T_DIC_BSN】化学;仪器;外检 */ @TableField("ASY_CTGR") private String assayCategory; @@ -84,7 +84,4 @@ public class MaterialAssayStandardDetailDO extends BusinessBaseDO { @TableField("RMK") private String remark; - - - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailExtendDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailExtendDO.java index 7ea519c..ec256bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailExtendDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardDetailExtendDO.java @@ -1,6 +1,5 @@ package com.zt.plat.module.qms.business.config.dal.dataobject; -import com.baomidou.mybatisplus.annotation.TableField; import lombok.*; @Data @@ -15,6 +14,7 @@ public class MaterialAssayStandardDetailExtendDO extends MaterialAssayStandardDe // @TableField(value = "DIC_PRJ_NAME", select = false) private String dictionaryProjectName; private String dictionaryProjectSimpleName; + private String dictionaryProjectShowName; //数据类型 // @TableField(value = "DATA_TYPE_NAME", select = false) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardExtendDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardExtendDO.java index 68c97a4..0c5d296 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardExtendDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardExtendDO.java @@ -1,6 +1,5 @@ package com.zt.plat.module.qms.business.config.dal.dataobject; -import com.baomidou.mybatisplus.annotation.TableField; import lombok.*; @Data diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardForecastProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardForecastProjectDO.java new file mode 100644 index 0000000..96aa9da --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardForecastProjectDO.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.business.config.dal.dataobject; + +import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 物料检测标准来样品位配置 DO +* +* @author 后台管理 +*/ +@TableName("t_mtrl_asy_std_frcst_prj") +@KeySequence("t_mtrl_asy_std_frcst_prj_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialAssayStandardForecastProjectDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 物料检测标准ID + */ + @TableField("MTRL_ASY_STD_ID") + private Long materialAssayStandardId; + /** + * 检测项目ID + */ + @TableField("DIC_PRJ_ID") + private Long dictionaryProjectId; + /** + * 检测项目编码 + */ + @TableField("DIC_PRJ_CD") + private String dictionaryProjectCode; + /** + * 检测结果单位ID + */ + @TableField("UNT_ID") + private Long unitId; + /** + * 检测结果单位 + */ + @TableField("UNT") + private String unit; + /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** + * 是否必填,委托时是否必填;1-是,0-否 + */ + @TableField("IS_DFT") + private Integer isDefault; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardMethodDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardMethodDO.java index 34a0e5f..e2a98e9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardMethodDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/MaterialAssayStandardMethodDO.java @@ -39,16 +39,31 @@ public class MaterialAssayStandardMethodDO extends BusinessBaseDO { @TableField("CFG_ASY_MTHD_ID") private Long configAssayMethodId; /** - * 是否默认,1-是,0-否 + * 分析部门ID */ - @TableField("IS_DFT") - private Integer isDefault; + @TableField("ASY_DEPT_ID") + private Long assayDepartmentId; + /** + * 分析部门名称 + */ + @TableField("ASY_DEPT_NAME") + private String assayDepartmentName; /** * 是否双杯分析,1-是,0-否 */ @TableField("IS_DUAL_CP") private Integer isDualCup; /** + * 是否默认,1-是,0-否 + */ + @TableField("IS_DFT") + private Integer isDefault; + /** + * 是否复检默认,1-是,0-否 + */ + @TableField("IS_RCHK_DFT") + private Integer isRecheckDefault; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java index 315b194..d208ce7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.java @@ -19,7 +19,7 @@ public interface BaseSampleMapper extends BaseMapperX { default PageResult selectPage(BaseSamplePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(BaseSampleDO::getSampleName, reqVO.getSampleName()) + .likeIfPresent(BaseSampleDO::getName, reqVO.getName()) .eqIfPresent(BaseSampleDO::getMaterialId, reqVO.getMaterialId()) .eqIfPresent(BaseSampleDO::getMaterialCode, reqVO.getMaterialCode()) .likeIfPresent(BaseSampleDO::getMaterialName, reqVO.getMaterialName()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java index 94506ba..03df34b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodMapper.java @@ -6,8 +6,9 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -21,38 +22,47 @@ import com.zt.plat.module.qms.business.config.controller.vo.*; public interface ConfigAssayMethodMapper extends BaseMapperX { default List selectList(ConfigAssayMethodReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() + return selectList(new LambdaQueryWrapperX() .eqIfPresent(ConfigAssayMethodDO::getMethodConfigId, reqVO.getMethodConfigId()) + .eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) .likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName()) .eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode()) .eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription()) .eqIfPresent(ConfigAssayMethodDO::getIsEnabled, reqVO.getIsEnabled()) - .eqIfPresent(ConfigAssayMethodDO::getTemplateKey, reqVO.getTemplateKey()) + .eqIfPresent(ConfigAssayMethodDO::getIsIngredients, reqVO.getIsIngredients()) + .eqIfPresent(ConfigAssayMethodDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) .eqIfPresent(ConfigAssayMethodDO::getCodeRule, reqVO.getCodeRule()) .eqIfPresent(ConfigAssayMethodDO::getAssignWay, reqVO.getAssignWay()) .eqIfPresent(ConfigAssayMethodDO::getAssignPlatform, reqVO.getAssignPlatform()) .eqIfPresent(ConfigAssayMethodDO::getAssayTaskInfomation, reqVO.getAssayTaskInfomation()) - .eqIfPresent(ConfigAssayMethodDO::getAssayDepartmentCode, reqVO.getAssayDepartmentCode()) - .eqIfPresent(ConfigAssayMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(ConfigAssayMethodDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(ConfigAssayMethodDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) .betweenIfPresent(ConfigAssayMethodDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(ConfigAssayMethodDO::getRemark, reqVO.getRemark()) .eqIfPresent(ConfigAssayMethodDO::getVersion, reqVO.getVersion()) + .eqIfPresent(ConfigAssayMethodDO::getDataCollectionKey, reqVO.getDataCollectionKey()) .orderByDesc(ConfigAssayMethodDO::getId)); } default PageResult selectPage(ConfigAssayMethodPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(ConfigAssayMethodDO::getMethodConfigId, reqVO.getMethodConfigId()) + .eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) .likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName()) .eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode()) .eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription()) + .eqIfPresent(ConfigAssayMethodDO::getDataCollectionKey, reqVO.getDataCollectionKey()) .eqIfPresent(ConfigAssayMethodDO::getIsEnabled, reqVO.getIsEnabled()) - .eqIfPresent(ConfigAssayMethodDO::getTemplateKey, reqVO.getTemplateKey()) + .eqIfPresent(ConfigAssayMethodDO::getIsIngredients, reqVO.getIsIngredients()) + .eqIfPresent(ConfigAssayMethodDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) .eqIfPresent(ConfigAssayMethodDO::getCodeRule, reqVO.getCodeRule()) .eqIfPresent(ConfigAssayMethodDO::getAssignWay, reqVO.getAssignWay()) .eqIfPresent(ConfigAssayMethodDO::getAssignPlatform, reqVO.getAssignPlatform()) .eqIfPresent(ConfigAssayMethodDO::getAssayTaskInfomation, reqVO.getAssayTaskInfomation()) - .eqIfPresent(ConfigAssayMethodDO::getAssayDepartmentCode, reqVO.getAssayDepartmentCode()) + .eqIfPresent(ConfigAssayMethodDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(ConfigAssayMethodDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) .eqIfPresent(ConfigAssayMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(ConfigAssayMethodDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(ConfigAssayMethodDO::getRemark, reqVO.getRemark()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java new file mode 100644 index 0000000..2f493b8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectAssessmentMapper.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测方法分析项目判定 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigAssayMethodProjectAssessmentMapper extends BaseMapperX { + + default PageResult selectPage(ConfigAssayMethodProjectAssessmentPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getAssessmentLevel, reqVO.getAssessmentLevel()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getAssessmentRange, reqVO.getAssessmentRange()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getMinimumToleraanceValue, reqVO.getMinimumToleraanceValue()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getMaximumToleraanceValue, reqVO.getMaximumToleraanceValue()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getMinimumValue, reqVO.getMinimumValue()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getMaximumValue, reqVO.getMaximumValue()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getFormula, reqVO.getFormula()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getIsUseFormula, reqVO.getIsUseFormula()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getToleraanceAdjustmentValue, reqVO.getToleraanceAdjustmentValue()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigAssayMethodProjectAssessmentDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigAssayMethodProjectAssessmentDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigAssayMethodProjectAssessmentDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java new file mode 100644 index 0000000..bc2eda1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测方法分析项目补正系数 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigAssayMethodProjectCoefficientMapper extends BaseMapperX { + + default PageResult selectPage(ConfigAssayMethodProjectCoefficientPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .likeIfPresent(ConfigAssayMethodProjectCoefficientDO::getProjectSimpleName, reqVO.getProjectSimpleName()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getRange, reqVO.getRange()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getMinimumValue, reqVO.getMinimumValue()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getMaximumValue, reqVO.getMaximumValue()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getCoefficient, reqVO.getCoefficient()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigAssayMethodProjectCoefficientDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigAssayMethodProjectCoefficientDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java index fe7dab3..132c413 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectMapper.java @@ -1,12 +1,18 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -29,7 +35,8 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, ConfigAssayMethodProjectDO::getDictionaryProjectId) + .selectAll(ConfigAssayMethodProjectDO.class) + .selectAs(DictionaryProjectDO::getKey, ConfigAssayMethodProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, ConfigAssayMethodProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, ConfigAssayMethodProjectExtendRespVO::getShowName) + .eq(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + + default List selectByConfigAssayMethodIds(List configAssayMethodIds) { + return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, ConfigAssayMethodProjectDO::getDictionaryProjectId) + .selectAll(ConfigAssayMethodProjectDO.class) + .selectAs(DictionaryProjectDO::getKey, ConfigAssayMethodProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, ConfigAssayMethodProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, ConfigAssayMethodProjectExtendRespVO::getShowName) + .in(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodIds)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java index 84bc256..09910e8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectParameterMapper.java @@ -1,12 +1,16 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -27,12 +31,29 @@ public interface ConfigAssayMethodProjectParameterMapper extends BaseMapperX selectByConfigAssayMethodProjectId(Long configAssayMethodProjectId) { + return selectList(new LambdaQueryWrapperX() + .eq(ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId, configAssayMethodProjectId)); + } + + default List selectByConfigAssayMethodProjectIds(List configAssayMethodProjectIds) { + return selectList(new LambdaQueryWrapperX() + .in(ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId, configAssayMethodProjectIds)); + } + + default List selectByConfigAssayMethodIds(List configAssayMethodIds) { + return selectJoinList(ConfigAssayMethodProjectParameterDO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId) + .selectAll(ConfigAssayMethodProjectParameterDO.class) + .in(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodIds)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectRangeMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectRangeMapper.java new file mode 100644 index 0000000..5472299 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectRangeMapper.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangePageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测方法分析项目区间 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigAssayMethodProjectRangeMapper extends BaseMapperX { + + default PageResult selectPage(ConfigAssayMethodProjectRangePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getRangeType, reqVO.getRangeType()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getMinimumValue, reqVO.getMinimumValue()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getMinimumWarningValue, reqVO.getMinimumWarningValue()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getMaximumWarningValue, reqVO.getMaximumWarningValue()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getMaximumValue, reqVO.getMaximumValue()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigAssayMethodProjectRangeDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigAssayMethodProjectRangeDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigAssayMethodProjectRangeDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java index 7372c8f..69e0306 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigBaseSampleMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceMapper.java index 4eb85b0..d0d7bf6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigEntrustSourceMapper.java @@ -5,6 +5,8 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourcePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -22,11 +24,13 @@ public interface ConfigEntrustSourceMapper extends BaseMapperX { + + default PageResult selectPage(ConfigPermissionPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigPermissionDO::getSourceId, reqVO.getSourceId()) + .eqIfPresent(ConfigPermissionDO::getSourceType, reqVO.getSourceType()) + .eqIfPresent(ConfigPermissionDO::getTargetId, reqVO.getTargetId()) + .eqIfPresent(ConfigPermissionDO::getTargetType, reqVO.getTargetType()) + .eqIfPresent(ConfigPermissionDO::getPermissionType, reqVO.getPermissionType()) + .eqIfPresent(ConfigPermissionDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigPermissionDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigPermissionDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigPermissionDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java index 47b9249..ea59198 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java @@ -1,11 +1,16 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -28,4 +33,21 @@ public interface ConfigProjectMapper extends BaseMapperX { .orderByDesc(ConfigProjectDO::getId)); } + /** + * 根据检测方法查询检测项目 + * @param configAssayMethodId + * @return + */ + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectJoinList(ConfigProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, on -> on.eq(ConfigAssayMethodProjectDO::getConfigAssayMethodId, ConfigProjectDO::getConfigAssayMethodId).eq(ConfigAssayMethodProjectDO::getDictionaryProjectId, ConfigProjectDO::getDictionaryProjectId)) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, ConfigProjectDO::getDictionaryProjectId) + .selectAll(ConfigProjectDO.class) + .selectAs(ConfigAssayMethodProjectDO::getId, ConfigProjectExtendRespVO::getConfigAssayMethodProjectId) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, ConfigProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, ConfigProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, ConfigProjectExtendRespVO::getDictionaryProjectSimpleName) + .selectAs(DictionaryProjectDO::getShowName, ConfigProjectExtendRespVO::getDictionaryProjectShowName) + .eq(ConfigProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java new file mode 100644 index 0000000..5a0fc14 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodMapper.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionarySampleTypeDO; +import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样与检测方法配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigQCSampleMethodMapper extends BaseMapperX { + + default PageResult selectPage(ConfigQCSampleMethodPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigQCSampleMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigQCSampleMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) + .eqIfPresent(ConfigQCSampleMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey()) + .eqIfPresent(ConfigQCSampleMethodDO::getCodeRule, reqVO.getCodeRule()) + .eqIfPresent(ConfigQCSampleMethodDO::getDefaultCount, reqVO.getDefaultCount()) + .eqIfPresent(ConfigQCSampleMethodDO::getTaskMinimumCount, reqVO.getTaskMinimumCount()) + .eqIfPresent(ConfigQCSampleMethodDO::getAssayMinimumCount, reqVO.getAssayMinimumCount()) + .eqIfPresent(ConfigQCSampleMethodDO::getIsCorrelation, reqVO.getIsCorrelation()) + .eqIfPresent(ConfigQCSampleMethodDO::getConfigInfomation, reqVO.getConfigInfomation()) + .eqIfPresent(ConfigQCSampleMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigQCSampleMethodDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigQCSampleMethodDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigQCSampleMethodDO::getId)); + } + + + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectJoinList(ConfigQCSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .selectAll(ConfigQCSampleMethodDO.class) + .selectAs(DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .eq(ConfigQCSampleMethodDO::getConfigAssayMethodId, configAssayMethodId) + .orderByAsc(ConfigQCSampleMethodDO::getSortNo)); + } + + + default List selectByConfigAssayMethodIds(List configAssayMethodIds) { + return selectJoinList(ConfigQCSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .selectAll(ConfigQCSampleMethodDO.class) + .selectAs(DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .in(ConfigQCSampleMethodDO::getConfigAssayMethodId, configAssayMethodIds) + .orderByAsc(ConfigQCSampleMethodDO::getSortNo)); + } + + default ConfigQCSampleMethodExtendRespVO selectByConfigAssayMethodIdAndDictionaryBusinessKey(Long configAssayMethodId, String dictionaryBusinessKey) { + return selectJoinOne(ConfigQCSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodDO::getDictionaryBusinessId) + .selectAll(ConfigQCSampleMethodDO.class) + .selectAs(DictionaryBusinessDO::getName, ConfigQCSampleMethodExtendRespVO::getDictionaryBusinessName) + .eq(ConfigQCSampleMethodDO::getConfigAssayMethodId, configAssayMethodId) + .eq(ConfigQCSampleMethodDO::getDictionaryBusinessKey, dictionaryBusinessKey)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java new file mode 100644 index 0000000..4917cc9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCSampleMethodParameterMapper.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控样检测方法参数配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigQCSampleMethodParameterMapper extends BaseMapperX { + + default PageResult selectPage(ConfigQCSampleMethodParameterPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, reqVO.getConfigQCSampleMethodId()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getDictionaryParameterId, reqVO.getDictionaryParameterId()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getDefaultValue, reqVO.getDefaultValue()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getIsNull, reqVO.getIsNull()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getFormula, reqVO.getFormula()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getIsShow, reqVO.getIsShow()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigQCSampleMethodParameterDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigQCSampleMethodParameterDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigQCSampleMethodParameterDO::getId)); + } + + default List selectByConfigQCSampleMethodId(Long configQCSampleMethodId) { + return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId) + .selectAll(ConfigQCSampleMethodParameterDO.class) + .selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey) + .selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName) + .selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo) + .selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId) + .selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit) + .eq(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodId)); + } + + default List selectByConfigQCSampleMethodIds(List configQCSampleMethodIds) { + return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId) + .selectAll(ConfigQCSampleMethodParameterDO.class) + .selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey) + .selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName) + .selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo) + .selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId) + .selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit) + .in(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodIds)); + } + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCStandardSampleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCStandardSampleMapper.java new file mode 100644 index 0000000..5a6bc59 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigQCStandardSampleMapper.java @@ -0,0 +1,30 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCStandardSampleDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 质控与定值样关系 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigQCStandardSampleMapper extends BaseMapperX { + + default PageResult selectPage(ConfigQCStandardSamplePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigQCStandardSampleDO::getConfigQCSampleMethodId, reqVO.getConfigQCSampleMethodId()) + .eqIfPresent(ConfigQCStandardSampleDO::getBusinessStandardSampleId, reqVO.getBusinessStandardSampleId()) + .eqIfPresent(ConfigQCStandardSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigQCStandardSampleDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigQCStandardSampleDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigQCStandardSampleDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java index abef7a6..9f585e6 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java @@ -1,11 +1,15 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -22,19 +26,48 @@ public interface ConfigReportFieldMapper extends BaseMapperX selectList(ConfigReportFieldReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ConfigReportFieldDO::getConfigReportTypeId, reqVO.getConfigReportTypeId()) + .eqIfPresent(ConfigReportFieldDO::getField, reqVO.getField()) + .likeIfPresent(ConfigReportFieldDO::getFieldName, reqVO.getFieldName()) + .eqIfPresent(ConfigReportFieldDO::getFieldType, reqVO.getFieldType()) + .eqIfPresent(ConfigReportFieldDO::getFieldWidth, reqVO.getFieldWidth()) + .eqIfPresent(ConfigReportFieldDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigReportFieldDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigReportFieldDO::getIsGroup, reqVO.getIsGroup()) + .eqIfPresent(ConfigReportFieldDO::getTitleGroup, reqVO.getTitleGroup()) + .betweenIfPresent(ConfigReportFieldDO::getIsUpdate, reqVO.getIsUpdate()) + .eqIfPresent(ConfigReportFieldDO::getFormula, reqVO.getFormula()) + .eqIfPresent(ConfigReportFieldDO::getNo, reqVO.getNo()) + .eqIfPresent(ConfigReportFieldDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigReportFieldDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigReportFieldDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigReportFieldDO::getVersion, reqVO.getVersion()) + .orderByAsc(ConfigReportFieldDO::getNo)); } + default List selectByConfigReportTypeIds(List configReportTypeIds, List fieldTypes) { + return selectList(new LambdaQueryWrapperX() + .inIfPresent(ConfigReportFieldDO::getConfigReportTypeId, configReportTypeIds) + .inIfPresent(ConfigReportFieldDO::getFieldType, fieldTypes) + .orderByAsc(ConfigReportFieldDO::getNo)); + + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTemplateMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTemplateMapper.java index d83f541..e71c44f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTemplateMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTemplateMapper.java @@ -5,10 +5,14 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplatePageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** - * 报表模版配置 Mapper + * 锐浪报表模版配置 Mapper * * @author 后台管理 */ @@ -30,4 +34,16 @@ public interface ConfigReportTemplateMapper extends BaseMapperX selectHistoryConfigReportTemplateByKey(String key) { + return selectList(new LambdaQueryWrapperX().eq(ConfigReportTemplateDO::getKey, key).eq(ConfigReportTemplateDO::getIsLast, QmsCommonConstant.NO).orderByDesc(ConfigReportTemplateDO::getVersion)); + } + + default ConfigReportTemplateDO selectLatestConfigReportTemplateByKey(String key) { + return selectOne(new LambdaQueryWrapperX() + .eq(ConfigReportTemplateDO::getKey, key).eq(ConfigReportTemplateDO::getIsLast, QmsCommonConstant.YES)); + } + + default List selectLatestConfigReportTemplateListByKeys(List keyList) { + return selectList(new LambdaQueryWrapperX().in(ConfigReportTemplateDO::getKey, keyList).eq(ConfigReportTemplateDO::getIsLast, QmsCommonConstant.YES)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTypeMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTypeMapper.java index 403436d..abfeba7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTypeMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportTypeMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypePageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTypeDO; import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java new file mode 100644 index 0000000..1815ae3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 规则配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigRuleMapper extends BaseMapperX { + + default PageResult selectPage(ConfigRulePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigRuleDO::getCode, reqVO.getCode()) + .likeIfPresent(ConfigRuleDO::getName, reqVO.getName()) + .eqIfPresent(ConfigRuleDO::getDescription, reqVO.getDescription()) + .eqIfPresent(ConfigRuleDO::getType, reqVO.getType()) + .eqIfPresent(ConfigRuleDO::getExpression, reqVO.getExpression()) + .eqIfPresent(ConfigRuleDO::getVersion, reqVO.getVersion()) + .eqIfPresent(ConfigRuleDO::getIsLast, reqVO.getIsLast()) + .eqIfPresent(ConfigRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigRuleDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigRuleDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigRuleDO::getId)); + } + + default ConfigRuleDO selectLatestConfigRuleByCode(String code) { + return selectOne(new LambdaQueryWrapperX() + .eq(ConfigRuleDO::getCode, code).eq(ConfigRuleDO::getIsLast, QmsCommonConstant.YES)); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleFlowMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleFlowMapper.java index dfe5659..0c687e4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleFlowMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleFlowMapper.java @@ -5,7 +5,10 @@ import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -27,12 +30,23 @@ public interface ConfigSampleFlowMapper extends BaseMapperX .eqIfPresent(ConfigSampleFlowDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(ConfigSampleFlowDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(ConfigSampleFlowDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigSampleFlowDO::getVersion, reqVO.getVersion()) + .eq(ConfigSampleFlowDO::getIsLast, QmsCommonConstant.YES) .orderByDesc(ConfigSampleFlowDO::getId)); } + + + default List selectHistoryConfigSampleByKey(String key) { + return selectList(new LambdaQueryWrapperX().eq(ConfigSampleFlowDO::getKey, key).eq(ConfigSampleFlowDO::getIsLast, QmsCommonConstant.NO).orderByDesc(ConfigSampleFlowDO::getVersion)); + } - default ConfigSampleFlowDO selectByKey(String key) { + default ConfigSampleFlowDO selectLatestConfigSampleByKey(String key) { return selectOne(new LambdaQueryWrapperX() - .eq(ConfigSampleFlowDO::getKey, key)); + .eq(ConfigSampleFlowDO::getKey, key).eq(ConfigSampleFlowDO::getIsLast, QmsCommonConstant.YES)); } + default List selectLatestConfigSampleFlowListByKeys(List keyList) { + return selectList(new LambdaQueryWrapperX().in(ConfigSampleFlowDO::getKey, keyList).eq(ConfigSampleFlowDO::getIsLast, QmsCommonConstant.YES)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleHandoverMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleHandoverMapper.java index 0c37857..970baca 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleHandoverMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleHandoverMapper.java @@ -1,16 +1,15 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleHandoverDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; /** - * 样品交接配置 Mapper + * 样品交接单配置 Mapper * * @author 后台管理 */ @@ -21,7 +20,7 @@ public interface ConfigSampleHandoverMapper extends BaseMapperX() .likeIfPresent(ConfigSampleHandoverDO::getName, reqVO.getName()) .eqIfPresent(ConfigSampleHandoverDO::getDictionarySampleFlowNodeKey, reqVO.getDictionarySampleFlowNodeKey()) - .eqIfPresent(ConfigSampleHandoverDO::getTemplateKey, reqVO.getTemplateKey()) + .eqIfPresent(ConfigSampleHandoverDO::getConfigReportTemplateKey, reqVO.getConfigReportTemplateKey()) .eqIfPresent(ConfigSampleHandoverDO::getCodeRule, reqVO.getCodeRule()) .eqIfPresent(ConfigSampleHandoverDO::getIsPrint, reqVO.getIsPrint()) .eqIfPresent(ConfigSampleHandoverDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java index d0abbc4..d38332e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java @@ -1,11 +1,15 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTypeDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -30,4 +34,21 @@ public interface ConfigSampleReportMapper extends BaseMapperX selectList(ConfigSampleReportReqVO reqVO) { + return selectJoinList(ConfigSampleReportExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigReportTypeDO.class, ConfigReportTypeDO::getId, ConfigSampleReportDO::getConfigReportTypeId) + .selectAll(ConfigSampleReportDO.class) + .selectAs(ConfigReportTypeDO::getId, ConfigSampleReportExtendRespVO::getConfigReportTypeId) + .selectAs(ConfigReportTypeDO::getKey, ConfigSampleReportExtendRespVO::getConfigReportTypeKey) + .selectAs(ConfigReportTypeDO::getName, ConfigSampleReportExtendRespVO::getConfigReportTypeName) + .eqIfPresent(ConfigSampleReportDO::getConfigReportTypeId, reqVO.getConfigReportTypeId()) + .eqIfPresent(ConfigSampleReportDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) + .likeIfPresent(ConfigSampleReportDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(ConfigSampleReportDO::getDataSource, reqVO.getDataSource()) + .eqIfPresent(ConfigSampleReportDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigSampleReportDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigSampleReportDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigSampleReportDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigSampleReportDO::getId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSimpleFlowRuleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSimpleFlowRuleMapper.java index d032a51..d0ffa17 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSimpleFlowRuleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSimpleFlowRuleMapper.java @@ -24,6 +24,8 @@ public interface ConfigSimpleFlowRuleMapper extends BaseMapperX { default PageResult selectPage(ConfigSubSamplePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigSubSampleDO::getBaseSampleId, reqVO.getBaseSampleId()) + .eqIfPresent(ConfigSubSampleDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) .eqIfPresent(ConfigSubSampleDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId()) .eqIfPresent(ConfigSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) .eqIfPresent(ConfigSubSampleDO::getFlowKey, reqVO.getFlowKey()) .eqIfPresent(ConfigSubSampleDO::getSimpleCodeRule, reqVO.getSimpleCodeRule()) .eqIfPresent(ConfigSubSampleDO::getCodeRule, reqVO.getCodeRule()) .eqIfPresent(ConfigSubSampleDO::getIsPrint, reqVO.getIsPrint()) - .eqIfPresent(ConfigSubSampleDO::getRecheckFlowCode, reqVO.getRecheckFlowCode()) + .eqIfPresent(ConfigSubSampleDO::getRecheckFlowNodeKey, reqVO.getRecheckFlowNodeKey()) .likeIfPresent(ConfigSubSampleDO::getSampleName, reqVO.getSampleName()) .eqIfPresent(ConfigSubSampleDO::getSampleSaveDay, reqVO.getSampleSaveDay()) .eqIfPresent(ConfigSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java index 10fffba..50cdda1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleMethodMapper.java @@ -1,12 +1,17 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -23,10 +28,30 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX selectByConfigSubSampleIdAndAssayDepartmentId(Long configSubSampleId, Long assayDepartmentId) { + return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleMethodDO::getConfigAssayMethodId) + .selectAll(ConfigSubSampleMethodDO.class) + .selectAs(ConfigAssayMethodDO::getName, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodName) + .selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode) + .eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId) + .eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId)); + } + + default ConfigSubSampleMethodDO selectByConfigSubSampleIdAndConfigAssayMethodId(Long configSubSampleId, Long configAssayMethodId) { + return selectOne(new LambdaQueryWrapper() + .eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId) + .eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java index d2382fb..128215f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; @@ -19,6 +18,7 @@ public interface ConfigSubSampleParentMapper extends BaseMapperX selectPage(ConfigSubSampleParentPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigSubSampleParentDO::getBaseSampleId, reqVO.getBaseSampleId()) .eqIfPresent(ConfigSubSampleParentDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) .eqIfPresent(ConfigSubSampleParentDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) .likeIfPresent(ConfigSubSampleParentDO::getSampleName, reqVO.getSampleName()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java new file mode 100644 index 0000000..d52beca --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSubSampleParentMethodMapper.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; +/** + * 分样与检测方法配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigSubSampleParentMethodMapper extends BaseMapperX { + + default PageResult selectPage(ConfigSubSampleParentMethodPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getCalculateMethod, reqVO.getCalculateMethod()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigSubSampleParentMethodDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigSubSampleParentMethodDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigSubSampleParentMethodDO::getId)); + } + + /** + * 根据分样id与分析方法id查询 + * @param configSubSampleParentId + * @param configAssayMethodId + * @return + */ + default ConfigSubSampleParentMethodDO selectByConfigSubSampleParentIdAndConfigAssayMethodId(Long configSubSampleParentId, Long configAssayMethodId) { + return selectOne(new LambdaQueryWrapperX() + .eq(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, configSubSampleParentId) + .eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigUserSignatureMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigUserSignatureMapper.java new file mode 100644 index 0000000..46e2cad --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigUserSignatureMapper.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 手写签名配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigUserSignatureMapper extends BaseMapperX { + + default PageResult selectPage(ConfigUserSignaturePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigUserSignatureDO::getUserId, reqVO.getUserId()) + .likeIfPresent(ConfigUserSignatureDO::getUserName, reqVO.getUserName()) + .eqIfPresent(ConfigUserSignatureDO::getFileId, reqVO.getFileId()) + .eqIfPresent(ConfigUserSignatureDO::getSignatureContent, reqVO.getSignatureContent()) + .eqIfPresent(ConfigUserSignatureDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(ConfigUserSignatureDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigUserSignatureDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigUserSignatureDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigUserSignatureDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationInfomationMapper.java deleted file mode 100644 index 766db58..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationInfomationMapper.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zt.plat.module.qms.business.config.dal.mapper; - -import java.util.*; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationInfomationDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.qms.business.config.controller.vo.*; - -/** - * 样品库位信息 Mapper - * - * @author 后台管理 - */ -@Mapper -public interface ConfigWarehouseLocationInfomationMapper extends BaseMapperX { - - default PageResult selectPage(ConfigWarehouseLocationInfomationPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(ConfigWarehouseLocationInfomationDO::getName, reqVO.getName()) - .eqIfPresent(ConfigWarehouseLocationInfomationDO::getCode, reqVO.getCode()) - .eqIfPresent(ConfigWarehouseLocationInfomationDO::getWarehouseCoding, reqVO.getWarehouseCoding()) - .eqIfPresent(ConfigWarehouseLocationInfomationDO::getCapacity, reqVO.getCapacity()) - .eqIfPresent(ConfigWarehouseLocationInfomationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) - .betweenIfPresent(ConfigWarehouseLocationInfomationDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(ConfigWarehouseLocationInfomationDO::getRemark, reqVO.getRemark()) - .orderByDesc(ConfigWarehouseLocationInfomationDO::getId)); - } - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java new file mode 100644 index 0000000..ef85e56 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigWarehouseLocationMapper.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 存放位置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigWarehouseLocationMapper extends BaseMapperX { + + default PageResult selectPage(ConfigWarehouseLocationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigWarehouseLocationDO::getWarehouseType, reqVO.getWarehouseType()) + .eqIfPresent(ConfigWarehouseLocationDO::getParentId, reqVO.getParentId()) + .likeIfPresent(ConfigWarehouseLocationDO::getName, reqVO.getName()) + .eqIfPresent(ConfigWarehouseLocationDO::getCode, reqVO.getCode()) + .eqIfPresent(ConfigWarehouseLocationDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigWarehouseLocationDO::getCapacity, reqVO.getCapacity()) + .eqIfPresent(ConfigWarehouseLocationDO::getMainDepartmentId, reqVO.getMainDepartmentId()) + .likeIfPresent(ConfigWarehouseLocationDO::getMainDepartmentName, reqVO.getMainDepartmentName()) + .eqIfPresent(ConfigWarehouseLocationDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigWarehouseLocationDO::getSortNo)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java new file mode 100644 index 0000000..8459454 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFConversionRateMapper.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光数据采集特殊检测项目转换率配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFConversionRateMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFConversionRatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFConversionRateDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(ConfigXRFConversionRateDO::getLineName, reqVO.getLineName()) + .likeIfPresent(ConfigXRFConversionRateDO::getXRFProjectName, reqVO.getXRFProjectName()) + .eqIfPresent(ConfigXRFConversionRateDO::getConversionRate, reqVO.getConversionRate()) + .eqIfPresent(ConfigXRFConversionRateDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFConversionRateDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFConversionRateDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFConversionRateDO::getId)); + } + + default ConfigXRFConversionRateDO selectBy(String deviceNo, String lineName, String projectName) { + return selectOne(new LambdaQueryWrapperX() + .eq(ConfigXRFConversionRateDO::getDeviceNo, deviceNo) + .eq(ConfigXRFConversionRateDO::getLineName, lineName) + .eq(ConfigXRFConversionRateDO::getXRFProjectName, projectName)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java new file mode 100644 index 0000000..cceaa29 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFLineMapper.java @@ -0,0 +1,49 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光分析线 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFLineMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFLinePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFLineDO::getDeviceNo, reqVO.getDeviceNo()) + .likeIfPresent(ConfigXRFLineDO::getLineName, reqVO.getLineName()) + .eqIfPresent(ConfigXRFLineDO::getIsUse, reqVO.getIsUse()) + .eqIfPresent(ConfigXRFLineDO::getConnectString, reqVO.getConnectString()) + .eqIfPresent(ConfigXRFLineDO::getDataSourceType, reqVO.getDataSourceType()) + .betweenIfPresent(ConfigXRFLineDO::getLastSynchronousDataTime, reqVO.getLastSynchronousDataTime()) + .betweenIfPresent(ConfigXRFLineDO::getLastCheckDataTime, reqVO.getLastCheckDataTime()) + .eqIfPresent(ConfigXRFLineDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFLineDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFLineDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFLineDO::getId)); + } + + default List selectByDeviceNo(String deviceNo) { + return selectList(new LambdaQueryWrapperX() + .eq(ConfigXRFLineDO::getDeviceNo, deviceNo) + .eq(ConfigXRFLineDO::getIsUse, QmsCommonConstant.YES)); + } + + default ConfigXRFLineDO selectByDeviceNoAndLineName(String deviceNo, String lineName) { + return selectOne(new LambdaQueryWrapperX() + .eq(ConfigXRFLineDO::getDeviceNo, deviceNo) + .eq(ConfigXRFLineDO::getLineName, lineName) + .eq(ConfigXRFLineDO::getIsUse, QmsCommonConstant.YES)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java new file mode 100644 index 0000000..36c2cf3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigXRFProjectMapper.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * 荧光采集检测项目配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ConfigXRFProjectMapper extends BaseMapperX { + + default PageResult selectPage(ConfigXRFProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ConfigXRFProjectDO::getDeviceNo, reqVO.getDeviceNo()) + .eqIfPresent(ConfigXRFProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .likeIfPresent(ConfigXRFProjectDO::getShowName, reqVO.getShowName()) + .likeIfPresent(ConfigXRFProjectDO::getXRFProjectName, reqVO.getXRFProjectName()) + .eqIfPresent(ConfigXRFProjectDO::getXRFProjectUnit, reqVO.getXRFProjectUnit()) + .eqIfPresent(ConfigXRFProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(ConfigXRFProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(ConfigXRFProjectDO::getConversionRate, reqVO.getConversionRate()) + .eqIfPresent(ConfigXRFProjectDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(ConfigXRFProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigXRFProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigXRFProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(ConfigXRFProjectDO::getId)); + } + + default List selectByDeviceNo(String deviceNo) { + return selectList(new LambdaQueryWrapperX() + .eq(ConfigXRFProjectDO::getDeviceNo, deviceNo)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardForecastProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardForecastProjectMapper.java new file mode 100644 index 0000000..75d910e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardForecastProjectMapper.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.business.config.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardForecastProjectPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardForecastProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料检测标准来样品位配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialAssayStandardForecastProjectMapper extends BaseMapperX { + + default PageResult selectPage(MaterialAssayStandardForecastProjectPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getMaterialAssayStandardId, reqVO.getMaterialAssayStandardId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectCode, reqVO.getDictionaryProjectCode()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnitId, reqVO.getUnitId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnit, reqVO.getUnit()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getIsDefault, reqVO.getIsDefault()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(MaterialAssayStandardForecastProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(MaterialAssayStandardForecastProjectDO::getId)); + } + + + default List selectList(MaterialAssayStandardForecastProjectReqVO reqVO) { + return selectJoinList(MaterialAssayStandardForecastProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, MaterialAssayStandardForecastProjectDO::getDictionaryProjectId) + .leftJoin(MaterialAssayStandardDO.class, MaterialAssayStandardDO::getId, MaterialAssayStandardForecastProjectDO::getMaterialAssayStandardId) + .selectAll(MaterialAssayStandardForecastProjectDO.class) + .selectAs(DictionaryProjectDO::getKey, MaterialAssayStandardForecastProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, MaterialAssayStandardForecastProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, MaterialAssayStandardForecastProjectExtendRespVO::getShowName) + .eqIfPresent(MaterialAssayStandardDO::getBaseSampleId, reqVO.getBaseSampleId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getMaterialAssayStandardId, reqVO.getMaterialAssayStandardId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDictionaryProjectCode, reqVO.getDictionaryProjectCode()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnitId, reqVO.getUnitId()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getUnit, reqVO.getUnit()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDataType, reqVO.getDataType()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getDecimalPosition, reqVO.getDecimalPosition()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getIsDefault, reqVO.getIsDefault()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(MaterialAssayStandardForecastProjectDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(MaterialAssayStandardForecastProjectDO::getRemark, reqVO.getRemark()) + .orderByDesc(MaterialAssayStandardForecastProjectDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMapper.java index 0fa5e4c..f75b1e4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.config.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardPageReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardExtendDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java index aab201a..8444c1e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/MaterialAssayStandardMethodMapper.java @@ -2,9 +2,14 @@ package com.zt.plat.module.qms.business.config.dal.mapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import org.apache.ibatis.annotations.Mapper; /** @@ -19,12 +24,30 @@ public interface MaterialAssayStandardMethodMapper extends BaseMapperX() .eqIfPresent(MaterialAssayStandardMethodDO::getMaterialAssayStandardDetailId, reqVO.getMaterialAssayStandardDetailId()) .eqIfPresent(MaterialAssayStandardMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) - .eqIfPresent(MaterialAssayStandardMethodDO::getIsDefault, reqVO.getIsDefault()) + .eqIfPresent(MaterialAssayStandardMethodDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(MaterialAssayStandardMethodDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) .eqIfPresent(MaterialAssayStandardMethodDO::getIsDualCup, reqVO.getIsDualCup()) + .eqIfPresent(MaterialAssayStandardMethodDO::getIsDefault, reqVO.getIsDefault()) + .eqIfPresent(MaterialAssayStandardMethodDO::getIsRecheckDefault, reqVO.getIsRecheckDefault()) .eqIfPresent(MaterialAssayStandardMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(MaterialAssayStandardMethodDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(MaterialAssayStandardMethodDO::getRemark, reqVO.getRemark()) .orderByDesc(MaterialAssayStandardMethodDO::getId)); } + + /** + * 根据样品大类id和检测项目id获取对应的默认检测方法 + * @param baseSampleId 样品大类id + * @param dictionaryProjectId 检测项目id + * @return + */ + default MaterialAssayStandardMethodDO selectByBaseSampleIdAndDictionaryProjectId(Long baseSampleId, Long dictionaryProjectId) { + return selectJoinOne(MaterialAssayStandardMethodDO.class, new MPJLambdaWrapperX() + .leftJoin(MaterialAssayStandardDetailDO.class, MaterialAssayStandardDetailDO::getId, MaterialAssayStandardMethodDO::getMaterialAssayStandardDetailId) + .leftJoin(MaterialAssayStandardDO.class, MaterialAssayStandardDO::getId, MaterialAssayStandardDetailDO::getMaterialAssayStandardId) + .eq(MaterialAssayStandardDO::getBaseSampleId, baseSampleId) + .eq(MaterialAssayStandardDetailDO::getDictionaryProjectId, dictionaryProjectId) + .eq(MaterialAssayStandardMethodDO::getIsDefault, QmsCommonConstant.YES)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentService.java new file mode 100644 index 0000000..e7bb76b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测方法分析项目判定 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigAssayMethodProjectAssessmentService { + + /** + * 创建检测方法分析项目判定 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigAssayMethodProjectAssessmentRespVO createConfigAssayMethodProjectAssessment(@Valid ConfigAssayMethodProjectAssessmentSaveReqVO createReqVO); + + /** + * 更新检测方法分析项目判定 + * + * @param updateReqVO 更新信息 + */ + void updateConfigAssayMethodProjectAssessment(@Valid ConfigAssayMethodProjectAssessmentSaveReqVO updateReqVO); + + /** + * 删除检测方法分析项目判定 + * + * @param id 编号 + */ + void deleteConfigAssayMethodProjectAssessment(Long id); + + /** + * 批量删除检测方法分析项目判定 + * + * @param ids 编号 + */ + void deleteConfigAssayMethodProjectAssessmentListByIds(List ids); + + /** + * 获得检测方法分析项目判定 + * + * @param id 编号 + * @return 检测方法分析项目判定 + */ + ConfigAssayMethodProjectAssessmentDO getConfigAssayMethodProjectAssessment(Long id); + + /** + * 获得检测方法分析项目判定分页 + * + * @param pageReqVO 分页查询 + * @return 检测方法分析项目判定分页 + */ + PageResult getConfigAssayMethodProjectAssessmentPage(ConfigAssayMethodProjectAssessmentPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentServiceImpl.java new file mode 100644 index 0000000..0b86211 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectAssessmentServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测方法分析项目判定 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigAssayMethodProjectAssessmentServiceImpl implements ConfigAssayMethodProjectAssessmentService { + + @Resource + private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper; + + @Override + public ConfigAssayMethodProjectAssessmentRespVO createConfigAssayMethodProjectAssessment(ConfigAssayMethodProjectAssessmentSaveReqVO createReqVO) { + // 插入 + ConfigAssayMethodProjectAssessmentDO configAssayMethodProjectAssessment = BeanUtils.toBean(createReqVO, ConfigAssayMethodProjectAssessmentDO.class); + configAssayMethodProjectAssessmentMapper.insert(configAssayMethodProjectAssessment); + // 返回 + return BeanUtils.toBean(configAssayMethodProjectAssessment, ConfigAssayMethodProjectAssessmentRespVO.class); + } + + @Override + public void updateConfigAssayMethodProjectAssessment(ConfigAssayMethodProjectAssessmentSaveReqVO updateReqVO) { + // 校验存在 + validateConfigAssayMethodProjectAssessmentExists(updateReqVO.getId()); + // 更新 + ConfigAssayMethodProjectAssessmentDO updateObj = BeanUtils.toBean(updateReqVO, ConfigAssayMethodProjectAssessmentDO.class); + configAssayMethodProjectAssessmentMapper.updateById(updateObj); + } + + @Override + public void deleteConfigAssayMethodProjectAssessment(Long id) { + // 校验存在 + validateConfigAssayMethodProjectAssessmentExists(id); + // 删除 + configAssayMethodProjectAssessmentMapper.deleteById(id); + } + + @Override + public void deleteConfigAssayMethodProjectAssessmentListByIds(List ids) { + // 校验存在 + validateConfigAssayMethodProjectAssessmentExists(ids); + // 删除 + configAssayMethodProjectAssessmentMapper.deleteByIds(ids); + } + + private void validateConfigAssayMethodProjectAssessmentExists(List ids) { + List list = configAssayMethodProjectAssessmentMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_ASSESSMENT_NOT_EXISTS); + } + } + + private void validateConfigAssayMethodProjectAssessmentExists(Long id) { + if (configAssayMethodProjectAssessmentMapper.selectById(id) == null) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_ASSESSMENT_NOT_EXISTS); + } + } + + @Override + public ConfigAssayMethodProjectAssessmentDO getConfigAssayMethodProjectAssessment(Long id) { + return configAssayMethodProjectAssessmentMapper.selectById(id); + } + + @Override + public PageResult getConfigAssayMethodProjectAssessmentPage(ConfigAssayMethodProjectAssessmentPageReqVO pageReqVO) { + return configAssayMethodProjectAssessmentMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientService.java new file mode 100644 index 0000000..09ce8f3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测方法分析项目补正系数 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigAssayMethodProjectCoefficientService { + + /** + * 创建检测方法分析项目补正系数 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigAssayMethodProjectCoefficientRespVO createConfigAssayMethodProjectCoefficient(@Valid ConfigAssayMethodProjectCoefficientSaveReqVO createReqVO); + + /** + * 更新检测方法分析项目补正系数 + * + * @param updateReqVO 更新信息 + */ + void updateConfigAssayMethodProjectCoefficient(@Valid ConfigAssayMethodProjectCoefficientSaveReqVO updateReqVO); + + /** + * 删除检测方法分析项目补正系数 + * + * @param id 编号 + */ + void deleteConfigAssayMethodProjectCoefficient(Long id); + + /** + * 批量删除检测方法分析项目补正系数 + * + * @param ids 编号 + */ + void deleteConfigAssayMethodProjectCoefficientListByIds(List ids); + + /** + * 获得检测方法分析项目补正系数 + * + * @param id 编号 + * @return 检测方法分析项目补正系数 + */ + ConfigAssayMethodProjectCoefficientDO getConfigAssayMethodProjectCoefficient(Long id); + + /** + * 获得检测方法分析项目补正系数分页 + * + * @param pageReqVO 分页查询 + * @return 检测方法分析项目补正系数分页 + */ + PageResult getConfigAssayMethodProjectCoefficientPage(ConfigAssayMethodProjectCoefficientPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientServiceImpl.java new file mode 100644 index 0000000..1c68247 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectCoefficientServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测方法分析项目补正系数 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigAssayMethodProjectCoefficientServiceImpl implements ConfigAssayMethodProjectCoefficientService { + + @Resource + private ConfigAssayMethodProjectCoefficientMapper configAssayMethodProjectCoefficientMapper; + + @Override + public ConfigAssayMethodProjectCoefficientRespVO createConfigAssayMethodProjectCoefficient(ConfigAssayMethodProjectCoefficientSaveReqVO createReqVO) { + // 插入 + ConfigAssayMethodProjectCoefficientDO configAssayMethodProjectCoefficient = BeanUtils.toBean(createReqVO, ConfigAssayMethodProjectCoefficientDO.class); + configAssayMethodProjectCoefficientMapper.insert(configAssayMethodProjectCoefficient); + // 返回 + return BeanUtils.toBean(configAssayMethodProjectCoefficient, ConfigAssayMethodProjectCoefficientRespVO.class); + } + + @Override + public void updateConfigAssayMethodProjectCoefficient(ConfigAssayMethodProjectCoefficientSaveReqVO updateReqVO) { + // 校验存在 + validateConfigAssayMethodProjectCoefficientExists(updateReqVO.getId()); + // 更新 + ConfigAssayMethodProjectCoefficientDO updateObj = BeanUtils.toBean(updateReqVO, ConfigAssayMethodProjectCoefficientDO.class); + configAssayMethodProjectCoefficientMapper.updateById(updateObj); + } + + @Override + public void deleteConfigAssayMethodProjectCoefficient(Long id) { + // 校验存在 + validateConfigAssayMethodProjectCoefficientExists(id); + // 删除 + configAssayMethodProjectCoefficientMapper.deleteById(id); + } + + @Override + public void deleteConfigAssayMethodProjectCoefficientListByIds(List ids) { + // 校验存在 + validateConfigAssayMethodProjectCoefficientExists(ids); + // 删除 + configAssayMethodProjectCoefficientMapper.deleteByIds(ids); + } + + private void validateConfigAssayMethodProjectCoefficientExists(List ids) { + List list = configAssayMethodProjectCoefficientMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_COEFFICIENT_NOT_EXISTS); + } + } + + private void validateConfigAssayMethodProjectCoefficientExists(Long id) { + if (configAssayMethodProjectCoefficientMapper.selectById(id) == null) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_COEFFICIENT_NOT_EXISTS); + } + } + + @Override + public ConfigAssayMethodProjectCoefficientDO getConfigAssayMethodProjectCoefficient(Long id) { + return configAssayMethodProjectCoefficientMapper.selectById(id); + } + + @Override + public PageResult getConfigAssayMethodProjectCoefficientPage(ConfigAssayMethodProjectCoefficientPageReqVO pageReqVO) { + return configAssayMethodProjectCoefficientMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterService.java index 11ea01a..a6146ed 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterServiceImpl.java index 4b1aaf6..b6353cd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectParameterServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeService.java new file mode 100644 index 0000000..c50a2b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 检测方法分析项目区间 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigAssayMethodProjectRangeService { + + /** + * 创建检测方法分析项目区间 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigAssayMethodProjectRangeRespVO createConfigAssayMethodProjectRange(@Valid ConfigAssayMethodProjectRangeSaveReqVO createReqVO); + + /** + * 更新检测方法分析项目区间 + * + * @param updateReqVO 更新信息 + */ + void updateConfigAssayMethodProjectRange(@Valid ConfigAssayMethodProjectRangeSaveReqVO updateReqVO); + + /** + * 删除检测方法分析项目区间 + * + * @param id 编号 + */ + void deleteConfigAssayMethodProjectRange(Long id); + + /** + * 批量删除检测方法分析项目区间 + * + * @param ids 编号 + */ + void deleteConfigAssayMethodProjectRangeListByIds(List ids); + + /** + * 获得检测方法分析项目区间 + * + * @param id 编号 + * @return 检测方法分析项目区间 + */ + ConfigAssayMethodProjectRangeDO getConfigAssayMethodProjectRange(Long id); + + /** + * 获得检测方法分析项目区间分页 + * + * @param pageReqVO 分页查询 + * @return 检测方法分析项目区间分页 + */ + PageResult getConfigAssayMethodProjectRangePage(ConfigAssayMethodProjectRangePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeServiceImpl.java new file mode 100644 index 0000000..824ea0a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectRangeServiceImpl.java @@ -0,0 +1,93 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRangeSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 检测方法分析项目区间 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigAssayMethodProjectRangeServiceImpl implements ConfigAssayMethodProjectRangeService { + + @Resource + private ConfigAssayMethodProjectRangeMapper configAssayMethodProjectRangeMapper; + + @Override + public ConfigAssayMethodProjectRangeRespVO createConfigAssayMethodProjectRange(ConfigAssayMethodProjectRangeSaveReqVO createReqVO) { + // 插入 + ConfigAssayMethodProjectRangeDO configAssayMethodProjectRange = BeanUtils.toBean(createReqVO, ConfigAssayMethodProjectRangeDO.class); + configAssayMethodProjectRangeMapper.insert(configAssayMethodProjectRange); + // 返回 + return BeanUtils.toBean(configAssayMethodProjectRange, ConfigAssayMethodProjectRangeRespVO.class); + } + + @Override + public void updateConfigAssayMethodProjectRange(ConfigAssayMethodProjectRangeSaveReqVO updateReqVO) { + // 校验存在 + validateConfigAssayMethodProjectRangeExists(updateReqVO.getId()); + // 更新 + ConfigAssayMethodProjectRangeDO updateObj = BeanUtils.toBean(updateReqVO, ConfigAssayMethodProjectRangeDO.class); + configAssayMethodProjectRangeMapper.updateById(updateObj); + } + + @Override + public void deleteConfigAssayMethodProjectRange(Long id) { + // 校验存在 + validateConfigAssayMethodProjectRangeExists(id); + // 删除 + configAssayMethodProjectRangeMapper.deleteById(id); + } + + @Override + public void deleteConfigAssayMethodProjectRangeListByIds(List ids) { + // 校验存在 + validateConfigAssayMethodProjectRangeExists(ids); + // 删除 + configAssayMethodProjectRangeMapper.deleteByIds(ids); + } + + private void validateConfigAssayMethodProjectRangeExists(List ids) { + List list = configAssayMethodProjectRangeMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_RANGE_NOT_EXISTS); + } + } + + private void validateConfigAssayMethodProjectRangeExists(Long id) { + if (configAssayMethodProjectRangeMapper.selectById(id) == null) { + throw exception(CONFIG_ASSAY_METHOD_PROJECT_RANGE_NOT_EXISTS); + } + } + + @Override + public ConfigAssayMethodProjectRangeDO getConfigAssayMethodProjectRange(Long id) { + return configAssayMethodProjectRangeMapper.selectById(id); + } + + @Override + public PageResult getConfigAssayMethodProjectRangePage(ConfigAssayMethodProjectRangePageReqVO pageReqVO) { + return configAssayMethodProjectRangeMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectService.java index bb516ee..895025b 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectServiceImpl.java index 58e2688..5067b68 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodProjectServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodService.java index 3c4a431..0d46bd4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodService.java @@ -1,6 +1,8 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.*; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodServiceImpl.java index 2fe6e2c..481cec9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigAssayMethodServiceImpl.java @@ -1,6 +1,7 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.*; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleService.java index ced9ff5..5c87888 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleServiceImpl.java index 7f2cf21..e5abd84 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigBaseSampleServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSampleSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceService.java index 6bac92e..855c00f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceService.java @@ -1,6 +1,11 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourcePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceServiceImpl.java index 39b38ca..8b90743 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigEntrustSourceServiceImpl.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourcePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigEntrustSourceSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import jakarta.validation.Valid; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java new file mode 100644 index 0000000..5507083 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionService.java @@ -0,0 +1,77 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 权限配置,通用权限配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigPermissionService { + + void savePermissionListWithAutoDelete(List list); + + void savePermission(List insertList, List updateList, List deleteList); + + void insertPermission(List insertList); + + void updatePermission(List updateList); + + void deletePermission(List deleteList); + + List getPermissionList(Long sourceId, String sourceType, String permissionType); + + + /** + * 创建权限配置,通用权限配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigPermissionRespVO createConfigPermission(@Valid ConfigPermissionSaveReqVO createReqVO); + + /** + * 更新权限配置,通用权限配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigPermission(@Valid ConfigPermissionSaveReqVO updateReqVO); + + /** + * 删除权限配置,通用权限配置 + * + * @param id 编号 + */ + void deleteConfigPermission(Long id); + + /** + * 批量删除权限配置,通用权限配置 + * + * @param ids 编号 + */ + void deleteConfigPermissionListByIds(List ids); + + /** + * 获得权限配置,通用权限配置 + * + * @param id 编号 + * @return 权限配置,通用权限配置 + */ + ConfigPermissionDO getConfigPermission(Long id); + + /** + * 获得权限配置,通用权限配置分页 + * + * @param pageReqVO 分页查询 + * @return 权限配置,通用权限配置分页 + */ + PageResult getConfigPermissionPage(ConfigPermissionPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java new file mode 100644 index 0000000..c935e80 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigPermissionServiceImpl.java @@ -0,0 +1,196 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigPermissionMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 权限配置,通用权限配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigPermissionServiceImpl implements ConfigPermissionService { + + @Resource + private ConfigPermissionMapper configPermissionMapper; + + + //保存权限配置,自动判断删除 + @Override + @Transactional(rollbackFor = Exception.class) + public void savePermissionListWithAutoDelete(List list) { + //检查数据,避免误处理:按sourceId、sourceType检查 + List sourceIdList = list.stream().map(ConfigPermissionSaveReqVO::getSourceId).distinct().toList(); + List sourceTypeList = list.stream().map(ConfigPermissionSaveReqVO::getSourceType).distinct().toList(); + List permissionTypeList = list.stream().map(ConfigPermissionSaveReqVO::getPermissionType).distinct().toList(); + if (sourceIdList.size() > 1 || sourceTypeList.size() > 1 || permissionTypeList.size() > 1) { + throw exception0(CONFIG_PERMISSION_DUPLICATE.getCode(), "权限保存失败,提交的权限数据存在不一致的情况,请刷新后重试,或联系管理员处理"); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + ConfigPermissionSaveReqVO queryDO = list.get(0); + queryWrapper.eq(ConfigPermissionDO::getSourceId, queryDO.getSourceId()) + .eq(ConfigPermissionDO::getSourceType, queryDO.getSourceType()); + if(!ObjectUtils.isEmpty(queryDO.getPermissionType())) + queryWrapper.eq(ConfigPermissionDO::getPermissionType, queryDO.getPermissionType()); + List oldList = configPermissionMapper.selectList(queryWrapper); + List insertList = new ArrayList<>(); + List updateList = new ArrayList<>(); + List deleteIdList = new ArrayList<>(); + for (ConfigPermissionSaveReqVO newObj : list) { + boolean exist = false; + for (ConfigPermissionDO old : oldList) { + if (old.getId().equals(newObj.getId())) { + exist = true; + if (!old.equals(newObj)) { + updateList.add(newObj); + } + break; + } + } + if (!exist) { + insertList.add(newObj); + } + } + for (ConfigPermissionDO old : oldList) { + boolean exist = false; + for (ConfigPermissionSaveReqVO newObj : list) { + if (old.getId().equals(newObj.getId())) { + exist = true; + break; + } + } + if (!exist) { + deleteIdList.add(old.getId()); + } + } + List list1 = new ArrayList<>(); + if(!insertList.isEmpty()){ + list1 = BeanUtils.toBean(insertList, ConfigPermissionDO.class); + configPermissionMapper.insertBatch(list1); + } + if(!updateList.isEmpty()){ + list1 = BeanUtils.toBean(updateList, ConfigPermissionDO.class); + configPermissionMapper.updateBatch(list1); + } + if(!deleteIdList.isEmpty()) + configPermissionMapper.deleteByIds(deleteIdList); + + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void savePermission(List insertList, List updateList, List deleteList) { + this.insertPermission(insertList); + this.updatePermission(updateList); + this.deletePermission(deleteList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPermission(List insertList) { + configPermissionMapper.insertBatch(insertList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePermission(List updateList) { + configPermissionMapper.updateBatch(updateList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deletePermission(List deleteList) { + configPermissionMapper.deleteByIds(deleteList); + } + + @Override + public List getPermissionList(Long sourceId, String sourceType, String permissionType) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ConfigPermissionDO::getSourceId, sourceId) + .eq(ConfigPermissionDO::getSourceType, sourceType); + if(!ObjectUtils.isEmpty(permissionType)) + queryWrapper.eq(ConfigPermissionDO::getPermissionType, permissionType); + return configPermissionMapper.selectList(queryWrapper); + } + + @Override + public ConfigPermissionRespVO createConfigPermission(ConfigPermissionSaveReqVO createReqVO) { + // 插入 + ConfigPermissionDO configPermission = BeanUtils.toBean(createReqVO, ConfigPermissionDO.class); + configPermissionMapper.insert(configPermission); + // 返回 + return BeanUtils.toBean(configPermission, ConfigPermissionRespVO.class); + } + + @Override + public void updateConfigPermission(ConfigPermissionSaveReqVO updateReqVO) { + // 校验存在 + validateConfigPermissionExists(updateReqVO.getId()); + // 更新 + ConfigPermissionDO updateObj = BeanUtils.toBean(updateReqVO, ConfigPermissionDO.class); + configPermissionMapper.updateById(updateObj); + } + + @Override + public void deleteConfigPermission(Long id) { + // 校验存在 + validateConfigPermissionExists(id); + // 删除 + configPermissionMapper.deleteById(id); + } + + @Override + public void deleteConfigPermissionListByIds(List ids) { + // 校验存在 + validateConfigPermissionExists(ids); + // 删除 + configPermissionMapper.deleteByIds(ids); + } + + private void validateConfigPermissionExists(List ids) { + List list = configPermissionMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_PERMISSION_NOT_EXISTS); + } + } + + private void validateConfigPermissionExists(Long id) { + if (configPermissionMapper.selectById(id) == null) { + throw exception(CONFIG_PERMISSION_NOT_EXISTS); + } + } + + @Override + public ConfigPermissionDO getConfigPermission(Long id) { + return configPermissionMapper.selectById(id); + } + + @Override + public PageResult getConfigPermissionPage(ConfigPermissionPageReqVO pageReqVO) { + return configPermissionMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectService.java index 423e775..760d1b3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigProjectDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectServiceImpl.java index 8819aba..bf4ad5d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigProjectServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterService.java new file mode 100644 index 0000000..49d1898 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样检测方法参数配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigQCSampleMethodParameterService { + + /** + * 创建质控样检测方法参数配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigQCSampleMethodParameterRespVO createConfigQCSampleMethodParameter(@Valid ConfigQCSampleMethodParameterSaveReqVO createReqVO); + + /** + * 更新质控样检测方法参数配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigQCSampleMethodParameter(@Valid ConfigQCSampleMethodParameterSaveReqVO updateReqVO); + + /** + * 删除质控样检测方法参数配置 + * + * @param id 编号 + */ + void deleteConfigQCSampleMethodParameter(Long id); + + /** + * 批量删除质控样检测方法参数配置 + * + * @param ids 编号 + */ + void deleteConfigQCSampleMethodParameterListByIds(List ids); + + /** + * 获得质控样检测方法参数配置 + * + * @param id 编号 + * @return 质控样检测方法参数配置 + */ + ConfigQCSampleMethodParameterDO getConfigQCSampleMethodParameter(Long id); + + /** + * 获得质控样检测方法参数配置分页 + * + * @param pageReqVO 分页查询 + * @return 质控样检测方法参数配置分页 + */ + PageResult getConfigQCSampleMethodParameterPage(ConfigQCSampleMethodParameterPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterServiceImpl.java new file mode 100644 index 0000000..e38ec63 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodParameterServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodParameterMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样检测方法参数配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigQCSampleMethodParameterServiceImpl implements ConfigQCSampleMethodParameterService { + + @Resource + private ConfigQCSampleMethodParameterMapper configQCSampleMethodParameterMapper; + + @Override + public ConfigQCSampleMethodParameterRespVO createConfigQCSampleMethodParameter(ConfigQCSampleMethodParameterSaveReqVO createReqVO) { + // 插入 + ConfigQCSampleMethodParameterDO configQCSampleMethodParameter = BeanUtils.toBean(createReqVO, ConfigQCSampleMethodParameterDO.class); + configQCSampleMethodParameterMapper.insert(configQCSampleMethodParameter); + // 返回 + return BeanUtils.toBean(configQCSampleMethodParameter, ConfigQCSampleMethodParameterRespVO.class); + } + + @Override + public void updateConfigQCSampleMethodParameter(ConfigQCSampleMethodParameterSaveReqVO updateReqVO) { + // 校验存在 + validateConfigQCSampleMethodParameterExists(updateReqVO.getId()); + // 更新 + ConfigQCSampleMethodParameterDO updateObj = BeanUtils.toBean(updateReqVO, ConfigQCSampleMethodParameterDO.class); + configQCSampleMethodParameterMapper.updateById(updateObj); + } + + @Override + public void deleteConfigQCSampleMethodParameter(Long id) { + // 校验存在 + validateConfigQCSampleMethodParameterExists(id); + // 删除 + configQCSampleMethodParameterMapper.deleteById(id); + } + + @Override + public void deleteConfigQCSampleMethodParameterListByIds(List ids) { + // 校验存在 + validateConfigQCSampleMethodParameterExists(ids); + // 删除 + configQCSampleMethodParameterMapper.deleteByIds(ids); + } + + private void validateConfigQCSampleMethodParameterExists(List ids) { + List list = configQCSampleMethodParameterMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_QC_SAMPLE_METHOD_PARAMETER_NOT_EXISTS); + } + } + + private void validateConfigQCSampleMethodParameterExists(Long id) { + if (configQCSampleMethodParameterMapper.selectById(id) == null) { + throw exception(CONFIG_QC_SAMPLE_METHOD_PARAMETER_NOT_EXISTS); + } + } + + @Override + public ConfigQCSampleMethodParameterDO getConfigQCSampleMethodParameter(Long id) { + return configQCSampleMethodParameterMapper.selectById(id); + } + + @Override + public PageResult getConfigQCSampleMethodParameterPage(ConfigQCSampleMethodParameterPageReqVO pageReqVO) { + return configQCSampleMethodParameterMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodService.java new file mode 100644 index 0000000..e87fbb4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控样与检测方法配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigQCSampleMethodService { + + /** + * 创建质控样与检测方法配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigQCSampleMethodRespVO createConfigQCSampleMethod(@Valid ConfigQCSampleMethodSaveReqVO createReqVO); + + /** + * 更新质控样与检测方法配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigQCSampleMethod(@Valid ConfigQCSampleMethodSaveReqVO updateReqVO); + + /** + * 删除质控样与检测方法配置 + * + * @param id 编号 + */ + void deleteConfigQCSampleMethod(Long id); + + /** + * 批量删除质控样与检测方法配置 + * + * @param ids 编号 + */ + void deleteConfigQCSampleMethodListByIds(List ids); + + /** + * 获得质控样与检测方法配置 + * + * @param id 编号 + * @return 质控样与检测方法配置 + */ + ConfigQCSampleMethodDO getConfigQCSampleMethod(Long id); + + /** + * 获得质控样与检测方法配置分页 + * + * @param pageReqVO 分页查询 + * @return 质控样与检测方法配置分页 + */ + PageResult getConfigQCSampleMethodPage(ConfigQCSampleMethodPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodServiceImpl.java new file mode 100644 index 0000000..34287f6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCSampleMethodServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控样与检测方法配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigQCSampleMethodServiceImpl implements ConfigQCSampleMethodService { + + @Resource + private ConfigQCSampleMethodMapper configQCSampleMethodMapper; + + @Override + public ConfigQCSampleMethodRespVO createConfigQCSampleMethod(ConfigQCSampleMethodSaveReqVO createReqVO) { + // 插入 + ConfigQCSampleMethodDO configQCSampleMethod = BeanUtils.toBean(createReqVO, ConfigQCSampleMethodDO.class); + configQCSampleMethodMapper.insert(configQCSampleMethod); + // 返回 + return BeanUtils.toBean(configQCSampleMethod, ConfigQCSampleMethodRespVO.class); + } + + @Override + public void updateConfigQCSampleMethod(ConfigQCSampleMethodSaveReqVO updateReqVO) { + // 校验存在 + validateConfigQCSampleMethodExists(updateReqVO.getId()); + // 更新 + ConfigQCSampleMethodDO updateObj = BeanUtils.toBean(updateReqVO, ConfigQCSampleMethodDO.class); + configQCSampleMethodMapper.updateById(updateObj); + } + + @Override + public void deleteConfigQCSampleMethod(Long id) { + // 校验存在 + validateConfigQCSampleMethodExists(id); + // 删除 + configQCSampleMethodMapper.deleteById(id); + } + + @Override + public void deleteConfigQCSampleMethodListByIds(List ids) { + // 校验存在 + validateConfigQCSampleMethodExists(ids); + // 删除 + configQCSampleMethodMapper.deleteByIds(ids); + } + + private void validateConfigQCSampleMethodExists(List ids) { + List list = configQCSampleMethodMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_QC_SAMPLE_METHOD_NOT_EXISTS); + } + } + + private void validateConfigQCSampleMethodExists(Long id) { + if (configQCSampleMethodMapper.selectById(id) == null) { + throw exception(CONFIG_QC_SAMPLE_METHOD_NOT_EXISTS); + } + } + + @Override + public ConfigQCSampleMethodDO getConfigQCSampleMethod(Long id) { + return configQCSampleMethodMapper.selectById(id); + } + + @Override + public PageResult getConfigQCSampleMethodPage(ConfigQCSampleMethodPageReqVO pageReqVO) { + return configQCSampleMethodMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleService.java new file mode 100644 index 0000000..aec1d20 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCStandardSampleDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 质控与定值样关系 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigQCStandardSampleService { + + /** + * 创建质控与定值样关系 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigQCStandardSampleRespVO createConfigQCStandardSample(@Valid ConfigQCStandardSampleSaveReqVO createReqVO); + + /** + * 更新质控与定值样关系 + * + * @param updateReqVO 更新信息 + */ + void updateConfigQCStandardSample(@Valid ConfigQCStandardSampleSaveReqVO updateReqVO); + + /** + * 删除质控与定值样关系 + * + * @param id 编号 + */ + void deleteConfigQCStandardSample(Long id); + + /** + * 批量删除质控与定值样关系 + * + * @param ids 编号 + */ + void deleteConfigQCStandardSampleListByIds(List ids); + + /** + * 获得质控与定值样关系 + * + * @param id 编号 + * @return 质控与定值样关系 + */ + ConfigQCStandardSampleDO getConfigQCStandardSample(Long id); + + /** + * 获得质控与定值样关系分页 + * + * @param pageReqVO 分页查询 + * @return 质控与定值样关系分页 + */ + PageResult getConfigQCStandardSamplePage(ConfigQCStandardSamplePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleServiceImpl.java new file mode 100644 index 0000000..c68f536 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigQCStandardSampleServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCStandardSampleDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCStandardSampleMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 质控与定值样关系 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigQCStandardSampleServiceImpl implements ConfigQCStandardSampleService { + + @Resource + private ConfigQCStandardSampleMapper configQCStandardSampleMapper; + + @Override + public ConfigQCStandardSampleRespVO createConfigQCStandardSample(ConfigQCStandardSampleSaveReqVO createReqVO) { + // 插入 + ConfigQCStandardSampleDO configQCStandardSample = BeanUtils.toBean(createReqVO, ConfigQCStandardSampleDO.class); + configQCStandardSampleMapper.insert(configQCStandardSample); + // 返回 + return BeanUtils.toBean(configQCStandardSample, ConfigQCStandardSampleRespVO.class); + } + + @Override + public void updateConfigQCStandardSample(ConfigQCStandardSampleSaveReqVO updateReqVO) { + // 校验存在 + validateConfigQCStandardSampleExists(updateReqVO.getId()); + // 更新 + ConfigQCStandardSampleDO updateObj = BeanUtils.toBean(updateReqVO, ConfigQCStandardSampleDO.class); + configQCStandardSampleMapper.updateById(updateObj); + } + + @Override + public void deleteConfigQCStandardSample(Long id) { + // 校验存在 + validateConfigQCStandardSampleExists(id); + // 删除 + configQCStandardSampleMapper.deleteById(id); + } + + @Override + public void deleteConfigQCStandardSampleListByIds(List ids) { + // 校验存在 + validateConfigQCStandardSampleExists(ids); + // 删除 + configQCStandardSampleMapper.deleteByIds(ids); + } + + private void validateConfigQCStandardSampleExists(List ids) { + List list = configQCStandardSampleMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_QC_STANDARD_SAMPLE_NOT_EXISTS); + } + } + + private void validateConfigQCStandardSampleExists(Long id) { + if (configQCStandardSampleMapper.selectById(id) == null) { + throw exception(CONFIG_QC_STANDARD_SAMPLE_NOT_EXISTS); + } + } + + @Override + public ConfigQCStandardSampleDO getConfigQCStandardSample(Long id) { + return configQCStandardSampleMapper.selectById(id); + } + + @Override + public PageResult getConfigQCStandardSamplePage(ConfigQCStandardSamplePageReqVO pageReqVO) { + return configQCStandardSampleMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldService.java index df0de2d..d159add 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldServiceImpl.java index 4c7e658..49cb106 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportFieldServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTemplateServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTemplateServiceImpl.java index 6ac4e9f..872bf08 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTemplateServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTemplateServiceImpl.java @@ -17,9 +17,10 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTemplateMapper; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.framework.gridreport.GridReport; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; /** @@ -39,9 +40,10 @@ public class ConfigReportTemplateServiceImpl implements ConfigReportTemplateServ // 插入 ConfigReportTemplateDO configReportTemplate = BeanUtils.toBean(createReqVO, ConfigReportTemplateDO.class); String content = configReportTemplate.getContent(); - if (content.startsWith("_WR_")) { + if (content.startsWith(GridReport.WR_PREFIX)) { configReportTemplate.setIsAuthority(1); } + configReportTemplate.setIsLast(QmsCommonConstant.YES); configReportTemplateMapper.insert(configReportTemplate); // 返回 @@ -55,7 +57,7 @@ public class ConfigReportTemplateServiceImpl implements ConfigReportTemplateServ // 更新 ConfigReportTemplateDO updateObj = BeanUtils.toBean(updateReqVO, ConfigReportTemplateDO.class); String content = updateObj.getContent(); - if (content.startsWith("_WR_")) { + if (content.startsWith(GridReport.WR_PREFIX)) { updateObj.setIsAuthority(1); } configReportTemplateMapper.updateById(updateObj); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeService.java index bed9db8..adca246 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTypeDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeServiceImpl.java index ac5f174..858e097 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigReportTypeServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTypeSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleService.java new file mode 100644 index 0000000..d63f088 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 规则配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigRuleService { + + /** + * 创建规则配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigRuleRespVO createConfigRule(@Valid ConfigRuleSaveReqVO createReqVO); + + /** + * 更新规则配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigRule(@Valid ConfigRuleSaveReqVO updateReqVO); + + /** + * 删除规则配置 + * + * @param id 编号 + */ + void deleteConfigRule(Long id); + + /** + * 批量删除规则配置 + * + * @param ids 编号 + */ + void deleteConfigRuleListByIds(List ids); + + /** + * 获得规则配置 + * + * @param id 编号 + * @return 规则配置 + */ + ConfigRuleDO getConfigRule(Long id); + + /** + * 获得规则配置分页 + * + * @param pageReqVO 分页查询 + * @return 规则配置分页 + */ + PageResult getConfigRulePage(ConfigRulePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleServiceImpl.java new file mode 100644 index 0000000..30c5740 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigRuleServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigRuleMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 规则配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigRuleServiceImpl implements ConfigRuleService { + + @Resource + private ConfigRuleMapper configRuleMapper; + + @Override + public ConfigRuleRespVO createConfigRule(ConfigRuleSaveReqVO createReqVO) { + // 插入 + ConfigRuleDO configRule = BeanUtils.toBean(createReqVO, ConfigRuleDO.class); + configRuleMapper.insert(configRule); + // 返回 + return BeanUtils.toBean(configRule, ConfigRuleRespVO.class); + } + + @Override + public void updateConfigRule(ConfigRuleSaveReqVO updateReqVO) { + // 校验存在 + validateConfigRuleExists(updateReqVO.getId()); + // 更新 + ConfigRuleDO updateObj = BeanUtils.toBean(updateReqVO, ConfigRuleDO.class); + configRuleMapper.updateById(updateObj); + } + + @Override + public void deleteConfigRule(Long id) { + // 校验存在 + validateConfigRuleExists(id); + // 删除 + configRuleMapper.deleteById(id); + } + + @Override + public void deleteConfigRuleListByIds(List ids) { + // 校验存在 + validateConfigRuleExists(ids); + // 删除 + configRuleMapper.deleteByIds(ids); + } + + private void validateConfigRuleExists(List ids) { + List list = configRuleMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_RULE_NOT_EXISTS); + } + } + + private void validateConfigRuleExists(Long id) { + if (configRuleMapper.selectById(id) == null) { + throw exception(CONFIG_RULE_NOT_EXISTS); + } + } + + @Override + public ConfigRuleDO getConfigRule(Long id) { + return configRuleMapper.selectById(id); + } + + @Override + public PageResult getConfigRulePage(ConfigRulePageReqVO pageReqVO) { + return configRuleMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowService.java index f84fd60..ad578c7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; @@ -58,7 +62,26 @@ public interface ConfigSampleFlowService { * @return 样品流程配置分页 */ PageResult getConfigSampleFlowPage(ConfigSampleFlowPageReqVO pageReqVO); + + /** + * 根据key获取历史版本 + * @param key + * @return + */ + List getHistoryConfigSampleFlowByKey(String key); - ConfigSampleFlowDO getConfigSampleFlowByKey(String key); + /** + * 根据key获取最大的样品流程配置 + * @param key + * @return + */ + ConfigSampleFlowDO getLatestConfigSampleFlowByKey(String key); + + /** + * 根据key列表查询版本最大的样品流程配置列表 + * @param keyList + * @return + */ + List getLatestConfigSampleFlowListByKeys(List keyList); } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowServiceImpl.java index bd2ef84..b750c76 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleFlowServiceImpl.java @@ -1,16 +1,16 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleFlowSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; - import java.util.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; @@ -90,8 +90,18 @@ public class ConfigSampleFlowServiceImpl implements ConfigSampleFlowService { } @Override - public ConfigSampleFlowDO getConfigSampleFlowByKey(String key) { - return configSampleFlowMapper.selectByKey(key); + public List getHistoryConfigSampleFlowByKey(String key) { + return configSampleFlowMapper.selectHistoryConfigSampleByKey(key); + } + + @Override + public ConfigSampleFlowDO getLatestConfigSampleFlowByKey(String key) { + return configSampleFlowMapper.selectLatestConfigSampleByKey(key); + } + + @Override + public List getLatestConfigSampleFlowListByKeys(List keyList) { + return configSampleFlowMapper.selectLatestConfigSampleFlowListByKeys(keyList); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverService.java index 79b006a..1959944 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverSaveReqVO; import jakarta.validation.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.business.config.controller.vo.*; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverServiceImpl.java index 73d7bf3..1d1ad08 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleHandoverServiceImpl.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleHandoverSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportService.java index 8a5b7cd..268c183 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportServiceImpl.java index 9e90136..74a47de 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSampleReportServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowCodeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowCodeServiceImpl.java index 9f3ee44..db6eeb0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowCodeServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowCodeServiceImpl.java @@ -7,8 +7,6 @@ import org.springframework.validation.annotation.Validated; import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import org.springframework.transaction.annotation.Transactional; - import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageParam; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowRuleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowRuleServiceImpl.java index 3596c96..cd58304 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowRuleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSimpleFlowRuleServiceImpl.java @@ -7,8 +7,6 @@ import org.springframework.validation.annotation.Validated; import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import org.springframework.transaction.annotation.Transactional; - import java.util.*; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageParam; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectService.java index 141a327..ede53b8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigStandardSampleProjectDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectServiceImpl.java index 44b7818..2e6205d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleProjectServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleProjectSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeService.java index 208da38..ddfaf00 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigStandardSampleTypeDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeServiceImpl.java index ccba8cd..2bfbee1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigStandardSampleTypeServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypeSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java index 2a69e9d..720559d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java index 83da650..38c6d3c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleMethodServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodService.java new file mode 100644 index 0000000..3665e7c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodService.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 分样与检测方法配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigSubSampleParentMethodService { + + /** + * 创建分样与检测方法配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigSubSampleParentMethodRespVO createConfigSubSampleParentMethod(@Valid ConfigSubSampleParentMethodSaveReqVO createReqVO); + + /** + * 更新分样与检测方法配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigSubSampleParentMethod(@Valid ConfigSubSampleParentMethodSaveReqVO updateReqVO); + + /** + * 删除分样与检测方法配置 + * + * @param id 编号 + */ + void deleteConfigSubSampleParentMethod(Long id); + + /** + * 批量删除分样与检测方法配置 + * + * @param ids 编号 + */ + void deleteConfigSubSampleParentMethodListByIds(List ids); + + /** + * 获得分样与检测方法配置 + * + * @param id 编号 + * @return 分样与检测方法配置 + */ + ConfigSubSampleParentMethodDO getConfigSubSampleParentMethod(Long id); + + /** + * 获得分样与检测方法配置分页 + * + * @param pageReqVO 分页查询 + * @return 分样与检测方法配置分页 + */ + PageResult getConfigSubSampleParentMethodPage(ConfigSubSampleParentMethodPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodServiceImpl.java new file mode 100644 index 0000000..a4d55f1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentMethodServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMethodMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 分样与检测方法配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigSubSampleParentMethodServiceImpl implements ConfigSubSampleParentMethodService { + + @Resource + private ConfigSubSampleParentMethodMapper configSubSampleParentMethodMapper; + + @Override + public ConfigSubSampleParentMethodRespVO createConfigSubSampleParentMethod(ConfigSubSampleParentMethodSaveReqVO createReqVO) { + // 插入 + ConfigSubSampleParentMethodDO configSubSampleParentMethod = BeanUtils.toBean(createReqVO, ConfigSubSampleParentMethodDO.class); + configSubSampleParentMethodMapper.insert(configSubSampleParentMethod); + // 返回 + return BeanUtils.toBean(configSubSampleParentMethod, ConfigSubSampleParentMethodRespVO.class); + } + + @Override + public void updateConfigSubSampleParentMethod(ConfigSubSampleParentMethodSaveReqVO updateReqVO) { + // 校验存在 + validateConfigSubSampleParentMethodExists(updateReqVO.getId()); + // 更新 + ConfigSubSampleParentMethodDO updateObj = BeanUtils.toBean(updateReqVO, ConfigSubSampleParentMethodDO.class); + configSubSampleParentMethodMapper.updateById(updateObj); + } + + @Override + public void deleteConfigSubSampleParentMethod(Long id) { + // 校验存在 + validateConfigSubSampleParentMethodExists(id); + // 删除 + configSubSampleParentMethodMapper.deleteById(id); + } + + @Override + public void deleteConfigSubSampleParentMethodListByIds(List ids) { + // 校验存在 + validateConfigSubSampleParentMethodExists(ids); + // 删除 + configSubSampleParentMethodMapper.deleteByIds(ids); + } + + private void validateConfigSubSampleParentMethodExists(List ids) { + List list = configSubSampleParentMethodMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS); + } + } + + private void validateConfigSubSampleParentMethodExists(Long id) { + if (configSubSampleParentMethodMapper.selectById(id) == null) { + throw exception(CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS); + } + } + + @Override + public ConfigSubSampleParentMethodDO getConfigSubSampleParentMethod(Long id) { + return configSubSampleParentMethodMapper.selectById(id); + } + + @Override + public PageResult getConfigSubSampleParentMethodPage(ConfigSubSampleParentMethodPageReqVO pageReqVO) { + return configSubSampleParentMethodMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentService.java index 00ad44c..4985ead 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentServiceImpl.java index 4566af3..ea47e5a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleParentServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleService.java index c75274c..35c2283 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleService.java @@ -1,6 +1,10 @@ package com.zt.plat.module.qms.business.config.service; import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleSaveReqVO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.controller.vo.*; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleServiceImpl.java index 2fac1b4..294d287 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigSubSampleServiceImpl.java @@ -1,6 +1,9 @@ package com.zt.plat.module.qms.business.config.service; import cn.hutool.core.collection.CollUtil; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleSaveReqVO; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureService.java new file mode 100644 index 0000000..6fa9b90 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureService.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 手写签名配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigUserSignatureService { + + ConfigUserSignatureDO getByUserId(Long userId); + List getByIdList(List ids); + + /** + * 创建手写签名配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigUserSignatureRespVO createConfigUserSignature(@Valid ConfigUserSignatureSaveReqVO createReqVO); + + /** + * 更新手写签名配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigUserSignature(@Valid ConfigUserSignatureSaveReqVO updateReqVO); + + /** + * 删除手写签名配置 + * + * @param id 编号 + */ + void deleteConfigUserSignature(Long id); + + /** + * 批量删除手写签名配置 + * + * @param ids 编号 + */ + void deleteConfigUserSignatureListByIds(List ids); + + /** + * 获得手写签名配置 + * + * @param id 编号 + * @return 手写签名配置 + */ + ConfigUserSignatureDO getConfigUserSignature(Long id); + + /** + * 获得手写签名配置分页 + * + * @param pageReqVO 分页查询 + * @return 手写签名配置分页 + */ + PageResult getConfigUserSignaturePage(ConfigUserSignaturePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureServiceImpl.java new file mode 100644 index 0000000..b8eb700 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigUserSignatureServiceImpl.java @@ -0,0 +1,110 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignaturePageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigUserSignatureSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigUserSignatureMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_USER_SIGNATURE_NOT_EXISTS; + +/** + * 手写签名配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigUserSignatureServiceImpl implements ConfigUserSignatureService { + + @Resource + private ConfigUserSignatureMapper configUserSignatureMapper; + + @Override + public ConfigUserSignatureDO getByUserId(Long userId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ConfigUserSignatureDO::getUserId, userId) + .eq(ConfigUserSignatureDO::getCancelFlag, 0); + query.orderByDesc(ConfigUserSignatureDO::getUpdateTime); + List list = configUserSignatureMapper.selectList(query); + return CollUtil.isEmpty(list) ? null : list.get(0); + } + + @Override + public List getByIdList(List ids) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.in(ConfigUserSignatureDO::getId, ids); + return configUserSignatureMapper.selectList(query); + } + + @Override + public ConfigUserSignatureRespVO createConfigUserSignature(ConfigUserSignatureSaveReqVO createReqVO) { + // 插入 + ConfigUserSignatureDO configUserSignature = BeanUtils.toBean(createReqVO, ConfigUserSignatureDO.class); + configUserSignatureMapper.insert(configUserSignature); + // 返回 + return BeanUtils.toBean(configUserSignature, ConfigUserSignatureRespVO.class); + } + + @Override + public void updateConfigUserSignature(ConfigUserSignatureSaveReqVO updateReqVO) { + // 校验存在 + validateConfigUserSignatureExists(updateReqVO.getId()); + // 更新 + ConfigUserSignatureDO updateObj = BeanUtils.toBean(updateReqVO, ConfigUserSignatureDO.class); + configUserSignatureMapper.updateById(updateObj); + } + + @Override + public void deleteConfigUserSignature(Long id) { + // 校验存在 + validateConfigUserSignatureExists(id); + // 删除 + configUserSignatureMapper.deleteById(id); + } + + @Override + public void deleteConfigUserSignatureListByIds(List ids) { + // 校验存在 + validateConfigUserSignatureExists(ids); + // 删除 + configUserSignatureMapper.deleteByIds(ids); + } + + private void validateConfigUserSignatureExists(List ids) { + List list = configUserSignatureMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_USER_SIGNATURE_NOT_EXISTS); + } + } + + private void validateConfigUserSignatureExists(Long id) { + if (configUserSignatureMapper.selectById(id) == null) { + throw exception(CONFIG_USER_SIGNATURE_NOT_EXISTS); + } + } + + @Override + public ConfigUserSignatureDO getConfigUserSignature(Long id) { + return configUserSignatureMapper.selectById(id); + } + + @Override + public PageResult getConfigUserSignaturePage(ConfigUserSignaturePageReqVO pageReqVO) { + return configUserSignatureMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationService.java deleted file mode 100644 index cad2dce..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.zt.plat.module.qms.business.config.service; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.qms.business.config.controller.vo.*; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationInfomationDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.PageParam; - -/** - * 样品库位信息 Service 接口 - * - * @author 后台管理 - */ -public interface ConfigWarehouseLocationInfomationService { - - /** - * 创建样品库位信息 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - ConfigWarehouseLocationInfomationRespVO createConfigWarehouseLocationInfomation(@Valid ConfigWarehouseLocationInfomationSaveReqVO createReqVO); - - /** - * 更新样品库位信息 - * - * @param updateReqVO 更新信息 - */ - void updateConfigWarehouseLocationInfomation(@Valid ConfigWarehouseLocationInfomationSaveReqVO updateReqVO); - - /** - * 删除样品库位信息 - * - * @param id 编号 - */ - void deleteConfigWarehouseLocationInfomation(Long id); - - /** - * 批量删除样品库位信息 - * - * @param ids 编号 - */ - void deleteConfigWarehouseLocationInfomationListByIds(List ids); - - /** - * 获得样品库位信息 - * - * @param id 编号 - * @return 样品库位信息 - */ - ConfigWarehouseLocationInfomationDO getConfigWarehouseLocationInfomation(Long id); - - /** - * 获得样品库位信息分页 - * - * @param pageReqVO 分页查询 - * @return 样品库位信息分页 - */ - PageResult getConfigWarehouseLocationInfomationPage(ConfigWarehouseLocationInfomationPageReqVO pageReqVO); - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationServiceImpl.java deleted file mode 100644 index 37ee5be..0000000 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationInfomationServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.zt.plat.module.qms.business.config.service; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import com.zt.plat.module.qms.business.config.controller.vo.*; -import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationInfomationDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; - -import com.zt.plat.module.qms.business.config.dal.mapper.ConfigWarehouseLocationInfomationMapper; - -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; -import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_WAREHOUSE_LOCATION_INFOMATION_NOT_EXISTS; - -/** - * 样品库位信息 Service 实现类 - * - * @author 后台管理 - */ -@Service -@Validated -public class ConfigWarehouseLocationInfomationServiceImpl implements ConfigWarehouseLocationInfomationService { - - @Resource - private ConfigWarehouseLocationInfomationMapper configWarehouseLocationInfomationMapper; - - @Override - public ConfigWarehouseLocationInfomationRespVO createConfigWarehouseLocationInfomation(ConfigWarehouseLocationInfomationSaveReqVO createReqVO) { - // 插入 - ConfigWarehouseLocationInfomationDO configWarehouseLocationInfomation = BeanUtils.toBean(createReqVO, ConfigWarehouseLocationInfomationDO.class); - configWarehouseLocationInfomationMapper.insert(configWarehouseLocationInfomation); - // 返回 - return BeanUtils.toBean(configWarehouseLocationInfomation, ConfigWarehouseLocationInfomationRespVO.class); - } - - @Override - public void updateConfigWarehouseLocationInfomation(ConfigWarehouseLocationInfomationSaveReqVO updateReqVO) { - // 校验存在 - validateConfigWarehouseLocationInfomationExists(updateReqVO.getId()); - // 更新 - ConfigWarehouseLocationInfomationDO updateObj = BeanUtils.toBean(updateReqVO, ConfigWarehouseLocationInfomationDO.class); - configWarehouseLocationInfomationMapper.updateById(updateObj); - } - - @Override - public void deleteConfigWarehouseLocationInfomation(Long id) { - // 校验存在 - validateConfigWarehouseLocationInfomationExists(id); - // 删除 - configWarehouseLocationInfomationMapper.deleteById(id); - } - - @Override - public void deleteConfigWarehouseLocationInfomationListByIds(List ids) { - // 校验存在 - validateConfigWarehouseLocationInfomationExists(ids); - // 删除 - configWarehouseLocationInfomationMapper.deleteByIds(ids); - } - - private void validateConfigWarehouseLocationInfomationExists(List ids) { - List list = configWarehouseLocationInfomationMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(CONFIG_WAREHOUSE_LOCATION_INFOMATION_NOT_EXISTS); - } - } - - private void validateConfigWarehouseLocationInfomationExists(Long id) { - if (configWarehouseLocationInfomationMapper.selectById(id) == null) { - throw exception(CONFIG_WAREHOUSE_LOCATION_INFOMATION_NOT_EXISTS); - } - } - - @Override - public ConfigWarehouseLocationInfomationDO getConfigWarehouseLocationInfomation(Long id) { - return configWarehouseLocationInfomationMapper.selectById(id); - } - - @Override - public PageResult getConfigWarehouseLocationInfomationPage(ConfigWarehouseLocationInfomationPageReqVO pageReqVO) { - return configWarehouseLocationInfomationMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java new file mode 100644 index 0000000..71f440a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationService.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 存放位置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigWarehouseLocationService { + + ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType); + + /** + * 创建存放位置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigWarehouseLocationRespVO createConfigWarehouseLocation(@Valid ConfigWarehouseLocationSaveReqVO createReqVO); + + /** + * 更新存放位置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigWarehouseLocation(@Valid ConfigWarehouseLocationSaveReqVO updateReqVO); + + /** + * 删除存放位置 + * + * @param id 编号 + */ + void deleteConfigWarehouseLocation(Long id); + + /** + * 批量删除存放位置 + * + * @param ids 编号 + */ + void deleteConfigWarehouseLocationListByIds(List ids); + + /** + * 获得存放位置 + * + * @param id 编号 + * @return 存放位置 + */ + ConfigWarehouseLocationDO getConfigWarehouseLocation(Long id); + + /** + * 获得存放位置分页 + * + * @param pageReqVO 分页查询 + * @return 存放位置分页 + */ + PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java new file mode 100644 index 0000000..e8f1d90 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigWarehouseLocationServiceImpl.java @@ -0,0 +1,111 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; +import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigWarehouseLocationMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 存放位置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocationService { + + + + @Resource + private ConfigWarehouseLocationMapper configWarehouseLocationMapper; + + @Override + public ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ConfigWarehouseLocationDO::getCode, code); + query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType); + query.eq(ConfigWarehouseLocationDO::getDataType, QmsWarehouseLocationConstant.DATA_TYPE_LOCATION); +// query.last("limit 1"); + List list = configWarehouseLocationMapper.selectList(query); + if(list.size() > 1) + throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE); + if(list.isEmpty()) + return null; + return list.get(0); + } + + @Override + public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO createReqVO) { + // 插入 + ConfigWarehouseLocationDO configWarehouseLocation = BeanUtils.toBean(createReqVO, ConfigWarehouseLocationDO.class); + configWarehouseLocationMapper.insert(configWarehouseLocation); + // 返回 + return BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class); + } + + @Override + public void updateConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO updateReqVO) { + // 校验存在 + validateConfigWarehouseLocationExists(updateReqVO.getId()); + // 更新 + ConfigWarehouseLocationDO updateObj = BeanUtils.toBean(updateReqVO, ConfigWarehouseLocationDO.class); + configWarehouseLocationMapper.updateById(updateObj); + } + + @Override + public void deleteConfigWarehouseLocation(Long id) { + // 校验存在 + validateConfigWarehouseLocationExists(id); + // 删除 + configWarehouseLocationMapper.deleteById(id); + } + + @Override + public void deleteConfigWarehouseLocationListByIds(List ids) { + // 校验存在 + validateConfigWarehouseLocationExists(ids); + // 删除 + configWarehouseLocationMapper.deleteByIds(ids); + } + + private void validateConfigWarehouseLocationExists(List ids) { + List list = configWarehouseLocationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + } + } + + private void validateConfigWarehouseLocationExists(Long id) { + if (configWarehouseLocationMapper.selectById(id) == null) { + throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); + } + } + + @Override + public ConfigWarehouseLocationDO getConfigWarehouseLocation(Long id) { + return configWarehouseLocationMapper.selectById(id); + } + + @Override + public PageResult getConfigWarehouseLocationPage(ConfigWarehouseLocationPageReqVO pageReqVO) { + return configWarehouseLocationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java new file mode 100644 index 0000000..42c9844 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; + +/** + * 荧光数据采集特殊检测项目转换率配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFConversionRateService { + + /** + * 创建荧光数据采集特殊检测项目转换率配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFConversionRateRespVO createConfigXRFConversionRate(@Valid ConfigXRFConversionRateSaveReqVO createReqVO); + + /** + * 更新荧光数据采集特殊检测项目转换率配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFConversionRate(@Valid ConfigXRFConversionRateSaveReqVO updateReqVO); + + /** + * 删除荧光数据采集特殊检测项目转换率配置 + * + * @param id 编号 + */ + void deleteConfigXRFConversionRate(Long id); + + /** + * 批量删除荧光数据采集特殊检测项目转换率配置 + * + * @param ids 编号 + */ + void deleteConfigXRFConversionRateListByIds(List ids); + + /** + * 获得荧光数据采集特殊检测项目转换率配置 + * + * @param id 编号 + * @return 荧光数据采集特殊检测项目转换率配置 + */ + ConfigXRFConversionRateDO getConfigXRFConversionRate(Long id); + + /** + * 获得荧光数据采集特殊检测项目转换率配置分页 + * + * @param pageReqVO 分页查询 + * @return 荧光数据采集特殊检测项目转换率配置分页 + */ + PageResult getConfigXRFConversionRatePage(ConfigXRFConversionRatePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java new file mode 100644 index 0000000..697f3aa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFConversionRateServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFConversionRateMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光数据采集特殊检测项目转换率配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFConversionRateServiceImpl implements ConfigXRFConversionRateService { + + @Resource + private ConfigXRFConversionRateMapper configXRFConversionRateMapper; + + @Override + public ConfigXRFConversionRateRespVO createConfigXRFConversionRate(ConfigXRFConversionRateSaveReqVO createReqVO) { + // 插入 + ConfigXRFConversionRateDO configXRFConversionRate = BeanUtils.toBean(createReqVO, ConfigXRFConversionRateDO.class); + configXRFConversionRateMapper.insert(configXRFConversionRate); + // 返回 + return BeanUtils.toBean(configXRFConversionRate, ConfigXRFConversionRateRespVO.class); + } + + @Override + public void updateConfigXRFConversionRate(ConfigXRFConversionRateSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFConversionRateExists(updateReqVO.getId()); + // 更新 + ConfigXRFConversionRateDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFConversionRateDO.class); + configXRFConversionRateMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFConversionRate(Long id) { + // 校验存在 + validateConfigXRFConversionRateExists(id); + // 删除 + configXRFConversionRateMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFConversionRateListByIds(List ids) { + // 校验存在 + validateConfigXRFConversionRateExists(ids); + // 删除 + configXRFConversionRateMapper.deleteByIds(ids); + } + + private void validateConfigXRFConversionRateExists(List ids) { + List list = configXRFConversionRateMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS); + } + } + + private void validateConfigXRFConversionRateExists(Long id) { + if (configXRFConversionRateMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS); + } + } + + @Override + public ConfigXRFConversionRateDO getConfigXRFConversionRate(Long id) { + return configXRFConversionRateMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFConversionRatePage(ConfigXRFConversionRatePageReqVO pageReqVO) { + return configXRFConversionRateMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java new file mode 100644 index 0000000..74ce3ba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; + +/** + * 荧光分析线 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFLineService { + + /** + * 创建荧光分析线 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFLineRespVO createConfigXRFLine(@Valid ConfigXRFLineSaveReqVO createReqVO); + + /** + * 更新荧光分析线 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFLine(@Valid ConfigXRFLineSaveReqVO updateReqVO); + + /** + * 删除荧光分析线 + * + * @param id 编号 + */ + void deleteConfigXRFLine(Long id); + + /** + * 批量删除荧光分析线 + * + * @param ids 编号 + */ + void deleteConfigXRFLineListByIds(List ids); + + /** + * 获得荧光分析线 + * + * @param id 编号 + * @return 荧光分析线 + */ + ConfigXRFLineDO getConfigXRFLine(Long id); + + /** + * 获得荧光分析线分页 + * + * @param pageReqVO 分页查询 + * @return 荧光分析线分页 + */ + PageResult getConfigXRFLinePage(ConfigXRFLinePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java new file mode 100644 index 0000000..1777a1a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFLineServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFLineMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光分析线 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFLineServiceImpl implements ConfigXRFLineService { + + @Resource + private ConfigXRFLineMapper configXRFLineMapper; + + @Override + public ConfigXRFLineRespVO createConfigXRFLine(ConfigXRFLineSaveReqVO createReqVO) { + // 插入 + ConfigXRFLineDO configXRFLine = BeanUtils.toBean(createReqVO, ConfigXRFLineDO.class); + configXRFLineMapper.insert(configXRFLine); + // 返回 + return BeanUtils.toBean(configXRFLine, ConfigXRFLineRespVO.class); + } + + @Override + public void updateConfigXRFLine(ConfigXRFLineSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFLineExists(updateReqVO.getId()); + // 更新 + ConfigXRFLineDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFLineDO.class); + configXRFLineMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFLine(Long id) { + // 校验存在 + validateConfigXRFLineExists(id); + // 删除 + configXRFLineMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFLineListByIds(List ids) { + // 校验存在 + validateConfigXRFLineExists(ids); + // 删除 + configXRFLineMapper.deleteByIds(ids); + } + + private void validateConfigXRFLineExists(List ids) { + List list = configXRFLineMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_LINE_NOT_EXISTS); + } + } + + private void validateConfigXRFLineExists(Long id) { + if (configXRFLineMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_LINE_NOT_EXISTS); + } + } + + @Override + public ConfigXRFLineDO getConfigXRFLine(Long id) { + return configXRFLineMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFLinePage(ConfigXRFLinePageReqVO pageReqVO) { + return configXRFLineMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java new file mode 100644 index 0000000..0fdc8e6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectService.java @@ -0,0 +1,61 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; + +/** + * 荧光采集检测项目配置 Service 接口 + * + * @author 后台管理 + */ +public interface ConfigXRFProjectService { + + /** + * 创建荧光采集检测项目配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ConfigXRFProjectRespVO createConfigXRFProject(@Valid ConfigXRFProjectSaveReqVO createReqVO); + + /** + * 更新荧光采集检测项目配置 + * + * @param updateReqVO 更新信息 + */ + void updateConfigXRFProject(@Valid ConfigXRFProjectSaveReqVO updateReqVO); + + /** + * 删除荧光采集检测项目配置 + * + * @param id 编号 + */ + void deleteConfigXRFProject(Long id); + + /** + * 批量删除荧光采集检测项目配置 + * + * @param ids 编号 + */ + void deleteConfigXRFProjectListByIds(List ids); + + /** + * 获得荧光采集检测项目配置 + * + * @param id 编号 + * @return 荧光采集检测项目配置 + */ + ConfigXRFProjectDO getConfigXRFProject(Long id); + + /** + * 获得荧光采集检测项目配置分页 + * + * @param pageReqVO 分页查询 + * @return 荧光采集检测项目配置分页 + */ + PageResult getConfigXRFProjectPage(ConfigXRFProjectPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java new file mode 100644 index 0000000..cd49d2f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/ConfigXRFProjectServiceImpl.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 荧光采集检测项目配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ConfigXRFProjectServiceImpl implements ConfigXRFProjectService { + + @Resource + private ConfigXRFProjectMapper configXRFProjectMapper; + + @Override + public ConfigXRFProjectRespVO createConfigXRFProject(ConfigXRFProjectSaveReqVO createReqVO) { + // 插入 + ConfigXRFProjectDO configXRFProject = BeanUtils.toBean(createReqVO, ConfigXRFProjectDO.class); + configXRFProjectMapper.insert(configXRFProject); + // 返回 + return BeanUtils.toBean(configXRFProject, ConfigXRFProjectRespVO.class); + } + + @Override + public void updateConfigXRFProject(ConfigXRFProjectSaveReqVO updateReqVO) { + // 校验存在 + validateConfigXRFProjectExists(updateReqVO.getId()); + // 更新 + ConfigXRFProjectDO updateObj = BeanUtils.toBean(updateReqVO, ConfigXRFProjectDO.class); + configXRFProjectMapper.updateById(updateObj); + } + + @Override + public void deleteConfigXRFProject(Long id) { + // 校验存在 + validateConfigXRFProjectExists(id); + // 删除 + configXRFProjectMapper.deleteById(id); + } + + @Override + public void deleteConfigXRFProjectListByIds(List ids) { + // 校验存在 + validateConfigXRFProjectExists(ids); + // 删除 + configXRFProjectMapper.deleteByIds(ids); + } + + private void validateConfigXRFProjectExists(List ids) { + List list = configXRFProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(CONFIG_XRF_PROJECT_NOT_EXISTS); + } + } + + private void validateConfigXRFProjectExists(Long id) { + if (configXRFProjectMapper.selectById(id) == null) { + throw exception(CONFIG_XRF_PROJECT_NOT_EXISTS); + } + } + + @Override + public ConfigXRFProjectDO getConfigXRFProject(Long id) { + return configXRFProjectMapper.selectById(id); + } + + @Override + public PageResult getConfigXRFProjectPage(ConfigXRFProjectPageReqVO pageReqVO) { + return configXRFProjectMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailService.java index 87c6c52..b4c9e22 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailService.java @@ -5,7 +5,6 @@ import java.util.*; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardDetailPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardDetailRespVO; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardDetailSaveReqVO; -import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailExtendDO; import jakarta.validation.*; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO; import com.zt.plat.framework.common.pojo.PageResult; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailServiceImpl.java index 792b601..4ec5de8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardDetailServiceImpl.java @@ -5,7 +5,6 @@ import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandar import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardDetailRespVO; import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardDetailSaveReqVO; import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailExtendDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectService.java new file mode 100644 index 0000000..4f12559 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectService.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.config.service; + +import java.util.*; + +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardForecastProjectDO; +import com.zt.plat.framework.common.pojo.PageParam; + +/** + * 物料检测标准来样品位配置 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialAssayStandardForecastProjectService { + + /** + * 创建物料检测标准来样品位配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialAssayStandardForecastProjectRespVO createMaterialAssayStandardForecastProject(@Valid MaterialAssayStandardForecastProjectSaveReqVO createReqVO); + + /** + * 更新物料检测标准来样品位配置 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialAssayStandardForecastProject(@Valid MaterialAssayStandardForecastProjectSaveReqVO updateReqVO); + + /** + * 删除物料检测标准来样品位配置 + * + * @param id 编号 + */ + void deleteMaterialAssayStandardForecastProject(Long id); + + /** + * 批量删除物料检测标准来样品位配置 + * + * @param ids 编号 + */ + void deleteMaterialAssayStandardForecastProjectListByIds(List ids); + + /** + * 获得物料检测标准来样品位配置 + * + * @param id 编号 + * @return 物料检测标准来样品位配置 + */ + MaterialAssayStandardForecastProjectDO getMaterialAssayStandardForecastProject(Long id); + + /** + * 获得物料检测标准来样品位配置分页 + * + * @param pageReqVO 分页查询 + * @return 物料检测标准来样品位配置分页 + */ + PageResult getMaterialAssayStandardForecastProjectPage(MaterialAssayStandardForecastProjectPageReqVO pageReqVO); + + /** + * 获得物料检测标准来样品位配置 + * @param reqVO 查询条件 + * @return 物料检测标准来样品位配置 + */ + List getMaterialAssayStandardForecastProjectList(MaterialAssayStandardForecastProjectReqVO reqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectServiceImpl.java new file mode 100644 index 0000000..0a1ce18 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/service/MaterialAssayStandardForecastProjectServiceImpl.java @@ -0,0 +1,97 @@ +package com.zt.plat.module.qms.business.config.service; + +import cn.hutool.core.collection.CollUtil; + +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.*; +import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardForecastProjectDO; +import com.zt.plat.module.qms.business.config.dal.mapper.MaterialAssayStandardForecastProjectMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 物料检测标准来样品位配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class MaterialAssayStandardForecastProjectServiceImpl implements MaterialAssayStandardForecastProjectService { + + @Resource + private MaterialAssayStandardForecastProjectMapper materialAssayStandardForecastProjectMapper; + + @Override + public MaterialAssayStandardForecastProjectRespVO createMaterialAssayStandardForecastProject(MaterialAssayStandardForecastProjectSaveReqVO createReqVO) { + // 插入 + MaterialAssayStandardForecastProjectDO materialAssayStandardForecastProject = BeanUtils.toBean(createReqVO, MaterialAssayStandardForecastProjectDO.class); + materialAssayStandardForecastProjectMapper.insert(materialAssayStandardForecastProject); + // 返回 + return BeanUtils.toBean(materialAssayStandardForecastProject, MaterialAssayStandardForecastProjectRespVO.class); + } + + @Override + public void updateMaterialAssayStandardForecastProject(MaterialAssayStandardForecastProjectSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialAssayStandardForecastProjectExists(updateReqVO.getId()); + // 更新 + MaterialAssayStandardForecastProjectDO updateObj = BeanUtils.toBean(updateReqVO, MaterialAssayStandardForecastProjectDO.class); + materialAssayStandardForecastProjectMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialAssayStandardForecastProject(Long id) { + // 校验存在 + validateMaterialAssayStandardForecastProjectExists(id); + // 删除 + materialAssayStandardForecastProjectMapper.deleteById(id); + } + + @Override + public void deleteMaterialAssayStandardForecastProjectListByIds(List ids) { + // 校验存在 + validateMaterialAssayStandardForecastProjectExists(ids); + // 删除 + materialAssayStandardForecastProjectMapper.deleteByIds(ids); + } + + private void validateMaterialAssayStandardForecastProjectExists(List ids) { + List list = materialAssayStandardForecastProjectMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_ASSAY_STANDARD_FORECAST_PROJECT_NOT_EXISTS); + } + } + + private void validateMaterialAssayStandardForecastProjectExists(Long id) { + if (materialAssayStandardForecastProjectMapper.selectById(id) == null) { + throw exception(MATERIAL_ASSAY_STANDARD_FORECAST_PROJECT_NOT_EXISTS); + } + } + + @Override + public MaterialAssayStandardForecastProjectDO getMaterialAssayStandardForecastProject(Long id) { + return materialAssayStandardForecastProjectMapper.selectById(id); + } + + @Override + public PageResult getMaterialAssayStandardForecastProjectPage(MaterialAssayStandardForecastProjectPageReqVO pageReqVO) { + return materialAssayStandardForecastProjectMapper.selectPage(pageReqVO); + } + + @Override + public List getMaterialAssayStandardForecastProjectList( + MaterialAssayStandardForecastProjectReqVO reqVO) { + return materialAssayStandardForecastProjectMapper.selectList(reqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java index 83e2afa..0355fa7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryParameterController.java @@ -41,14 +41,14 @@ public class DictionaryParameterController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建检测参数字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:create')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:create')") public CommonResult createDictionaryParameter(@Valid @RequestBody DictionaryParameterSaveReqVO createReqVO) { return success(dictionaryParameterService.createDictionaryParameter(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测参数字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:update')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:update')") public CommonResult updateDictionaryParameter(@Valid @RequestBody DictionaryParameterSaveReqVO updateReqVO) { dictionaryParameterService.updateDictionaryParameter(updateReqVO); return success(true); @@ -57,7 +57,7 @@ public class DictionaryParameterController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除检测参数字典") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:delete')") public CommonResult deleteDictionaryParameter(@RequestParam("id") Long id) { dictionaryParameterService.deleteDictionaryParameter(id); return success(true); @@ -66,7 +66,7 @@ public class DictionaryParameterController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测参数字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:delete')") public CommonResult deleteDictionaryParameterList(@RequestBody BatchDeleteReqVO req) { dictionaryParameterService.deleteDictionaryParameterListByIds(req.getIds()); return success(true); @@ -75,7 +75,7 @@ public class DictionaryParameterController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得检测参数字典") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:query')") public CommonResult getDictionaryParameter(@RequestParam("id") Long id) { DictionaryParameterDO dictionaryParameter = dictionaryParameterService.getDictionaryParameter(id); return success(BeanUtils.toBean(dictionaryParameter, DictionaryParameterRespVO.class)); @@ -83,7 +83,7 @@ public class DictionaryParameterController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得检测参数字典分页") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:query')") public CommonResult> getDictionaryParameterPage(@Valid DictionaryParameterPageReqVO pageReqVO) { PageResult pageResult = dictionaryParameterService.getDictionaryParameterPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictionaryParameterRespVO.class)); @@ -91,7 +91,7 @@ public class DictionaryParameterController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出检测参数字典 Excel") - @PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:export')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-parameter:export')") @ApiAccessLog(operateType = EXPORT) public void exportDictionaryParameterExcel(@Valid DictionaryParameterPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java index 7fe6297..0688e2c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionaryProjectController.java @@ -41,14 +41,14 @@ public class DictionaryProjectController implements BusinessControllerMarker { @PostMapping("/create") @Operation(summary = "创建检测项目字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:create')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:create')") public CommonResult createDictionaryProject(@Valid @RequestBody DictionaryProjectSaveReqVO createReqVO) { return success(dictionaryProjectService.createDictionaryProject(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新检测项目字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:update')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:update')") public CommonResult updateDictionaryProject(@Valid @RequestBody DictionaryProjectSaveReqVO updateReqVO) { dictionaryProjectService.updateDictionaryProject(updateReqVO); return success(true); @@ -57,7 +57,7 @@ public class DictionaryProjectController implements BusinessControllerMarker { @DeleteMapping("/delete") @Operation(summary = "删除检测项目字典") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:delete')") public CommonResult deleteDictionaryProject(@RequestParam("id") Long id) { dictionaryProjectService.deleteDictionaryProject(id); return success(true); @@ -66,7 +66,7 @@ public class DictionaryProjectController implements BusinessControllerMarker { @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除检测项目字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:delete')") public CommonResult deleteDictionaryProjectList(@RequestBody BatchDeleteReqVO req) { dictionaryProjectService.deleteDictionaryProjectListByIds(req.getIds()); return success(true); @@ -75,7 +75,7 @@ public class DictionaryProjectController implements BusinessControllerMarker { @GetMapping("/get") @Operation(summary = "获得检测项目字典") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:query')") public CommonResult getDictionaryProject(@RequestParam("id") Long id) { DictionaryProjectDO dictionaryProject = dictionaryProjectService.getDictionaryProject(id); return success(BeanUtils.toBean(dictionaryProject, DictionaryProjectRespVO.class)); @@ -83,7 +83,7 @@ public class DictionaryProjectController implements BusinessControllerMarker { @GetMapping("/page") @Operation(summary = "获得检测项目字典分页") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:query')") public CommonResult> getDictionaryProjectPage(@Valid DictionaryProjectPageReqVO pageReqVO) { PageResult pageResult = dictionaryProjectService.getDictionaryProjectPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictionaryProjectRespVO.class)); @@ -91,7 +91,7 @@ public class DictionaryProjectController implements BusinessControllerMarker { @GetMapping("/export-excel") @Operation(summary = "导出检测项目字典 Excel") - @PreAuthorize("@ss.hasPermission('qms:dictionary-project:export')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-project:export')") @ApiAccessLog(operateType = EXPORT) public void exportDictionaryProjectExcel(@Valid DictionaryProjectPageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java index ab23de1..07d5fbd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleFlowNodeController.java @@ -41,14 +41,14 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @PostMapping("/create") @Operation(summary = "创建样品流程节点字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:create')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:create')") public CommonResult createDictionarySampleFlowNode(@Valid @RequestBody DictionarySampleFlowNodeSaveReqVO createReqVO) { return success(dictionarySampleFlowNodeService.createDictionarySampleFlowNode(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品流程节点字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:update')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:update')") public CommonResult updateDictionarySampleFlowNode(@Valid @RequestBody DictionarySampleFlowNodeSaveReqVO updateReqVO) { dictionarySampleFlowNodeService.updateDictionarySampleFlowNode(updateReqVO); return success(true); @@ -57,7 +57,7 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @DeleteMapping("/delete") @Operation(summary = "删除样品流程节点字典") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:delete')") public CommonResult deleteDictionarySampleFlowNode(@RequestParam("id") Long id) { dictionarySampleFlowNodeService.deleteDictionarySampleFlowNode(id); return success(true); @@ -66,7 +66,7 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品流程节点字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:delete')") public CommonResult deleteDictionarySampleFlowNodeList(@RequestBody BatchDeleteReqVO req) { dictionarySampleFlowNodeService.deleteDictionarySampleFlowNodeListByIds(req.getIds()); return success(true); @@ -75,7 +75,7 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @GetMapping("/get") @Operation(summary = "获得样品流程节点字典") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:query')") public CommonResult getDictionarySampleFlowNode(@RequestParam("id") Long id) { DictionarySampleFlowNodeDO dictionarySampleFlowNode = dictionarySampleFlowNodeService.getDictionarySampleFlowNode(id); return success(BeanUtils.toBean(dictionarySampleFlowNode, DictionarySampleFlowNodeRespVO.class)); @@ -83,7 +83,7 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @GetMapping("/page") @Operation(summary = "获得样品流程节点字典分页") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:query')") public CommonResult> getDictionarySampleFlowNodePage(@Valid DictionarySampleFlowNodePageReqVO pageReqVO) { PageResult pageResult = dictionarySampleFlowNodeService.getDictionarySampleFlowNodePage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictionarySampleFlowNodeRespVO.class)); @@ -91,7 +91,7 @@ public class DictionarySampleFlowNodeController implements BusinessControllerMar @GetMapping("/export-excel") @Operation(summary = "导出样品流程节点字典 Excel") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:export')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-flow-node:export')") @ApiAccessLog(operateType = EXPORT) public void exportDictionarySampleFlowNodeExcel(@Valid DictionarySampleFlowNodePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java index 7c3e88e..97fa218 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/admin/DictionarySampleTypeController.java @@ -41,14 +41,14 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @PostMapping("/create") @Operation(summary = "创建样品类型字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:create')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:create')") public CommonResult createDictionarySampleType(@Valid @RequestBody DictionarySampleTypeSaveReqVO createReqVO) { return success(dictionarySampleTypeService.createDictionarySampleType(createReqVO)); } @PutMapping("/update") @Operation(summary = "更新样品类型字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:update')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:update')") public CommonResult updateDictionarySampleType(@Valid @RequestBody DictionarySampleTypeSaveReqVO updateReqVO) { dictionarySampleTypeService.updateDictionarySampleType(updateReqVO); return success(true); @@ -57,7 +57,7 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @DeleteMapping("/delete") @Operation(summary = "删除样品类型字典") @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:delete')") public CommonResult deleteDictionarySampleType(@RequestParam("id") Long id) { dictionarySampleTypeService.deleteDictionarySampleType(id); return success(true); @@ -66,7 +66,7 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @DeleteMapping("/delete-list") @Parameter(name = "ids", description = "编号", required = true) @Operation(summary = "批量删除样品类型字典") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:delete')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:delete')") public CommonResult deleteDictionarySampleTypeList(@RequestBody BatchDeleteReqVO req) { dictionarySampleTypeService.deleteDictionarySampleTypeListByIds(req.getIds()); return success(true); @@ -75,7 +75,7 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @GetMapping("/get") @Operation(summary = "获得样品类型字典") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:query')") public CommonResult getDictionarySampleType(@RequestParam("id") Long id) { DictionarySampleTypeDO dictionarySampleType = dictionarySampleTypeService.getDictionarySampleType(id); return success(BeanUtils.toBean(dictionarySampleType, DictionarySampleTypeRespVO.class)); @@ -83,7 +83,7 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @GetMapping("/page") @Operation(summary = "获得样品类型字典分页") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:query')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:query')") public CommonResult> getDictionarySampleTypePage(@Valid DictionarySampleTypePageReqVO pageReqVO) { PageResult pageResult = dictionarySampleTypeService.getDictionarySampleTypePage(pageReqVO); return success(BeanUtils.toBean(pageResult, DictionarySampleTypeRespVO.class)); @@ -91,7 +91,7 @@ public class DictionarySampleTypeController implements BusinessControllerMarker @GetMapping("/export-excel") @Operation(summary = "导出样品类型字典 Excel") - @PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:export')") + //@PreAuthorize("@ss.hasPermission('qms:dictionary-sample-type:export')") @ApiAccessLog(operateType = EXPORT) public void exportDictionarySampleTypeExcel(@Valid DictionarySampleTypePageReqVO pageReqVO, HttpServletResponse response) throws IOException { diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterPageReqVO.java index d3df856..13b027d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterPageReqVO.java @@ -16,19 +16,19 @@ public class DictionaryParameterPageReqVO extends PageParam { @Schema(description = "参数序号") private Integer no; - @Schema(description = "名称", example = "李四") + @Schema(description = "名称", example = "王五") private String name; @Schema(description = "键值") private String key; - @Schema(description = "检测单位ID,UNT表", example = "23653") + @Schema(description = "检测单位ID,UNT表", example = "20894") private Long unitId; @Schema(description = "单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间", example = "2") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2") private String dataType; @Schema(description = "小数位") @@ -40,16 +40,16 @@ public class DictionaryParameterPageReqVO extends PageParam { @Schema(description = "计算公式") private String formula; - @Schema(description = "填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算") + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") private String fillingWay; - @Schema(description = "参数简称", example = "李四") + @Schema(description = "参数简称", example = "芋艿") private String shortName; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterRespVO.java index 827e035..402d490 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterRespVO.java @@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class DictionaryParameterRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16564") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23180") @ExcelProperty("ID") private Long id; @@ -20,7 +20,7 @@ public class DictionaryParameterRespVO { @ExcelProperty("参数序号") private Integer no; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("名称") private String name; @@ -28,7 +28,7 @@ public class DictionaryParameterRespVO { @ExcelProperty("键值") private String key; - @Schema(description = "检测单位ID,UNT表", example = "23653") + @Schema(description = "检测单位ID,UNT表", example = "20894") @ExcelProperty("检测单位ID,UNT表") private Long unitId; @@ -36,8 +36,8 @@ public class DictionaryParameterRespVO { @ExcelProperty("单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间") private String dataType; @Schema(description = "小数位") @@ -52,11 +52,11 @@ public class DictionaryParameterRespVO { @ExcelProperty("计算公式") private String formula; - @Schema(description = "填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算") + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算") private String fillingWay; - @Schema(description = "参数简称", example = "李四") + @Schema(description = "参数简称", example = "芋艿") @ExcelProperty("参数简称") private String shortName; @@ -64,8 +64,8 @@ public class DictionaryParameterRespVO { @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterSaveReqVO.java index 74febb0..d3549b9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryParameterSaveReqVO.java @@ -9,28 +9,28 @@ import jakarta.validation.constraints.*; @Data public class DictionaryParameterSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16564") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23180") private Long id; @Schema(description = "参数序号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "参数序号不能为空") private Integer no; - @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "名称不能为空") private String name; @Schema(description = "键值") private String key; - @Schema(description = "检测单位ID,UNT表", example = "23653") + @Schema(description = "检测单位ID,UNT表", example = "20894") private Long unitId; @Schema(description = "单位") private String unit; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间不能为空") + @Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空") private String dataType; @Schema(description = "小数位") @@ -43,15 +43,14 @@ public class DictionaryParameterSaveReqVO { @Schema(description = "计算公式") private String formula; - @Schema(description = "填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算不能为空") + @Schema(description = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算不能为空") private String fillingWay; - @Schema(description = "参数简称", example = "李四") + @Schema(description = "参数简称", example = "芋艿") private String shortName; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectPageReqVO.java index 01d5242..2fcb58e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectPageReqVO.java @@ -1,10 +1,10 @@ package com.zt.plat.module.qms.business.dic.controller.vo; -import com.zt.plat.framework.common.pojo.PageParam; +import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; +import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; - import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -16,28 +16,22 @@ public class DictionaryProjectPageReqVO extends PageParam { @Schema(description = "检测项目代码") private String code; - @Schema(description = "检测项目名称", example = "三氧化二铝") + @Schema(description = "检测项目名称", example = "芋艿") private String name; - @Schema(description = "检测项目缩写", example = "Al2O3") + @Schema(description = "检测项目缩写", example = "李四") private String simpleName; - @Schema(description = "检测项目显示名称", example = "Al2O3") + @Schema(description = "显示名称", example = "李四") private String showName; @Schema(description = "键值") private String key; - @Schema(description = "物料属性ID", example = "15500") - private Long materialPropertiesId; - - @Schema(description = "物料属性编码") - private String materialPropertiesCode; - @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectRespVO.java index 8928b33..1616044 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectRespVO.java @@ -1,18 +1,18 @@ package com.zt.plat.module.qms.business.dic.controller.vo; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; @Schema(description = "管理后台 - 检测项目字典 Response VO") @Data @ExcelIgnoreUnannotated public class DictionaryProjectRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16336") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13395") @ExcelProperty("ID") private Long id; @@ -20,36 +20,28 @@ public class DictionaryProjectRespVO { @ExcelProperty("检测项目代码") private String code; - @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "三氧化二铝") + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @ExcelProperty("检测项目名称") private String name; - @Schema(description = "检测项目缩写", requiredMode = Schema.RequiredMode.REQUIRED, example = "Al2O3") + @Schema(description = "检测项目缩写", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @ExcelProperty("检测项目缩写") private String simpleName; - @Schema(description = "检测项目显示名称", example = "Al2O3") - @ExcelProperty("检测项目显示名称") + @Schema(description = "显示名称", example = "李四") + @ExcelProperty("显示名称") private String showName; @Schema(description = "键值") @ExcelProperty("键值") private String key; - @Schema(description = "物料属性ID", example = "15500") - @ExcelProperty("物料属性ID") - private Long materialPropertiesId; - - @Schema(description = "物料属性编码") - @ExcelProperty("物料属性编码") - private String materialPropertiesCode; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectSaveReqVO.java index 628a2ff..733d915 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionaryProjectSaveReqVO.java @@ -1,42 +1,35 @@ package com.zt.plat.module.qms.business.dic.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; @Schema(description = "管理后台 - 检测项目字典新增/修改 Request VO") @Data public class DictionaryProjectSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16336") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13395") private Long id; @Schema(description = "检测项目代码") private String code; - @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "三氧化二铝") + @Schema(description = "检测项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "检测项目名称不能为空") private String name; - @Schema(description = "检测项目缩写", requiredMode = Schema.RequiredMode.REQUIRED, example = "Al2O3") + @Schema(description = "检测项目缩写", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @NotEmpty(message = "检测项目缩写不能为空") private String simpleName; - @Schema(description = "检测项目显示名称", example = "Al2O3") - @NotEmpty(message = "检测项目显示名称不能为空") + @Schema(description = "显示名称", example = "李四") private String showName; @Schema(description = "键值") private String key; - @Schema(description = "物料属性ID", example = "15500") - private Long materialPropertiesId; - - @Schema(description = "物料属性编码") - private String materialPropertiesCode; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodePageReqVO.java index 4bc2195..ed7d7f7 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodePageReqVO.java @@ -1,10 +1,10 @@ package com.zt.plat.module.qms.business.dic.controller.vo; -import com.zt.plat.framework.common.pojo.PageParam; +import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; +import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; - import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -13,13 +13,13 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class DictionarySampleFlowNodePageReqVO extends PageParam { - @Schema(description = "键") + @Schema(description = "键值") private String key; @Schema(description = "名称", example = "李四") private String name; - @Schema(description = "类型,主样、子样", example = "1") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") private String type; @Schema(description = "代码") @@ -28,13 +28,13 @@ public class DictionarySampleFlowNodePageReqVO extends PageParam { @Schema(description = "默认事件") private String defaultEvent; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "排序号") + private Integer sortNo; @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeRespVO.java index c48732f..cea1f3f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeRespVO.java @@ -1,31 +1,31 @@ package com.zt.plat.module.qms.business.dic.controller.vo; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; @Schema(description = "管理后台 - 样品流程节点字典 Response VO") @Data @ExcelIgnoreUnannotated public class DictionarySampleFlowNodeRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17734") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7544") @ExcelProperty("ID") private Long id; - @Schema(description = "键") - @ExcelProperty("键") + @Schema(description = "键值", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("键值") private String key; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @ExcelProperty("名称") private String name; - @Schema(description = "类型,主样、子样", example = "1") - @ExcelProperty("类型,主样、子样") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") + @ExcelProperty("类型,主样base_sample、子样sub_sample") private String type; @Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) @@ -36,15 +36,16 @@ public class DictionarySampleFlowNodeRespVO { @ExcelProperty("默认事件") private String defaultEvent; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("排序号") + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeSaveReqVO.java index ccb78b9..95e1469 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleFlowNodeSaveReqVO.java @@ -1,25 +1,26 @@ package com.zt.plat.module.qms.business.dic.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; @Schema(description = "管理后台 - 样品流程节点字典新增/修改 Request VO") @Data public class DictionarySampleFlowNodeSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17734") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7544") private Long id; - @Schema(description = "键") - @NotEmpty(message = "键名不能为空") + @Schema(description = "键值", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "键值不能为空") private String key; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") @NotEmpty(message = "名称不能为空") private String name; - @Schema(description = "类型,主样、子样", example = "1") + @Schema(description = "类型,主样base_sample、子样sub_sample", example = "1") private String type; @Schema(description = "代码", requiredMode = Schema.RequiredMode.REQUIRED) @@ -29,10 +30,11 @@ public class DictionarySampleFlowNodeSaveReqVO { @Schema(description = "默认事件") private String defaultEvent; - @Schema(description = "排序") - private Integer sort; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "排序号不能为空") + private Integer sortNo; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleTypeSaveReqVO.java index 80b8941..3da89d9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleTypeSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/controller/vo/DictionarySampleTypeSaveReqVO.java @@ -25,7 +25,6 @@ public class DictionarySampleTypeSaveReqVO { private String key; @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "所属部门不能为空") private String systemDepartmentCode; @Schema(description = "备注") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryParameterDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryParameterDO.java index d505ee6..c25946c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryParameterDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryParameterDO.java @@ -57,7 +57,7 @@ public class DictionaryParameterDO extends BusinessBaseDO { @TableField("UNT") private String unit; /** - * 数据类型,【字典】【jy_sample_data_type】STR-字符串,INTG-整数,DEC-小数,DT-日期,DTM-时间 + * 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间 */ @TableField("DAT_TP") private String dataType; @@ -77,7 +77,7 @@ public class DictionaryParameterDO extends BusinessBaseDO { @TableField("FMU") private String formula; /** - * 填写方式,【字典】【jy_dictionary_parameter_Filling_way】人工录入,天平采集,计算 + * 填写方式,字典表【T_DIC_BSN】人工录入,天平采集,计算 */ @TableField("FIL_WY") private String fillingWay; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryProjectDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryProjectDO.java index da6f529..f906019 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryProjectDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionaryProjectDO.java @@ -44,7 +44,7 @@ public class DictionaryProjectDO extends BusinessBaseDO { @TableField("SMPL_NAME") private String simpleName; /** - * 检测项目显示名称 + * 显示名称 */ @TableField("SHW_NAME") private String showName; @@ -54,16 +54,6 @@ public class DictionaryProjectDO extends BusinessBaseDO { @TableField("KY") private String key; /** - * 物料属性ID - */ - @TableField("MTRL_PRPS_ID") - private Long materialPropertiesId; - /** - * 物料属性编码 - */ - @TableField("MTRL_PRPS_CD") - private String materialPropertiesCode; - /** * 所属部门 */ @TableField("SYS_DEPT_CD") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionarySampleFlowNodeDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionarySampleFlowNodeDO.java index faac275..589ddc3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionarySampleFlowNodeDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/dataobject/DictionarySampleFlowNodeDO.java @@ -1,8 +1,11 @@ package com.zt.plat.module.qms.business.dic.dal.dataobject; -import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; -import com.baomidou.mybatisplus.annotation.*; import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** * 样品流程节点字典 DO * @@ -29,7 +32,7 @@ public class DictionarySampleFlowNodeDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * key + * 键 */ @TableField("KY") private String key; @@ -39,7 +42,7 @@ public class DictionarySampleFlowNodeDO extends BusinessBaseDO { @TableField("NAME") private String name; /** - * 类型,主样、子样 + * 类型,主样base_sample、子样sub_sample */ @TableField("TP") private String type; @@ -54,10 +57,10 @@ public class DictionarySampleFlowNodeDO extends BusinessBaseDO { @TableField("DFT_EVN") private String defaultEvent; /** - * 排序 + * 排序号 */ - @TableField("SRT") - private Integer sort; + @TableField("SRT_NO") + private Integer sortNo; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryParameterMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryParameterMapper.java index 0453b88..7634267 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryParameterMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryParameterMapper.java @@ -1,10 +1,9 @@ package com.zt.plat.module.qms.business.dic.dal.mapper; -import java.util.*; - import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.business.dic.controller.vo.*; +import com.zt.plat.module.qms.business.dic.controller.vo.DictionaryParameterPageReqVO; import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryProjectMapper.java index e37572c..9f5621a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/dic/dal/mapper/DictionaryProjectMapper.java @@ -20,9 +20,8 @@ public interface DictionaryProjectMapper extends BaseMapperX selectPage(DictionarySampleFlowNodePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DictionarySampleFlowNodeDO::getKey, reqVO.getKey()) .likeIfPresent(DictionarySampleFlowNodeDO::getName, reqVO.getName()) .eqIfPresent(DictionarySampleFlowNodeDO::getType, reqVO.getType()) .eqIfPresent(DictionarySampleFlowNodeDO::getCode, reqVO.getCode()) .eqIfPresent(DictionarySampleFlowNodeDO::getDefaultEvent, reqVO.getDefaultEvent()) + .eqIfPresent(DictionarySampleFlowNodeDO::getSortNo, reqVO.getSortNo()) .eqIfPresent(DictionarySampleFlowNodeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .betweenIfPresent(DictionarySampleFlowNodeDO::getCreateTime, reqVO.getCreateTime()) .eqIfPresent(DictionarySampleFlowNodeDO::getRemark, reqVO.getRemark()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java new file mode 100644 index 0000000..ccc2c5f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentDataController.java @@ -0,0 +1,157 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.admin; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentDataPageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentDataRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentDataSaveReqVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 检测报告明细") +@RestController +@RequestMapping("/qms/report-document-data") +@Validated +@FileUploadController(source = "qms.reportdocumentdata") +public class ReportDocumentDataController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = ReportDocumentDataController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private ReportDocumentDataService reportDocumentDataService; + @Resource private ReportDocumentMainService reportDocumentMainService; + @Resource private ReportDocumentTypeService reportDocumentTypeService; + + /* + * 查询报告明细数据,返回结果包含表头、数据、检出限等。会按报告配置进行“换行”处理。*/ + @GetMapping("/queryReportDetail") + @Operation(summary = "查询报告明细数据") + @Parameter(name = "mainId", description = "报告id", required = true, example = "1024") + public CommonResult> queryReportDetail(@RequestParam("mainId") Long mainId) { + + ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId); + Long typeId = mainDO.getReportDocumentTypeId(); + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId); + Long confId = typeDO.getConfigReportTypeId(); +// Map param = new HashMap<>(); +// List list = reportDocumentDataService.listByMainDataId(mainId).getData(); +// return success(BeanUtils.toBean(list, ReportDocumentDataRespVO.class)); + CommonResult> result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO); + return result; + } + + @GetMapping("/queryAddedData") + @Operation(summary = "查询已编制报表数据") + @Parameter(name = "mainId", description = "报告id", required = true, example = "1024") + public CommonResult> queryAddedData(@RequestParam("mainId") Long mainId) { + + ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId); + Long typeId = mainDO.getReportDocumentTypeId(); + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId); + Long confId = typeDO.getConfigReportTypeId(); + Map param = new HashMap<>(); + + List list = reportDocumentDataService.listByMainDataId(mainId).getData(); + return success(BeanUtils.toBean(list, ReportDocumentDataRespVO.class)); + } + + + @PostMapping("/create") + @Operation(summary = "创建检测报告明细") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:create')") + public CommonResult createReportDocumentData(@Valid @RequestBody ReportDocumentDataSaveReqVO createReqVO) { + return success(reportDocumentDataService.createReportDocumentData(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测报告明细") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:update')") + public CommonResult updateReportDocumentData(@Valid @RequestBody ReportDocumentDataSaveReqVO updateReqVO) { + reportDocumentDataService.updateReportDocumentData(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测报告明细") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:delete')") + public CommonResult deleteReportDocumentData(@RequestParam("id") Long id) { + reportDocumentDataService.deleteReportDocumentData(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测报告明细") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:delete')") + public CommonResult deleteReportDocumentDataList(@RequestBody BatchDeleteReqVO req) { + reportDocumentDataService.deleteReportDocumentDataListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测报告明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:query')") + public CommonResult getReportDocumentData(@RequestParam("id") Long id) { + ReportDocumentDataDO reportDocumentData = reportDocumentDataService.getReportDocumentData(id); + return success(BeanUtils.toBean(reportDocumentData, ReportDocumentDataRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测报告明细分页") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:query')") + public CommonResult> getReportDocumentDataPage(@Valid ReportDocumentDataPageReqVO pageReqVO) { + PageResult pageResult = reportDocumentDataService.getReportDocumentDataPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ReportDocumentDataRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测报告明细 Excel") + //@PreAuthorize("@ss.hasPermission('qms:report-document-data:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportReportDocumentDataExcel(@Valid ReportDocumentDataPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = reportDocumentDataService.getReportDocumentDataPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测报告明细.xls", "数据", ReportDocumentDataRespVO.class, + BeanUtils.toBean(list, ReportDocumentDataRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java new file mode 100644 index 0000000..7af8904 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainController.java @@ -0,0 +1,264 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.admin; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.*; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.error; +import static com.zt.plat.framework.common.pojo.CommonResult.success; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS; + +@Tag(name = "管理后台 - 检测报告业务") +@RestController +@RequestMapping("/qms/report-document-main") +@Validated +@FileUploadController(source = "qms.reportdocumentmain") +public class ReportDocumentMainController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = ReportDocumentMainController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private ReportDocumentMainService reportDocumentMainService; + @Resource private ReportDocumentDataService reportDocumentDataService; + @Resource private ReportDocumentTypeService reportDocumentTypeService; + @Resource private ConfigUserSignatureService configUserSignatureService; + + @PostMapping("/create") + @Operation(summary = "创建检测报告") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:create')") + public CommonResult createReportDocumentMain(@Valid @RequestBody ReportDocumentMainSaveReqVO createReqVO) { + return success(reportDocumentMainService.createReportDocumentMain(createReqVO)); + } + + @PostMapping("/createTempData") + @Operation(summary = "创建临时数据") + public CommonResult createTempData(@RequestBody ReportDocumentMainSaveReqVO vo) { + Long reportDocumentTypeId = vo.getReportDocumentTypeId(); + if(reportDocumentTypeId == null){ + return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型ID不能为空,请刷新后重试"); + } + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentTypeId); + if(typeDO == null){ + return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试"); + } + vo.setFlowKey(typeDO.getFlowKey()); + vo.setDocumentType(typeDO.getDocumentType()); + vo.setConfigReportTypeId(typeDO.getConfigReportTypeId()); + vo.setDocumentConfig(JSONObject.toJSONString(typeDO)); + vo.setFlowStatus(QmsCommonConstant.NOT_START); + vo.setCancelFlag("-1"); + return success(reportDocumentMainService.createReportDocumentMain(vo)); + } + + @PostMapping("/createProcessInstance") + @Operation(summary = "发起流程") + public CommonResult createProcessInstance(@Valid @RequestBody ReportDocumentMainSaveReqVO createReqVO) { + return reportDocumentMainService.createProcessInstance(createReqVO); + } + + @PostMapping("/execAddDataBySample") + @Operation(summary = "增加数据(按样品)") + public CommonResult execAddDataBySample(@RequestBody ReportDocumentMainSaveReqVO vo) { + return reportDocumentMainService.execAddDataBySample(vo); + } + + @PostMapping("/execAddDataByEntrust") + @Operation(summary = "增加数据(按委托)") + public CommonResult execAddDataByEntrust(@RequestBody ReportDocumentMainSaveReqVO vo) { + return reportDocumentMainService.execAddDataByEntrust(vo); + } + + @PostMapping("/execRemoveData") + @Operation(summary = "移除数据") + public CommonResult execRemoveData(@RequestBody ReportDocumentMainSaveReqVO vo) { + return reportDocumentMainService.execRemoveData(vo); + } + + @PutMapping("/doSave") + @Operation(summary = "更新检测报告业务") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:update')") + public CommonResult doSave(@Valid @RequestBody ReportDocumentMainSaveReqVO updateReqVO) { + updateReqVO.setCancelFlag("0"); + reportDocumentMainService.doSave(updateReqVO); + return success(true); + } + + + @PutMapping("/update") + @Operation(summary = "更新检测报告业务") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:update')") + public CommonResult updateReportDocumentMain(@Valid @RequestBody ReportDocumentMainSaveReqVO updateReqVO) { + updateReqVO.setCancelFlag("0"); + reportDocumentMainService.updateReportDocumentMain(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测报告业务") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:delete')") + public CommonResult deleteReportDocumentMain(@RequestParam("id") Long id) { + reportDocumentMainService.deleteReportDocumentMain(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测报告业务") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:delete')") + public CommonResult deleteReportDocumentMainList(@RequestBody BatchDeleteReqVO req) { + reportDocumentMainService.deleteReportDocumentMainListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测报告业务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')") + public CommonResult getReportDocumentMain(@RequestParam("id") Long id, @RequestParam(value = "editFlag", required = false, defaultValue = "false") String editFlag) { + ReportDocumentMainDO reportDocumentMain = reportDocumentMainService.getReportDocumentMain(id); + + ReportDocumentMainRespVO vo = BeanUtils.toBean(reportDocumentMain, ReportDocumentMainRespVO.class); + + //处理签名 + String docSig = vo.getDocumentSignature(); + if(!ObjectUtils.isEmpty(docSig)){ + JSONObject docSigJson = JSONObject.parseObject(docSig); + List sigIds = new ArrayList<>(); + docSigJson.forEach((key, value) -> { + JSONObject obj = docSigJson.getJSONObject( key); + String signatureId = obj.getString("signatureId"); + if(!ObjectUtils.isEmpty(signatureId)) + sigIds.add(Long.parseLong(signatureId)); + }); + + if(!sigIds.isEmpty()){ + List sigList = configUserSignatureService.getByIdList(sigIds); + docSigJson.forEach((key, value) -> { + JSONObject obj = docSigJson.getJSONObject( key); + String signatureId = obj.getString("signatureId"); + if(!ObjectUtils.isEmpty(signatureId)){ + ConfigUserSignatureDO sig = sigList.stream().filter(item -> item.getId().equals(Long.parseLong(signatureId))).findFirst().orElse(null); + if(sig != null){ + String base64 = sig.getSignatureContent(); + obj.put("signatureIdBase64", base64); + } + } + }); + } + vo.setDocumentSignature(docSigJson.toJSONString()); + } + + //处理抬头数据 + + if("true".equals(editFlag)){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String formData = vo.getFormData(); + JSONObject formDataJson = new JSONObject(); + if(!ObjectUtils.isEmpty(formData)) + formDataJson = JSONObject.parseObject(formData); + List dataList = reportDocumentDataService.listByMainDataId(id).getData(); + ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMain.getReportDocumentTypeId()); + String customConfig = typeDO.getCustomConfig(); + String defaultConclusion = ""; + if(!ObjectUtils.isEmpty(customConfig)){ + JSONObject config = JSONObject.parseObject(customConfig); + defaultConclusion = config.getString("defaultConclusion"); + } + formDataJson.put("conclusion", defaultConclusion); + if(!dataList.isEmpty()) + formDataJson.put("sampleName", dataList.get(0).getSampleName()); + //处理检测标准 + String standard = assembleStandard(dataList); + formDataJson.put("standard", standard); + formDataJson.put("reportTime", sdf.format(new Date())); + vo.setFormData(formDataJson.toJSONString()); +// ReportDocumentMainSaveReqVO updateVO = new ReportDocumentMainSaveReqVO(); +// updateVO.setId(reportDocumentMain.getId()); +// updateVO.setFormData(formDataJson.toJSONString()); +// reportDocumentMainService.updateReportDocumentMain(updateVO); + } + return success(vo); + } + + private String assembleStandard(List dataList){ + + Set standardSet = new HashSet<>(); + for(ReportDocumentDataDO data : dataList){ + String content = data.getDocumentContent(); + if(ObjectUtils.isEmpty( content)) + continue; + JSONObject json = JSONObject.parseObject(content); + for(String key : json.keySet()){ + JSONObject obj = json.getJSONObject(key); + String methodName = obj.getString("methodName"); + if(ObjectUtils.isEmpty(methodName)) + continue; + standardSet.add(methodName); + } + } + if(standardSet.isEmpty()) + return ""; + return String.join(",", standardSet); + } + + + @GetMapping("/page") + @Operation(summary = "获得检测报告业务分页") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')") + public CommonResult> getReportDocumentMainPage(@Valid ReportDocumentMainPageReqVO pageReqVO) { + PageResult pageResult = reportDocumentMainService.getReportDocumentMainPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ReportDocumentMainRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测报告业务 Excel") + //@PreAuthorize("@ss.hasPermission('qms:report-document-main:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportReportDocumentMainExcel(@Valid ReportDocumentMainPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = reportDocumentMainService.getReportDocumentMainPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, + BeanUtils.toBean(list, ReportDocumentMainRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java new file mode 100644 index 0000000..1cb690d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentMainCorrelationController.java @@ -0,0 +1,109 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.admin; + +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationPageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationSaveReqVO; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; + +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainCorrelationService; + +@Tag(name = "管理后台 - 检测报告关系表") +@RestController +@RequestMapping("/qms/report-document-main-correlation") +@Validated +public class ReportDocumentMainCorrelationController implements BusinessControllerMarker { + + + @Resource + private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService; + + @PostMapping("/create") + @Operation(summary = "创建检测报告关系表") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:create')") + public CommonResult createReportDocumentMainCorrelation(@Valid @RequestBody ReportDocumentMainCorrelationSaveReqVO createReqVO) { + return success(reportDocumentMainCorrelationService.createReportDocumentMainCorrelation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新检测报告关系表") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:update')") + public CommonResult updateReportDocumentMainCorrelation(@Valid @RequestBody ReportDocumentMainCorrelationSaveReqVO updateReqVO) { + reportDocumentMainCorrelationService.updateReportDocumentMainCorrelation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除检测报告关系表") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:delete')") + public CommonResult deleteReportDocumentMainCorrelation(@RequestParam("id") Long id) { + reportDocumentMainCorrelationService.deleteReportDocumentMainCorrelation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除检测报告关系表") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:delete')") + public CommonResult deleteReportDocumentMainCorrelationList(@RequestBody BatchDeleteReqVO req) { + reportDocumentMainCorrelationService.deleteReportDocumentMainCorrelationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得检测报告关系表") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:query')") + public CommonResult getReportDocumentMainCorrelation(@RequestParam("id") Long id) { + ReportDocumentMainCorrelationDO reportDocumentMainCorrelation = reportDocumentMainCorrelationService.getReportDocumentMainCorrelation(id); + return success(BeanUtils.toBean(reportDocumentMainCorrelation, ReportDocumentMainCorrelationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得检测报告关系表分页") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:query')") + public CommonResult> getReportDocumentMainCorrelationPage(@Valid ReportDocumentMainCorrelationPageReqVO pageReqVO) { + PageResult pageResult = reportDocumentMainCorrelationService.getReportDocumentMainCorrelationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ReportDocumentMainCorrelationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出检测报告关系表 Excel") + @PreAuthorize("@ss.hasPermission('qms:report-document-main-correlation:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportReportDocumentMainCorrelationExcel(@Valid ReportDocumentMainCorrelationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = reportDocumentMainCorrelationService.getReportDocumentMainCorrelationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "检测报告关系表.xls", "数据", ReportDocumentMainCorrelationRespVO.class, + BeanUtils.toBean(list, ReportDocumentMainCorrelationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java new file mode 100644 index 0000000..bc746bb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/admin/ReportDocumentTypeController.java @@ -0,0 +1,126 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO; +import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService; +import com.zt.plat.module.qms.enums.QmsPermissionConstant; +import com.zt.plat.module.system.api.permission.PermissionApi; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 报告类型配置") +@RestController +@RequestMapping("/qms/report-document-type") +@Validated +public class ReportDocumentTypeController implements BusinessControllerMarker { + + + @Resource private ReportDocumentTypeService reportDocumentTypeService; + @Resource private ConfigPermissionService configPermissionService; + @Resource private PermissionApi permissionApi; + + @PostMapping("/save") + @Operation(summary = "更新报告类型配置") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:update')") + public CommonResult updateReportDocumentType(@Valid @RequestBody ReportDocumentTypeSaveReqVO updateReqVO) { + return reportDocumentTypeService.save(updateReqVO); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除报告类型配置") + @Parameter(name = "id", description = "编号", required = true) + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:delete')") + public CommonResult deleteReportDocumentType(@RequestParam("id") Long id) { + reportDocumentTypeService.deleteReportDocumentType(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除报告类型配置") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:delete')") + public CommonResult deleteReportDocumentTypeList(@RequestBody BatchDeleteReqVO req) { + reportDocumentTypeService.deleteReportDocumentTypeListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得报告类型配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:query')") + public CommonResult getReportDocumentType(@RequestParam("id") Long id) { + ReportDocumentTypeDO reportDocumentTypeDO = reportDocumentTypeService.getReportDocumentType(id); + Long mainId = reportDocumentTypeDO.getMainId(); + List permissionList = configPermissionService.getPermissionList(mainId, QmsPermissionConstant.REPORT_DOCUMENT_TYPE_START, ""); + List permissionRespVOList= BeanUtils.toBean(permissionList, ConfigPermissionRespVO.class); + ReportDocumentTypeRespVO reportDocumentTypeRespVO = BeanUtils.toBean(reportDocumentTypeDO, ReportDocumentTypeRespVO.class); + reportDocumentTypeRespVO.setPermissionList(permissionRespVOList); + return success(reportDocumentTypeRespVO); + } + + @GetMapping("/page") + @Operation(summary = "获得报告类型配置分页") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:query')") + public CommonResult> getReportDocumentTypePage(@Valid ReportDocumentTypePageReqVO pageReqVO) { + PageResult pageResult = reportDocumentTypeService.getReportDocumentTypePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ReportDocumentTypeRespVO.class)); + } + + @GetMapping("/selectListWithPermission") + @Operation(summary = "安权限查询报告类型") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:query')") + public CommonResult> selectListWithPermission(@Valid ReportDocumentTypePageReqVO pageReqVO) { + pageReqVO.setPermissionFilterFlag("1"); + pageReqVO.setSrcPermissionType(QmsPermissionConstant.REPORT_DOCUMENT_TYPE_START); + + //查询权限 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long userId = loginUser.getId(); + CommonResult> roleRet = permissionApi.getUserRoleIdListByUserId(userId); + Set roleIds = roleRet.getData(); + pageReqVO.setRoleIds(roleIds); + List list = reportDocumentTypeService.selectListWithPermission(pageReqVO); + return success(BeanUtils.toBean(list, ReportDocumentTypeRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出报告类型配置 Excel") + //@PreAuthorize("@ss.hasPermission('qms:report-document-type:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportReportDocumentTypeExcel(@Valid ReportDocumentTypePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = reportDocumentTypeService.getReportDocumentTypePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "报告类型配置.xls", "数据", ReportDocumentTypeRespVO.class, + BeanUtils.toBean(list, ReportDocumentTypeRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java new file mode 100644 index 0000000..5c66fdf --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataPageReqVO.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测报告明细分页 Request VO") +@Data +public class ReportDocumentDataPageReqVO extends PageParam { + + @Schema(description = "报告ID", example = "13627") + private Long mainId; + + @Schema(description = "原始数据ID", example = "19655") + private Long sourceId; + + @Schema(description = "数据内容") + private String documentContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "附加内容") + private String externalContent; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "样品大类名称") + private String baseSampleName; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java new file mode 100644 index 0000000..ebc981a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataRespVO.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 检测报告明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ReportDocumentDataRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3054") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13627") + @ExcelProperty("报告ID") + private Long mainId; + + @Schema(description = "原始数据ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19655") + @ExcelProperty("原始数据ID") + private Long sourceId; + + @Schema(description = "数据内容") + @ExcelProperty("数据内容") + private String documentContent; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "附加内容") + @ExcelProperty("附加内容") + private String externalContent; + + @Schema(description = "样品编号") + @ExcelProperty("样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + @ExcelProperty("样品名称") + private String sampleName; + + @Schema(description = "样品大类名称") + @ExcelProperty("样品大类名称") + private String baseSampleName; + + //==================扩展字段=========== + + @Schema(description = "样品创建时间") + @ExcelProperty("样品创建时间") + private LocalDateTime baseSampleCreateTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java new file mode 100644 index 0000000..72b9a26 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentDataSaveReqVO.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +@Schema(description = "管理后台 - 检测报告明细新增/修改 Request VO") +@Data +public class ReportDocumentDataSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3054") + private Long id; + + @Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13627") + @NotNull(message = "报告ID不能为空") + private Long mainId; + + @Schema(description = "原始数据ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19655") + @NotNull(message = "原始数据ID不能为空") + private Long sourceId; + + @Schema(description = "数据内容") + private String documentContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "附加内容") + private String externalContent; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "样品大类名称") + private String baseSampleName; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationPageReqVO.java new file mode 100644 index 0000000..3a7a7aa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationPageReqVO.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测报告关系表分页 Request VO") +@Data +public class ReportDocumentMainCorrelationPageReqVO extends PageParam { + + @Schema(description = "报告id", example = "21148") + private Long mainId; + + @Schema(description = "关联id", example = "24996") + private Long correlationId; + + @Schema(description = "关联类型", example = "2") + private String correlationType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationRespVO.java new file mode 100644 index 0000000..13d7340 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationRespVO.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 检测报告关系表 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ReportDocumentMainCorrelationRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27670") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "报告id", example = "21148") + @ExcelProperty("报告id") + private Long mainId; + + @Schema(description = "关联id", example = "24996") + @ExcelProperty("关联id") + private Long correlationId; + + @Schema(description = "关联类型", example = "2") + @ExcelProperty("关联类型") + private String correlationType; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationSaveReqVO.java new file mode 100644 index 0000000..3090264 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainCorrelationSaveReqVO.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@Schema(description = "管理后台 - 检测报告关系表新增/修改 Request VO") +@Data +public class ReportDocumentMainCorrelationSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27670") + private Long id; + + @Schema(description = "报告id", example = "21148") + private Long mainId; + + @Schema(description = "关联id", example = "24996") + private Long correlationId; + + @Schema(description = "关联类型", example = "2") + private String correlationType; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java new file mode 100644 index 0000000..f738eac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainPageReqVO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 检测报告业务分页 Request VO") +@Data +public class ReportDocumentMainPageReqVO extends PageParam { + + @Schema(description = "流程实例ID", example = "10765") + private String flowInstanceId; + + @Schema(description = "报告类型ID", example = "2124") + private Long reportDocumentTypeId; + + @Schema(description = "流程模型Key") + private String flowKey; + + @Schema(description = "流程流水号") + private String flowSerialNumber; + + @Schema(description = "当前节点") + private String currentNode; + + @Schema(description = "报告编号") + private String documentCode; + + @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", example = "2") + private String documentType; + + @Schema(description = "报告标题") + private String documentTitle; + + @Schema(description = "报告配置项") + private String documentConfig; + + @Schema(description = "报告签名信息") + private String documentSignature; + + @Schema(description = "报告发起时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] documentStartTime; + + @Schema(description = "报告结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] documentEndTime; + + @Schema(description = "报告表单数据") + private String formData; + + @Schema(description = "审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束", example = "2") + private String flowStatus; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "发布状态") + private String publishStatus; + + @Schema(description = "发布人id") + private String publishUserId; + + @Schema(description = "发布人姓名") + private String publishUserName; + + @Schema(description = "发布时间") + private String publishTime; + + @Schema(description = "报表类型ID") + private Long configReportTypeId; + + @Schema(description = "表单设计器模板id") + private Long dataTemplateId; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java new file mode 100644 index 0000000..8c2fbff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainRespVO.java @@ -0,0 +1,116 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 检测报告业务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ReportDocumentMainRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6004") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "流程实例ID", example = "10765") + @ExcelProperty("流程实例ID") + private String flowInstanceId; + + @Schema(description = "报告类型ID", example = "2124") + @ExcelProperty("报告类型ID") + private Long reportDocumentTypeId; + + @Schema(description = "流程模型Key") + @ExcelProperty("流程模型Key") + private String flowKey; + + @Schema(description = "流程流水号") + @ExcelProperty("流程流水号") + private String flowSerialNumber; + + @Schema(description = "当前节点") + @ExcelProperty("当前节点") + private String currentNode; + + @Schema(description = "报告编号") + @ExcelProperty("报告编号") + private String documentCode; + + @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告") + @Dict(dicCode = "jy_doc_main_type") + private String documentType; + + @Schema(description = "报告标题", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("报告标题") + private String documentTitle; + + @Schema(description = "报告配置项") + @ExcelProperty("报告配置项") + private String documentConfig; + + @Schema(description = "报告签名信息") + @ExcelProperty("报告签名信息") + private String documentSignature; + + @Schema(description = "报告发起时间") + @ExcelProperty("报告发起时间") + private LocalDateTime documentStartTime; + + @Schema(description = "报告结束时间") + @ExcelProperty("报告结束时间") + private LocalDateTime documentEndTime; + + @Schema(description = "报告表单数据") + @ExcelProperty("报告表单数据") + private String formData; + + @Schema(description = "审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束") + private String flowStatus; + + @Schema(description = "作废标识:0-有效;1-作废") + @ExcelProperty("作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "发布状态") + @ExcelProperty("发布状态") + private String publishStatus; + + @Schema(description = "发布人id") + @ExcelProperty("发布人id") + private String publishUserId; + + @Schema(description = "发布人姓名") + @ExcelProperty("发布人姓名") + private String publishUserName; + + @Schema(description = "发布时间") + @ExcelProperty("发布时间") + private String publishTime; + + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15805") + @ExcelProperty("报表类型ID") + private Long configReportTypeId; + + @Schema(description = "表单设计器模板id") + @ExcelProperty("表单设计器模板id") + private Long dataTemplateId; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java new file mode 100644 index 0000000..e4011eb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentMainSaveReqVO.java @@ -0,0 +1,101 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Schema(description = "管理后台 - 检测报告业务新增/修改 Request VO") +@Data +public class ReportDocumentMainSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6004") + private Long id; + + @Schema(description = "流程实例ID", example = "10765") + private String flowInstanceId; + + @Schema(description = "报告类型ID", example = "2124") + private Long reportDocumentTypeId; + + @Schema(description = "流程模型Key") + private String flowKey; + + @Schema(description = "流程流水号") + private String flowSerialNumber; + + @Schema(description = "当前节点") + private String currentNode; + + @Schema(description = "报告编号") + private String documentCode; + + @Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + private String documentType; + + @Schema(description = "报告标题", requiredMode = Schema.RequiredMode.REQUIRED) + private String documentTitle; + + @Schema(description = "报告配置项") + private String documentConfig; + + @Schema(description = "报告签名信息") + private String documentSignature; + + @Schema(description = "报告发起时间") + private LocalDateTime documentStartTime; + + @Schema(description = "报告结束时间") + private LocalDateTime documentEndTime; + + @Schema(description = "报告表单数据") + private String formData; + + @Schema(description = "审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + private String flowStatus; + + @Schema(description = "作废标识:0-有效;1-作废") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "发布状态") + private String publishStatus; + + @Schema(description = "发布人id") + private String publishUserId; + + @Schema(description = "发布人姓名") + private String publishUserName; + + @Schema(description = "发布时间") + private String publishTime; + + @Schema(description = "报表类型ID") + private Long configReportTypeId; + + @Schema(description = "报表数据ids") + private String businessAssayReportDataIds; + + @Schema(description = "报告明细数据ids") + private String reportDocumentDataIds; + + @Schema(description = "表单设计器模板id") + private Long dataTemplateId; + + + //====================附加属性============================== + @Schema(description = "委托id,支持多值") + private String businessSampleEntrustRegistrationIds; + + @Schema(description = "报表数据明细,用于保存【备注】等数据") + private List reportDocumentDataList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypePageReqVO.java new file mode 100644 index 0000000..fba5c1f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypePageReqVO.java @@ -0,0 +1,84 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.Set; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 报告类型配置分页 Request VO") +@Data +public class ReportDocumentTypePageReqVO extends PageParam { + + @Schema(description = "报表类型ID", example = "9447") + private Long configReportTypeId; + + @Schema(description = "类型名称", example = "赵六") + private String name; + + @Schema(description = "流程key") + private String flowKey; + + @Schema(description = "报告模板key") + private String reportKey; + + @Schema(description = "报告编号规则") + private String codeRule; + + @Schema(description = "报告分类") + private String documentType; + + @Schema(description = "权限") + private Integer permission; + + @Schema(description = "样品数量", example = "30323") + private Integer sampleCount; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "是否最新版本") + private Integer currentFlag; + + @Schema(description = "主id") + private Long mainId; + + @Schema(description = "前端组件") + private String pageComponent; + + @Schema(description = "前端组件(移动端)") + private String pageComponentMobile; + + //===================扩展属性===================== + @Schema(description = "查询时进行权限过滤") + private String permissionFilterFlag; + + @Schema(description = "查询用-权限角色") + private Set roleIds; + + @Schema(description = "查询用-源权限类型") + private String srcPermissionType; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeRespVO.java new file mode 100644 index 0000000..b4335d8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeRespVO.java @@ -0,0 +1,99 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Schema(description = "管理后台 - 报告类型配置 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ReportDocumentTypeRespVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9014") + @ExcelProperty("ID") + private Long id; + + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9447") + @ExcelProperty("报表类型ID") + private Long configReportTypeId; + + @Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("类型名称") + private String name; + + @Schema(description = "流程key", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("流程key") + private String flowKey; + + @Schema(description = "报告模板key", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("报告模板key") + private String reportKey; + + @Schema(description = "报告编号规则", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("报告编号规则") + private String codeRule; + + @Schema(description = "报告分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("报告分类") + @Dict(dicCode = "jy_doc_main_type") + private String documentType; + + @Schema(description = "权限") + @ExcelProperty("权限") + private Integer permission; + + @Schema(description = "样品数量", example = "30323") + @ExcelProperty("样品数量") + private Integer sampleCount; + + @Schema(description = "其他配置") + @ExcelProperty("其他配置") + private String customConfig; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "是否最新版本") + @ExcelProperty("是否最新版本") + private String currentFlag; + + @Schema(description = "主id") + @ExcelProperty("主id") + private Long mainId; + + @Schema(description = "前端组件") + @ExcelProperty("前端组件") + private String pageComponent; + + @Schema(description = "前端组件(移动端)") + @ExcelProperty("前端组件(移动端)") + private String pageComponentMobile; + + //===========扩展字段======================= + @Schema(description = "权限列表") + List permissionList; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeSaveReqVO.java new file mode 100644 index 0000000..2330bec --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/controller/vo/ReportDocumentTypeSaveReqVO.java @@ -0,0 +1,83 @@ +package com.zt.plat.module.qms.business.reportdoc.controller.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.util.List; + +@Schema(description = "管理后台 - 报告类型配置新增/修改 Request VO") +@Data +public class ReportDocumentTypeSaveReqVO { + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9014") + private Long id; + + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9447") + @NotNull(message = "报表类型ID不能为空") + private Long configReportTypeId; + + @Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "类型名称不能为空") + private String name; + + @Schema(description = "流程key", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "流程key不能为空") + private String flowKey; + + @Schema(description = "报告模板key", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "报告模板key不能为空") + private String reportKey; + + @Schema(description = "报告编号规则", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "报告编号规则不能为空") + private String codeRule; + + @Schema(description = "报告分类,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "报告分类,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告不能为空") + private String documentType; + + @Schema(description = "权限") + private Integer permission; + + @Schema(description = "样品数量", example = "30323") + private Integer sampleCount; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer version; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "是否最新版本") + private Integer currentFlag; + + @Schema(description = "是否创建新版本") + private String newVersionFlag; + + @Schema(description = "主id") + private Long mainId; + + @Schema(description = "前端组件") + private String pageComponent; + + @Schema(description = "前端组件(移动端)") + private String pageComponentMobile; + + //===========扩展字段======================= + @Schema(description = "权限列表") + List permissionList; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java new file mode 100644 index 0000000..c590366 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentDataDO.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; + +import java.time.LocalDateTime; + +/** +* 检测报告明细 DO +* +* @author 后台管理 +*/ +@TableName("t_rpt_doc_dat") +@KeySequence("t_rpt_doc_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ReportDocumentDataDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 报告ID + */ + @TableField("MAIN_ID") + private Long mainId; + /** + * 原始数据ID + */ + @TableField("SRC_ID") + private Long sourceId; + /** + * 数据内容 + */ + @TableField("DOC_CNTT") + private String documentContent; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + /** + * 附加内容 + */ + @TableField("EXT_CNTT") + private String externalContent; + + //样品编号 + @TableField("SMP_CD") + private String sampleCode; + + //样品名称 + @TableField("SMP_NAME") + private String sampleName; + + //样品大类名称 + @TableField("BSE_SMP_NAME") + private String baseSampleName; + + + + //==================扩展字段=========== + + //样品创建时间 + @TableField(exist = false) + private LocalDateTime baseSampleCreateTime; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainCorrelationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainCorrelationDO.java new file mode 100644 index 0000000..67e43e9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainCorrelationDO.java @@ -0,0 +1,57 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 检测报告关系表 DO +* +* @author 后台管理 +*/ +@TableName("t_rpt_doc_main_corr") +@KeySequence("t_rpt_doc_main_corr_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ReportDocumentMainCorrelationDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 报告id + */ + @TableField("MAIN_ID") + private Long mainId; + /** + * 关联id + */ + @TableField("CORR_ID") + private Long correlationId; + /** + * 关联类型 + */ + @TableField("CORR_TP") + private String correlationType; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java new file mode 100644 index 0000000..7657dfc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentMainDO.java @@ -0,0 +1,144 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; + +import java.time.LocalDateTime; +/** +* 检测报告业务 DO +* +* @author 后台管理 +*/ +@TableName("t_rpt_doc_main") +@KeySequence("t_rpt_doc_main_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class ReportDocumentMainDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 流程实例ID + */ + @TableField("FLW_INSC_ID") + private String flowInstanceId; + /** + * 报告类型ID + */ + @TableField("RPT_DOC_TP") + private Long reportDocumentTypeId; + /** + * 流程模型Key + */ + @TableField("FLW_KY") + private String flowKey; + /** + * 流程流水号 + */ + @TableField("FLW_SRL_NUM") + private String flowSerialNumber; + /** + * 当前节点 + */ + @TableField("CRNT_NDE") + private String currentNode; + /** + * 报告编号 + */ + @TableField("DOC_CD") + private String documentCode; + /** + * 报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告 + */ + @TableField("DOC_TP") + private String documentType; + /** + * 报告标题 + */ + @TableField("DOC_TTL") + private String documentTitle; + /** + * 报告配置项 + */ + @TableField("DOC_CFG") + private String documentConfig; + /** + * 报告签名信息 + */ + @TableField("DOC_SIG") + private String documentSignature; + /** + * 报告发起时间 + */ + @TableField("DOC_STRT_TM") + private LocalDateTime documentStartTime; + /** + * 报告结束时间 + */ + @TableField("DOC_END_TM") + private LocalDateTime documentEndTime; + /** + * 报告表单数据 + */ + @TableField("FORM_DAT") + private String formData; + /** + * 审批状态,【字典】【jy_doc_main_status】待编制、审批中、已结束 + */ + @TableField("FLW_STS") + private String flowStatus; + /** + * 作废标识:0-有效;1-作废 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + //发布状态 + @TableField("PUB_STS") + private String publishStatus; + + //发布人id + @TableField("PUB_USER_ID") + private String publishUserId; + + //发布人姓名 + @TableField("PUB_USER_NAME") + private String publishUserName; + + //发布时间 + @TableField("PUB_USER_TIME") + private String publishTime; + + /** + * 报表类型ID + */ + @TableField("CFG_RPT_TP_ID") + private Long configReportTypeId; + + //表单设计器模板id + @TableField("DAT_TMPL_ID") + private Long dataTemplateId; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentTypeDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentTypeDO.java new file mode 100644 index 0000000..4d71bac --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/dataobject/ReportDocumentTypeDO.java @@ -0,0 +1,116 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.dataobject; + +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import lombok.*; +/** + * 报告类型配置 DO + * + * @author 后台管理 + */ +@TableName("t_rpt_doc_tp") +@KeySequence("t_rpt_doc_tp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** + * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO + */ +public class ReportDocumentTypeDO extends BusinessBaseDO { + + + + /** + * ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 报表类型ID + */ + @TableField("CFG_RPT_TP_ID") + private Long configReportTypeId; + /** + * 类型名称 + */ + @TableField("NAME") + private String name; + /** + * 流程key + */ + @TableField("FLW_KY") + private String flowKey; + /** + * 报告模板key + */ + @TableField("RPT_KY") + private String reportKey; + /** + * 报告编号规则 + */ + @TableField("CD_RUL") + private String codeRule; + /** + * 报告分类,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告 + */ + @TableField("DOC_TP") + private String documentType; + /** + * 权限 + */ + @TableField("PERM") + private Integer permission; + /** + * 样品数量 + */ + @TableField("SMP_CNT") + private Integer sampleCount; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + + /** + * 是否最新版本,默认显示最新版本 + */ + @TableField("CRNT_FLG") + private Integer currentFlag; + + //主id + @TableField("MAIN_ID") + private Long mainId; + + //前端组件 + @TableField("PG_CPNT") + private String pageComponent; + + //前端组件-移动 + @TableField("PG_CPNT_MOB") + private String pageComponentMobile; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentDataMapper.java new file mode 100644 index 0000000..8971467 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentDataMapper.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测报告明细 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ReportDocumentDataMapper extends BaseMapperX { + + default PageResult selectPage(ReportDocumentDataPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ReportDocumentDataDO::getMainId, reqVO.getMainId()) + .eqIfPresent(ReportDocumentDataDO::getSourceId, reqVO.getSourceId()) + .eqIfPresent(ReportDocumentDataDO::getDocumentContent, reqVO.getDocumentContent()) + .eqIfPresent(ReportDocumentDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ReportDocumentDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ReportDocumentDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(ReportDocumentDataDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainCorrelationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainCorrelationMapper.java new file mode 100644 index 0000000..3dfe62f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainCorrelationMapper.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationPageReqVO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 检测报告关系表 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ReportDocumentMainCorrelationMapper extends BaseMapperX { + + default PageResult selectPage(ReportDocumentMainCorrelationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ReportDocumentMainCorrelationDO::getMainId, reqVO.getMainId()) + .eqIfPresent(ReportDocumentMainCorrelationDO::getCorrelationId, reqVO.getCorrelationId()) + .eqIfPresent(ReportDocumentMainCorrelationDO::getCorrelationType, reqVO.getCorrelationType()) + .eqIfPresent(ReportDocumentMainCorrelationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ReportDocumentMainCorrelationDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ReportDocumentMainCorrelationDO::getRemark, reqVO.getRemark()) + .orderByDesc(ReportDocumentMainCorrelationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java new file mode 100644 index 0000000..c39426b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentMainMapper.java @@ -0,0 +1,55 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.ObjectUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 检测报告业务 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ReportDocumentMainMapper extends BaseMapperX { + + + default PageResult selectPage(ReportDocumentMainPageReqVO reqVO) { + String flowStatus = reqVO.getFlowStatus(); + + LambdaQueryWrapperX wrapper = new LambdaQueryWrapperX<>(); + wrapper.ne(ReportDocumentMainDO::getCancelFlag, -1); //-1为临时数据 + wrapper.eqIfPresent(ReportDocumentMainDO::getFlowInstanceId, reqVO.getFlowInstanceId()); + wrapper.eqIfPresent(ReportDocumentMainDO::getReportDocumentTypeId, reqVO.getReportDocumentTypeId()); + wrapper.eqIfPresent(ReportDocumentMainDO::getFlowKey, reqVO.getFlowKey()); + wrapper.eqIfPresent(ReportDocumentMainDO::getFlowSerialNumber, reqVO.getFlowSerialNumber()); + wrapper.eqIfPresent(ReportDocumentMainDO::getCurrentNode, reqVO.getCurrentNode()); + wrapper.eqIfPresent(ReportDocumentMainDO::getDocumentCode, reqVO.getDocumentCode()); + wrapper.eqIfPresent(ReportDocumentMainDO::getDocumentType, reqVO.getDocumentType()); + wrapper.eqIfPresent(ReportDocumentMainDO::getDocumentTitle, reqVO.getDocumentTitle()); + wrapper.eqIfPresent(ReportDocumentMainDO::getDocumentConfig, reqVO.getDocumentConfig()); + wrapper.eqIfPresent(ReportDocumentMainDO::getDocumentSignature, reqVO.getDocumentSignature()); + wrapper.betweenIfPresent(ReportDocumentMainDO::getDocumentStartTime, reqVO.getDocumentStartTime()); + wrapper.betweenIfPresent(ReportDocumentMainDO::getDocumentEndTime, reqVO.getDocumentEndTime()); + wrapper.eqIfPresent(ReportDocumentMainDO::getFormData, reqVO.getFormData()); +// wrapper.eqIfPresent(ReportDocumentMainDO::getFlowStatus, reqVO.getFlowStatus()); + if(!ObjectUtils.isEmpty(flowStatus)){ + List statusList = Arrays.asList(flowStatus.split(",")); + wrapper.in(ReportDocumentMainDO::getFlowStatus, statusList); + } + wrapper.eqIfPresent(ReportDocumentMainDO::getCancelFlag, reqVO.getCancelFlag()); + wrapper.eqIfPresent(ReportDocumentMainDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()); + wrapper.betweenIfPresent(ReportDocumentMainDO::getCreateTime, reqVO.getCreateTime()); + wrapper.eqIfPresent(ReportDocumentMainDO::getRemark, reqVO.getRemark()); + wrapper.orderByDesc(ReportDocumentMainDO::getId); + return selectPage(reqVO, wrapper); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentTypeMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentTypeMapper.java new file mode 100644 index 0000000..b8d967c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/dal/mapper/ReportDocumentTypeMapper.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.business.reportdoc.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 报告类型配置 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface ReportDocumentTypeMapper extends BaseMapperX { + + default PageResult selectPage(ReportDocumentTypePageReqVO reqVO) { + LambdaQueryWrapperX wrapper = new LambdaQueryWrapperX<>(); + wrapper.eqIfPresent(ReportDocumentTypeDO::getConfigReportTypeId, reqVO.getConfigReportTypeId()); + wrapper.likeIfPresent(ReportDocumentTypeDO::getName, reqVO.getName()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getMainId, reqVO.getMainId()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getCurrentFlag, reqVO.getCurrentFlag()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getFlowKey, reqVO.getFlowKey()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getReportKey, reqVO.getReportKey()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getCodeRule, reqVO.getCodeRule()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getDocumentType, reqVO.getDocumentType()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getPermission, reqVO.getPermission()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getSampleCount, reqVO.getSampleCount()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getCustomConfig, reqVO.getCustomConfig()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()); + wrapper.betweenIfPresent(ReportDocumentTypeDO::getCreateTime, reqVO.getCreateTime()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getRemark, reqVO.getRemark()); + wrapper.eqIfPresent(ReportDocumentTypeDO::getVersion, reqVO.getVersion()); + wrapper.likeIfPresent(ReportDocumentTypeDO::getPageComponent, reqVO.getPageComponent()); + wrapper.likeIfPresent(ReportDocumentTypeDO::getPageComponentMobile, reqVO.getPageComponentMobile()); + wrapper.orderByDesc(ReportDocumentTypeDO::getId); + if(reqVO.getMainId() != null){ + wrapper.orderByDesc(ReportDocumentTypeDO::getVersion); + } + wrapper.orderByAsc(ReportDocumentTypeDO::getSortNo); + return selectPage(reqVO, wrapper); + + } + + List selectListWithPermission(@Param("param") ReportDocumentTypePageReqVO param); + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/DynamicReportDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/DynamicReportDataService.java new file mode 100644 index 0000000..599b92c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/DynamicReportDataService.java @@ -0,0 +1,7 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +/** + * 动态报表数据接口 + * */ +public interface DynamicReportDataService { +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java new file mode 100644 index 0000000..71b6397 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataService.java @@ -0,0 +1,81 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 检测报告明细 Service 接口 + * + * @author 后台管理 + */ +public interface ReportDocumentDataService { + + CommonResult> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig); + + CommonResult> listByMainDataId(Long mainDataId); + CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds); + + + + /** + * 创建检测报告明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ReportDocumentDataRespVO createReportDocumentData(@Valid ReportDocumentDataSaveReqVO createReqVO); + + + CommonResult insertBatch(List list); + + void deleteByMainId(Long mainId); + + /** + * 更新检测报告明细 + * + * @param updateReqVO 更新信息 + */ + void updateReportDocumentData(@Valid ReportDocumentDataSaveReqVO updateReqVO); + + void updateBatch(List list); + + /** + * 删除检测报告明细 + * + * @param id 编号 + */ + void deleteReportDocumentData(Long id); + + /** + * 批量删除检测报告明细 + * + * @param ids 编号 + */ + void deleteReportDocumentDataListByIds(List ids); + + /** + * 获得检测报告明细 + * + * @param id 编号 + * @return 检测报告明细 + */ + ReportDocumentDataDO getReportDocumentData(Long id); + + /** + * 获得检测报告明细分页 + * + * @param pageReqVO 分页查询 + * @return 检测报告明细分页 + */ + PageResult getReportDocumentDataPage(ReportDocumentDataPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java new file mode 100644 index 0000000..d44beb8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -0,0 +1,555 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportFieldPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO; +import com.zt.plat.module.qms.business.config.service.ConfigReportFieldService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentDataMapper; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_DATA_NOT_EXISTS; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS; +import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_DYNAMIC; +import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_FIXED; + +/** + * 检测报告明细 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ReportDocumentDataServiceImpl implements ReportDocumentDataService { + + @Resource private ReportDocumentDataMapper reportDocumentDataMapper; + @Resource private ConfigReportFieldService configReportFieldService; + private final String colPrefix = "col"; + private final String sampleCodeKey = "SMP_CD"; + private final String sampleNameKey = "SMP_NAME"; + private final String name_code_merge = "merge"; + private final String name_code_name = "name"; + private final String name_code_code = "code"; + private final String name_code_split = "split"; + private final String rangeKey = "minLimitValue"; + + + + /* + * 组装动态报表数据 + * */ + @Override + public CommonResult> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO typeDO) { + if(typeDO == null || typeDO.getConfigReportTypeId() == null) + return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "报告配置为空,或未配置报表类型,请联系管理员处理!"); + String customConfig = typeDO.getCustomConfig(); + //查询报表字段配置 + ConfigReportFieldPageReqVO fieldParam = new ConfigReportFieldPageReqVO(); + fieldParam.setConfigReportTypeId(typeDO.getConfigReportTypeId()); + fieldParam.setPageSize(9999); + List fieldListAll = configReportFieldService.getConfigReportFieldPage(fieldParam).getList(); + if(fieldListAll.isEmpty()) + return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "未配置报表字段,请联系管理员处理!"); + List dataList = listByMainDataId(mainData.getId()).getData(); + //处理字段,提取有数据的字段 + List fieldList = new ArrayList<>(); + List hasFields = new ArrayList<>(); + for(ConfigReportFieldDO fieldDO : fieldListAll){ + String field = fieldDO.getField(); + String fieldName = fieldDO.getFieldName(); + String fieldType = fieldDO.getFieldType(); + //先处理固定列 + if(FIELD_FIXED.equals(fieldType)){ + if(!hasFields.contains( field)){ + fieldList.add(fieldDO); + hasFields.add(field); + } + continue; + } + for(ReportDocumentDataDO dataDO : dataList){ + String documentContent = dataDO.getDocumentContent(); + JSONObject dataJson = JSONObject.parseObject(documentContent); + if(dataJson.containsKey(field)){ + if(!hasFields.contains( fieldName)){ + fieldList.add(fieldDO); + hasFields.add(fieldName); + } + } + } + } + + //组装数据 + List step1Arr = assembleStep1(fieldList, dataList, customConfig); //处理后的组数对象 + return CommonResult.success(step1Arr); + } + + /** + * 将数据按colCount分组。返回2维数组 + * @param fieldList 要显示的字段列表。固定字段在最前 + * @param customConfig 报告配置项 + * */ + private List assembleStep1(List fieldList, List dataList, String customConfig){ + if(dataList.isEmpty()) + return new ArrayList<>(); + JSONObject jsonObject = JSONObject.parseObject(customConfig); + Integer dynamicColCount = 3; + Integer fixedColCount = 3; + Integer maxRowCount = 3; + String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 + String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 + String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 + String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 + String hasRange = jsonObject.getString("hasRange"); //是否有检出限 + String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表 + if("1".equals(verticalFlag)){ + return assembleVerticalData(fieldList, dataList, customConfig); + } + + if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr); + if(!ObjectUtils.isEmpty(fixedColCountStr)) fixedColCount = Integer.parseInt(fixedColCountStr); + + if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); + Integer eleCount = 0; //元素数量,即元素列总数 + + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldType = fieldDO.getFieldType(); + if(FIELD_DYNAMIC.equals(fieldType)) + eleCount ++; + } + Integer rowCountOneSample = eleCount / dynamicColCount + (eleCount % dynamicColCount == 0 ? 0 : 1); //每个样品要占的行数 + Integer colCountOneSample = fixedColCount + dynamicColCount; //每个样品要占的列数 + Integer dataLength = dataList.size(); + Integer emptyRowCount = dataLength < maxRowCount ? 1 : 0; //空行数 + Integer allRowCount = 1 + dataLength + emptyRowCount + 1; //标题 + 样品数 + 空行 + + if("1".equals(hasRange)) + emptyRowCount ++; + + if(rowCountOneSample > 1){ + allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行 + } + List rowList = new ArrayList<>(Arrays.asList(new JSONObject[allRowCount + 1])); + + //=============处理表头============ + JSONObject t = new JSONObject(); + JSONObject r = new JSONObject(); //检出限 + int rowAssist = 1; + int colIndex = fixedColCount + 1; + boolean lastObjFlag = true; + //取第一行数据,用来处理检出限 + JSONObject firstData = new JSONObject(); //取第一行数据,用于处理检出限 + if(dataLength > 0) + firstData = JSONObject.parseObject(dataList.get(0).getDocumentContent()); + if("1".equals(hasRemark)){ + //在最后一列增加备注 + t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注"); + } + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldType = fieldDO.getFieldType(); + String field = fieldDO.getField(); + if(FIELD_FIXED.equals(fieldType)){ //这里只处理动态列。固定列在 addTitleToRowList 处理 + continue; + } + String fieldName = fieldDO.getFieldName(); + String colKey = parseNumToString(colIndex, 2); + t.put(colPrefix + colKey, fieldName); + //查询当前字段的检出限 + JSONObject fieldObj = firstData.getJSONObject( field); + String rangeVal = ""; + if(fieldObj != null){ + rangeVal = fieldObj.getString(rangeKey); + } + r.put(colPrefix + colKey, rangeVal); + r.put(colPrefix + "01", "方法检出限"); + lastObjFlag = true; + if(colIndex % colCountOneSample == 0){ + addTitleToRowList(nameCodeType, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); + if("1".equals(hasRange)) + addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); + t = new JSONObject(); + r = new JSONObject(); + + if("1".equals(hasRemark)){ + //在最后一列增加备注 + t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注"); + } + rowAssist++; + colIndex = fixedColCount + 1; //第二组以后,从固定列数开始 + lastObjFlag = false; + continue; + } + colIndex++; + } + if(lastObjFlag){ + addTitleToRowList(nameCodeType, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList); + if("1".equals(hasRange)) + addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList); + } + + //=============处理数据============ + int dataIndex = 1; + for(ReportDocumentDataDO dataDO : dataList){ + String documentContent = dataDO.getDocumentContent(); + String externalContent = dataDO.getExternalContent(); + JSONObject s = JSONObject.parseObject(documentContent); + JSONObject e = new JSONObject(); + if(!ObjectUtils.isEmpty(externalContent)){ + e = JSONObject.parseObject(externalContent); + } + String remark = e.getString("remark"); + colIndex = fixedColCount + 1; + rowAssist = 1; + t = new JSONObject(); + if("1".equals(hasRemark)){ + t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark); + } + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldType = fieldDO.getFieldType(); + if(FIELD_FIXED.equals(fieldType)){ //这里只处理动态列。固定列在 addDataToRowList 处理 + continue; + } + String field = fieldDO.getField(); + String colKey = parseNumToString(colIndex, 2); + JSONObject fieldObj = s.getJSONObject( field); + String fieldValue = ""; + String mathSymbol = ""; + if(fieldObj != null){ + fieldValue = fieldObj.getString("fieldValue"); + mathSymbol = fieldObj.getString("mathSymbol"); + } + if(!ObjectUtils.isEmpty(mathSymbol) && !"=".equals(mathSymbol)) + fieldValue = mathSymbol + fieldValue; + t.put(colPrefix + colKey, fieldValue); + lastObjFlag = true; + if(colIndex % colCountOneSample == 0){ + addDataToRowList(nameCodeType, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); + t = new JSONObject(); + if("1".equals(hasRemark)){ + t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark); + } + rowAssist++; + colIndex = fixedColCount + 1; //第二组以后,从固定列数开始 + lastObjFlag = false; + continue; + } + colIndex++; + } + if(lastObjFlag){ + addDataToRowList(nameCodeType, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList); + } + dataIndex ++; + } + + //==============以下为空白================= + //实际使用行数小于总行数,显示“”以下为空白“ + if(dataIndex < maxRowCount){ + String colKey = colPrefix + "01"; + t = new JSONObject(); + t.put(colKey, "以下为空白"); + int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 2; + if(rowAssist == 1) + rowIndex = dataLength + emptyRowCount; + rowList.set(rowIndex, t.clone()); + } + //前面的计数是从1开始,移除第一个元素 + if(!rowList.isEmpty()) + rowList.remove(0); + return rowList; + } + + /** + * @param nameCodeType: merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + * + * */ + private void addTitleToRowList(String nameCodeType, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, + List rowList, List fieldList){ + int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + 1; //(标题 + 数据行 + 空行) + //处理固定列 + int index = 1; + String colKey = parseNumToString(index, 2); + if(name_code_merge.equals(nameCodeType)){ + t.put(colPrefix + colKey, "样品名称及编号"); + rowList.set(rowIndex, t.clone()); + return; + } + if(name_code_name.equals(nameCodeType)){ + t.put(colPrefix + colKey, "样品名称"); + rowList.set(rowIndex, t.clone()); + return; + } + if(name_code_code.equals(nameCodeType)){ + t.put(colPrefix + colKey, "样品编号"); + rowList.set(rowIndex, t.clone()); + return; + } + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldName = fieldDO.getFieldName(); + String fieldType = fieldDO.getFieldType(); + if(FIELD_DYNAMIC.equals(fieldType)) + continue; + colKey = parseNumToString(index, 2); + t.put(colPrefix + colKey, fieldName); + index++; + } + rowList.set(rowIndex, t.clone()); + } + + /** + * 处理检出限 + * 如果是 + * */ + private void addRangeToRowList(Integer rowAssist, JSONObject r, Integer dataLength, Integer emptyRowCount, List rowList){ + int rowIndex = (dataLength + emptyRowCount + 1 ) * (rowAssist); + rowList.set(rowIndex, r.clone()); + } + + + private void addDataToRowList(String nameCodeType, ReportDocumentDataDO dataDO, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, Integer dataIndex, List rowList, List fieldList){ + int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + dataIndex + 1; //(标题 + 数据行 + 空行) + t.put("id", dataDO.getId()); + //处理固定列 + int index = 1; + //处理固定列 + String colKey = parseNumToString(index, 2); + if(name_code_merge.equals(nameCodeType)){ + String merge = dataDO.getSampleName() + " " + dataDO.getSampleCode(); + t.put(colPrefix + colKey, merge); + rowList.set(rowIndex, t.clone()); + return; + } + if(name_code_name.equals(nameCodeType)){ + t.put(colPrefix + colKey, dataDO.getSampleName()); + rowList.set(rowIndex, t.clone()); + return; + } + if(name_code_code.equals(nameCodeType)){ + t.put(colPrefix + colKey, dataDO.getSampleCode()); + rowList.set(rowIndex, t.clone()); + return; + } + for(ConfigReportFieldDO fieldDO : fieldList){ + String fieldName = fieldDO.getFieldName(); + String fieldType = fieldDO.getFieldType(); + String field = fieldDO.getField(); + if(FIELD_FIXED.equals(fieldType)){ + colKey = parseNumToString(index, 2); + String val = ""; + if(sampleNameKey.equals( field)) + val = dataDO.getSampleName(); + else if(sampleCodeKey.equals( field)) + val = dataDO.getSampleCode(); + t.put(colPrefix + colKey, val); + index++; + } + } + rowList.set(rowIndex, t.clone()); + } + private String parseNumToString(int num, int len){ + StringBuilder sb = new StringBuilder(); + for(int i = 0; i < len - String.valueOf(num).length(); i++){ + sb.append("0"); + } + return sb.append(num).toString(); + } + + /** + * 组装纵表数据 + * 第1列固定为:元素; 第2列:方法检出限(%);第三列开始为各个样品 + * */ + private List assembleVerticalData(List fieldList, List dataList, String customConfig){ + JSONObject jsonObject = JSONObject.parseObject(customConfig); + Integer dynamicColCount = 3; + Integer fixedColCount = 2; + Integer maxRowCount = 3; + String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量 + String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量 + String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数 + String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示 + String hasRemark = jsonObject.getString("hasRemark"); //是否有备注 + String hasRange = jsonObject.getString("hasRange"); //是否有检出限 + //取数据第一行,用于处理方法检出限 + String content = ""; + if(!ObjectUtils.isEmpty(dataList)) + content = dataList.get(0).getDocumentContent(); + JSONObject firstData = new JSONObject(); + if(!ObjectUtils.isEmpty(content)){ + firstData = JSONObject.parseObject(content); + } + List rowList = new ArrayList<>(); + //处理第一行-样品编号 + int colIndex = fixedColCount + 1; + int rowIndex = 1; + JSONObject t = new JSONObject(); + for(ReportDocumentDataDO dataDO : dataList){ + String colKey = parseNumToString(colIndex, 2); + t.put(colPrefix + colKey, dataDO.getSampleCode()); + colIndex++; + } + rowList.add(t); + //处理其他行 + rowIndex = 1; + for(ConfigReportFieldDO fieldDO : fieldList) { + t = new JSONObject(); + String fieldType = fieldDO.getFieldType(); + String field = fieldDO.getField(); + if (FIELD_FIXED.equals(fieldType)) { //这里只处理动态列。固定列在 addTitleToRowList 处理 + continue; + } + String fieldName = fieldDO.getFieldName(); + String colKey = ""; + t.put(colPrefix + "01", fieldName); //第1列:元素 + if("1".equals(hasRange)){ + //方法检出限 + JSONObject fieldObj = firstData.getJSONObject( field); + String rangeVal = ""; + if(fieldObj != null){ + rangeVal = fieldObj.getString(rangeKey); + } + t.put(colPrefix + "02", rangeVal); //第2列:检出限 + } + colIndex = fixedColCount + 1; + for(ReportDocumentDataDO dataDO : dataList){ + colKey = parseNumToString(colIndex, 2); + content = dataDO.getDocumentContent(); + JSONObject dataJson = new JSONObject(); + if(!ObjectUtils.isEmpty(content)){ + dataJson = JSONObject.parseObject(content); + } + JSONObject fieldObj = firstData.getJSONObject( field); + String fieldValue = ""; + String mathSymbol = ""; + if(fieldObj != null){ + fieldValue = fieldObj.getString("fieldValue"); + mathSymbol = fieldObj.getString("mathSymbol"); + } + if(!ObjectUtils.isEmpty(mathSymbol) && !"=".equals(mathSymbol)) + fieldValue = mathSymbol + fieldValue; + t.put(colPrefix + colKey, fieldValue); + colIndex++; + } + + rowList.add(t); + rowIndex ++; + } + return rowList; + } + + + @Override + public CommonResult> listByMainDataId(Long mainDataId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("MAIN_ID", mainDataId); + queryWrapper.orderByAsc("ID"); + List list = reportDocumentDataMapper.selectList(queryWrapper); + return CommonResult.success(list); + } + + @Override + public CommonResult removeByMainIdAndDetailIds(Long mainDataId, List detailIds) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("MAIN_ID", mainDataId); + queryWrapper.in("ID", detailIds); + reportDocumentDataMapper.delete(queryWrapper); + return CommonResult.success("移除成功"); + } + + @Override + public void deleteByMainId(Long mainId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("MAIN_ID", mainId); + reportDocumentDataMapper.delete(queryWrapper); + } + + @Override + public ReportDocumentDataRespVO createReportDocumentData(ReportDocumentDataSaveReqVO createReqVO) { + // 插入 + ReportDocumentDataDO reportDocumentData = BeanUtils.toBean(createReqVO, ReportDocumentDataDO.class); + reportDocumentDataMapper.insert(reportDocumentData); + // 返回 + return BeanUtils.toBean(reportDocumentData, ReportDocumentDataRespVO.class); + } + + @Override + public CommonResult insertBatch(List list) { + reportDocumentDataMapper.insertBatch(list); + return CommonResult.success("添加成功"); + } + + @Override + public void updateReportDocumentData(ReportDocumentDataSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentDataExists(updateReqVO.getId()); + // 更新 + ReportDocumentDataDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentDataDO.class); + reportDocumentDataMapper.updateById(updateObj); + } + + @Override + public void updateBatch(List list) { + List updateList = new ArrayList<>(); + for (ReportDocumentDataSaveReqVO updateReqVO : list) { + ReportDocumentDataDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentDataDO.class); + updateList.add(updateObj); + } + reportDocumentDataMapper.updateBatch(updateList); + } + + @Override + public void deleteReportDocumentData(Long id) { + // 校验存在 + validateReportDocumentDataExists(id); + // 删除 + reportDocumentDataMapper.deleteById(id); + } + + @Override + public void deleteReportDocumentDataListByIds(List ids) { + // 校验存在 + validateReportDocumentDataExists(ids); + // 删除 + reportDocumentDataMapper.deleteByIds(ids); + } + + private void validateReportDocumentDataExists(List ids) { + List list = reportDocumentDataMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(REPORT_DOCUMENT_DATA_NOT_EXISTS); + } + } + + private void validateReportDocumentDataExists(Long id) { + if (reportDocumentDataMapper.selectById(id) == null) { + throw exception(REPORT_DOCUMENT_DATA_NOT_EXISTS); + } + } + + @Override + public ReportDocumentDataDO getReportDocumentData(Long id) { + return reportDocumentDataMapper.selectById(id); + } + + @Override + public PageResult getReportDocumentDataPage(ReportDocumentDataPageReqVO pageReqVO) { + return reportDocumentDataMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java new file mode 100644 index 0000000..2a1c2be --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationService.java @@ -0,0 +1,70 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import java.util.*; + +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationPageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationSaveReqVO; +import jakarta.validation.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 检测报告关系表 Service 接口 + * + * @author 后台管理 + */ +public interface ReportDocumentMainCorrelationService { + + public static final String CorrelationType_entrust = "entrust"; + + List listByMainId(Long mainId); + + void deleteByMainId(Long mainId); + + /** + * 创建检测报告关系表 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ReportDocumentMainCorrelationRespVO createReportDocumentMainCorrelation(@Valid ReportDocumentMainCorrelationSaveReqVO createReqVO); + + /** + * 更新检测报告关系表 + * + * @param updateReqVO 更新信息 + */ + void updateReportDocumentMainCorrelation(@Valid ReportDocumentMainCorrelationSaveReqVO updateReqVO); + + /** + * 删除检测报告关系表 + * + * @param id 编号 + */ + void deleteReportDocumentMainCorrelation(Long id); + + /** + * 批量删除检测报告关系表 + * + * @param ids 编号 + */ + void deleteReportDocumentMainCorrelationListByIds(List ids); + + /** + * 获得检测报告关系表 + * + * @param id 编号 + * @return 检测报告关系表 + */ + ReportDocumentMainCorrelationDO getReportDocumentMainCorrelation(Long id); + + /** + * 获得检测报告关系表分页 + * + * @param pageReqVO 分页查询 + * @return 检测报告关系表分页 + */ + PageResult getReportDocumentMainCorrelationPage(ReportDocumentMainCorrelationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java new file mode 100644 index 0000000..d0188b5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainCorrelationServiceImpl.java @@ -0,0 +1,110 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationPageReqVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationRespVO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationSaveReqVO; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainCorrelationMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS; + +/** + * 检测报告关系表 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ReportDocumentMainCorrelationServiceImpl implements ReportDocumentMainCorrelationService { + + @Resource + private ReportDocumentMainCorrelationMapper reportDocumentMainCorrelationMapper; + + + @Override + public List listByMainId(Long mainId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ReportDocumentMainCorrelationDO::getMainId, mainId); + query.orderByAsc(ReportDocumentMainCorrelationDO::getId); + return reportDocumentMainCorrelationMapper.selectList(query); + } + + @Override + public ReportDocumentMainCorrelationRespVO createReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO createReqVO) { + // 插入 + ReportDocumentMainCorrelationDO reportDocumentMainCorrelation = BeanUtils.toBean(createReqVO, ReportDocumentMainCorrelationDO.class); + reportDocumentMainCorrelationMapper.insert(reportDocumentMainCorrelation); + // 返回 + return BeanUtils.toBean(reportDocumentMainCorrelation, ReportDocumentMainCorrelationRespVO.class); + } + + + @Override + public void deleteByMainId(Long mainId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(ReportDocumentMainCorrelationDO::getMainId, mainId); + reportDocumentMainCorrelationMapper.delete(query); + } + + @Override + public void updateReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentMainCorrelationExists(updateReqVO.getId()); + // 更新 + ReportDocumentMainCorrelationDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainCorrelationDO.class); + reportDocumentMainCorrelationMapper.updateById(updateObj); + } + + @Override + public void deleteReportDocumentMainCorrelation(Long id) { + // 校验存在 + validateReportDocumentMainCorrelationExists(id); + // 删除 + reportDocumentMainCorrelationMapper.deleteById(id); + } + + @Override + public void deleteReportDocumentMainCorrelationListByIds(List ids) { + // 校验存在 + validateReportDocumentMainCorrelationExists(ids); + // 删除 + reportDocumentMainCorrelationMapper.deleteByIds(ids); + } + + private void validateReportDocumentMainCorrelationExists(List ids) { + List list = reportDocumentMainCorrelationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS); + } + } + + private void validateReportDocumentMainCorrelationExists(Long id) { + if (reportDocumentMainCorrelationMapper.selectById(id) == null) { + throw exception(REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS); + } + } + + @Override + public ReportDocumentMainCorrelationDO getReportDocumentMainCorrelation(Long id) { + return reportDocumentMainCorrelationMapper.selectById(id); + } + + @Override + public PageResult getReportDocumentMainCorrelationPage(ReportDocumentMainCorrelationPageReqVO pageReqVO) { + return reportDocumentMainCorrelationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java new file mode 100644 index 0000000..620e12e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainService.java @@ -0,0 +1,85 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 检测报告业务 Service 接口 + * + * @author 后台管理 + */ +public interface ReportDocumentMainService { + + //添加数据到报告-按样品 + CommonResult execAddDataBySample(ReportDocumentMainSaveReqVO reqVO); + + //添加数据到报告-按委托 + CommonResult execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO); + + //添加数据到报告-按表表数据 + CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id); + + //移除数据 + CommonResult execRemoveData(ReportDocumentMainSaveReqVO reqVO); + + void updateCommonField(ReportDocumentMainDO reportDocumentMainDO); + + //保存报告 + void doSave(@Valid ReportDocumentMainSaveReqVO updateReqVO); + + /** + * 创建检测报告业务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ReportDocumentMainRespVO createReportDocumentMain(@Valid ReportDocumentMainSaveReqVO createReqVO); + + /** + * 更新检测报告业务 + * + * @param updateReqVO 更新信息 + */ + void updateReportDocumentMain(@Valid ReportDocumentMainSaveReqVO updateReqVO); + + + /** + * 删除检测报告业务 + * + * @param id 编号 + */ + void deleteReportDocumentMain(Long id); + + /** + * 批量删除检测报告业务 + * + * @param ids 编号 + */ + void deleteReportDocumentMainListByIds(List ids); + + /** + * 获得检测报告业务 + * + * @param id 编号 + * @return 检测报告业务 + */ + ReportDocumentMainDO getReportDocumentMain(Long id); + + /** + * 获得检测报告业务分页 + * + * @param pageReqVO 分页查询 + * @return 检测报告业务分页 + */ + PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO); + + //发起流程 + CommonResult createProcessInstance(ReportDocumentMainSaveReqVO entity); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java new file mode 100644 index 0000000..72be504 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java @@ -0,0 +1,409 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; +import com.zt.plat.module.bpm.api.task.BpmTaskApi; +import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskApproveReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO; +import com.zt.plat.module.qms.api.task.BMPCallbackInterface; +import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; +import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; +import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO; +import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO; +import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainMapper; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO; +import com.zt.plat.module.qms.enums.QmsBpmConstant; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static com.zt.plat.framework.common.pojo.CommonResult.error; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; +import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME; + +/** + * 检测报告业务 Service 实现类 + * + * @author 后台管理 + */ +@Service("reportDocumentMainService") +@Validated +@Slf4j +public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, BMPCallbackInterface { + + @Resource private ReportDocumentMainMapper reportDocumentMainMapper; + @Resource private BusinessAssayReportDataService businessAssayReportDataService; + @Resource private ReportDocumentDataService reportDocumentDataService; + @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; + @Resource private BpmTaskApi bpmTaskApi; + @Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService; + @Resource private ConfigUserSignatureService configUserSignatureService; + /*** + * 增加报表数据(按样品) + * 传入:报告id、 报表数据ids + * */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult execAddDataBySample(ReportDocumentMainSaveReqVO reqVO) { + Long id = reqVO.getId(); + String businessAssayReportDataIds = reqVO.getBusinessAssayReportDataIds(); + List addReportDataIdList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(businessAssayReportDataIds)){ + String[] split = businessAssayReportDataIds.split(","); + for (String s : split) { + Long aLong = Long.valueOf(s); + addReportDataIdList.add(aLong); + } + } + if(ObjectUtils.isEmpty(businessAssayReportDataIds) || addReportDataIdList.isEmpty()) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少businessAssayReportDataIds参数,请刷新后重试"); + List savedDataList = reportDocumentDataService.listByMainDataId(id).getData(); + List hasIds = savedDataList.stream().map(ReportDocumentDataDO::getSourceId).toList(); + boolean isExist = false; + for (Long addReportDataId : addReportDataIdList) { + if(hasIds.contains(addReportDataId)){ + isExist = true; + break; + } + } + if(isExist) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "报表数据已在本报告使用,请勿重复添加"); +// List assayReportDataList = businessAssayReportDataService.listByIds(addReportDataIdList); + BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO(); + reportDataQueryVo.setIdList(addReportDataIdList); + reportDataQueryVo.setPageNo(1); + reportDataQueryVo.setPageSize(9999); + PageResult assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo); + List assayReportDataList = assayReportPage.getList(); + return execAddByBusinessAssayReportData(assayReportDataList, id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO) { + Long id = reqVO.getId(); + String businessSampleEntrustRegistrationIds = reqVO.getBusinessSampleEntrustRegistrationIds(); + if(ObjectUtils.isEmpty(businessSampleEntrustRegistrationIds) || id == null) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少businessSampleEntrustRegistrationIds参数,请刷新后重试"); + List reportRelationList = reportDocumentMainCorrelationService.listByMainId(id); + //todo 判断修改的场景。处理方法:删除reportRelation、ReportDocumentData + List businessSampleEntrustRegistrationIdList = new ArrayList<>(); + String[] split = businessSampleEntrustRegistrationIds.split(","); + for (String s : split) { + Long aLong = Long.valueOf(s); + businessSampleEntrustRegistrationIdList.add(aLong); + } + BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO(); + reportDataQueryVo.setBusinessSampleEntrustRegistrationIdList(businessSampleEntrustRegistrationIdList); + reportDataQueryVo.setPageNo(1); + reportDataQueryVo.setPageSize(9999); + PageResult assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo); + List assayReportDataList = assayReportPage.getList(); + CommonResult ret = execAddByBusinessAssayReportData(assayReportDataList, id); + if(!ret.isSuccess()) + return ret; + //保存报告关系表 + for(Long businessSampleEntrustRegistrationId : businessSampleEntrustRegistrationIdList){ + ReportDocumentMainCorrelationSaveReqVO correlationEntity = new ReportDocumentMainCorrelationSaveReqVO(); + correlationEntity.setMainId( id); + correlationEntity.setCorrelationId(businessSampleEntrustRegistrationId); + correlationEntity.setCorrelationType(ReportDocumentMainCorrelationService.CorrelationType_entrust); + reportDocumentMainCorrelationService.createReportDocumentMainCorrelation(correlationEntity); + } + + return CommonResult.success("操作成功"); + } + + @Override + public CommonResult execAddByBusinessAssayReportData(List assayReportDataList, Long id){ + if(ObjectUtils.isEmpty(assayReportDataList)) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "您选择的委托还没产生可编制报告的数据,请稍后重试!"); + List insertList = new ArrayList<>(); + for (BusinessAssayReportDataDO assayReportData : assayReportDataList) { + ReportDocumentDataDO reportDocumentDataDO = new ReportDocumentDataDO(); + reportDocumentDataDO.setMainId(id); + reportDocumentDataDO.setSourceId(assayReportData.getId()); + reportDocumentDataDO.setSampleCode(assayReportData.getSampleCode()); + reportDocumentDataDO.setSampleName(assayReportData.getSampleName()); + reportDocumentDataDO.setBaseSampleName(assayReportData.getBaseSampleName()); + reportDocumentDataDO.setDocumentContent(assayReportData.getAssayData()); + insertList.add(reportDocumentDataDO); + } + if(!insertList.isEmpty()) + reportDocumentDataService.insertBatch(insertList); + ReportDocumentMainDO reportDocumentMainDO = reportDocumentMainMapper.selectById(id); + updateCommonField(reportDocumentMainDO); + reportDocumentMainMapper.updateById(reportDocumentMainDO); + return CommonResult.success("操作成功"); + } + + @Override + public void updateCommonField(ReportDocumentMainDO reportDocumentMainDO) { + if(reportDocumentMainDO == null) + return; + if(reportDocumentMainDO.getCancelFlag() == null || reportDocumentMainDO.getCancelFlag().equals("-1")) + reportDocumentMainDO.setCancelFlag("0"); + } + + /*** + * 增加报表数据 + * 传入:报告id、 报告明细数据id + * */ + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult execRemoveData(ReportDocumentMainSaveReqVO reqVO) { + Long id = reqVO.getId(); + String reportDocumentDataIds = reqVO.getReportDocumentDataIds(); + List reportDocumentDataIdsList = new ArrayList<>(); + if(!ObjectUtils.isEmpty(reportDocumentDataIds)){ + String[] split = reportDocumentDataIds.split(","); + for (String s : split) { + Long aLong = Long.valueOf(s); + reportDocumentDataIdsList.add(aLong); + } + } + if(ObjectUtils.isEmpty(reportDocumentDataIds) || reportDocumentDataIdsList.isEmpty()) + return error(REPORT_DOCUMENT_DATA_NOT_EXISTS, "缺少reportDocumentDataIds参数,请刷新后重试"); + return reportDocumentDataService.removeByMainIdAndDetailIds(id, reportDocumentDataIdsList); + } + + //保存报告 + @Override + public void doSave(ReportDocumentMainSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentMainExists(updateReqVO.getId()); + // 更新 + ReportDocumentMainDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainDO.class); + reportDocumentMainMapper.updateById(updateObj); + List reportDocumentDataList = updateReqVO.getReportDocumentDataList(); + if(!reportDocumentDataList.isEmpty()) + reportDocumentDataService.updateBatch(reportDocumentDataList); + } + + @Override + public ReportDocumentMainRespVO createReportDocumentMain(ReportDocumentMainSaveReqVO createReqVO) { + // 插入 + ReportDocumentMainDO reportDocumentMain = BeanUtils.toBean(createReqVO, ReportDocumentMainDO.class); + reportDocumentMainMapper.insert(reportDocumentMain); + // 返回 + return BeanUtils.toBean(reportDocumentMain, ReportDocumentMainRespVO.class); + } + + @Override + public void updateReportDocumentMain(ReportDocumentMainSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentMainExists(updateReqVO.getId()); + // 更新 + ReportDocumentMainDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainDO.class); + reportDocumentMainMapper.updateById(updateObj); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteReportDocumentMain(Long id) { + // 校验存在 + validateReportDocumentMainExists(id); + // 删除 + reportDocumentMainMapper.deleteById(id); + //删除关联表 + reportDocumentMainCorrelationService.deleteByMainId(id); + reportDocumentDataService.deleteByMainId(id); + } + + @Override + public void deleteReportDocumentMainListByIds(List ids) { + // 校验存在 + validateReportDocumentMainExists(ids); + // 删除 + reportDocumentMainMapper.deleteByIds(ids); + } + + private void validateReportDocumentMainExists(List ids) { + List list = reportDocumentMainMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(REPORT_DOCUMENT_MAIN_NOT_EXISTS); + } + } + + private void validateReportDocumentMainExists(Long id) { + if (reportDocumentMainMapper.selectById(id) == null) { + throw exception(REPORT_DOCUMENT_MAIN_NOT_EXISTS); + } + } + + @Override + public ReportDocumentMainDO getReportDocumentMain(Long id) { + return reportDocumentMainMapper.selectById(id); + } + + @Override + public PageResult getReportDocumentMainPage(ReportDocumentMainPageReqVO pageReqVO) { + return reportDocumentMainMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult createProcessInstance(ReportDocumentMainSaveReqVO param) { + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + Long id = param.getId(); + ReportDocumentMainDO entity = getReportDocumentMain(id); + String flowInsId = entity.getFlowInstanceId(); + + if(!ObjectUtils.isEmpty(flowInsId)){ + CommonResult> taskRet = bpmTaskApi.getTaskListByProcessInstanceId(flowInsId); + List taskList = taskRet.getData(); + if(taskList.isEmpty()) + throw exception0(ERROR_CODE_MODULE_COMMON, "流程任务查询失败,请联系管理员处理"); + String taskId = taskList.get(taskList.size() - 1).getId(); + //驳回后重新提交 + BpmTaskApproveReqDTO reqVO = new BpmTaskApproveReqDTO(); + reqVO.setId(taskId); + CommonResult result = bpmProcessInstanceApi.approveTask(reqVO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + reportDocumentMainMapper.updateById(entity); + ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class); + return CommonResult.success(respVO); + } + + JSONObject formData = new JSONObject(); + if(entity.getFormData() != null) + formData = JSONObject.parseObject(entity.getFormData()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + formData.put("mainId", id); + formData.put("applyUser", nickName); + formData.put("applyUserId", loginUser.getId()); + formData.put("applyDepartment", loginUser.getVisitDeptName()); + formData.put("applyDepartmentId", loginUser.getVisitDeptId()); + formData.put("applyTime", sdf.format(new Date())); + Map variables = formData.toJavaObject(Map.class); + variables.put(BPM_CALLBACK_BEAN_NAME, "reportDocumentMainService"); //流程回调时使用的service + BpmProcessInstanceCreateReqDTO reqDTO = new BpmProcessInstanceCreateReqDTO(); + reqDTO.setBusinessKey(String.valueOf(id)); + reqDTO.setProcessDefinitionKey(entity.getFlowKey()); + reqDTO.setVariables(variables); + CommonResult result = bpmProcessInstanceApi.createProcessInstance(loginUser.getId(), reqDTO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + String wfInsId = result.getData(); + entity.setFlowInstanceId(wfInsId); + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + reportDocumentMainMapper.updateById(entity); + ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class); + return CommonResult.success(respVO); + } + + //流程回调 + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult callback(QmsBpmDTO reqDTO) { + JSONObject variables = reqDTO.getVariables(); + + //流程状态 1-提交(含退回) 4-取消流程 + String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS); + String mainId = variables.getString("mainId"); + JSONArray fieldExtensions = new JSONArray(); + if(variables.containsKey(QmsBpmConstant.BPM_FIELD_EXTENSIONS)){ + fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS); + } + ReportDocumentMainDO entity = getReportDocumentMain(Long.valueOf(mainId)); + log.error("流程回调:{}", JSONObject.toJSONString(reqDTO)); + String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID); + String RETURN_FLAG_PREFIX_KEY = QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY; + String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001"; + + //判断是否最后一个节点 + String lastActivityFlag = "0"; + String firstActivityFlag = "0"; + if(!fieldExtensions.isEmpty()){ + for(int i = 0; i < fieldExtensions.size(); i++){ + JSONObject fieldExtension = fieldExtensions.getJSONObject(i); + if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){ + lastActivityFlag = "1"; + } + if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){ + firstActivityFlag = "1"; + } + } + } + + //"RETURN_FLAG_Activity_001": true 标识驳回到发起环节 + if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){ + //驳回。流程需要配置退回到发起节点 + entity.setFlowStatus(QmsCommonConstant.REJECTED); + entity.setDocumentSignature(""); + }else if("4".equals(PROCESS_STATUS)){ + //作废 + entity.setFlowStatus(QmsCommonConstant.VOID); + entity.setDocumentSignature(""); + }else if("1".equals(PROCESS_STATUS)){ + //通过 + assembleSignature(currentActivityId, entity); + if("1".equals(firstActivityFlag)) + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); //驳回后重新提交 + if("1".equals(lastActivityFlag)) + entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批 + } + reportDocumentMainMapper.updateById(entity); + JSONObject ret = new JSONObject(); + return CommonResult.success(ret); + } + + private void assembleSignature(String currentActivityId, ReportDocumentMainDO entity){ + if(ObjectUtils.isEmpty(currentActivityId) || "null".equals(currentActivityId)) + return; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String sign = entity.getDocumentSignature(); + JSONObject signObj = new JSONObject(); + if(!ObjectUtils.isEmpty( sign)) + signObj = JSONObject.parseObject(sign); + if(signObj.containsKey(currentActivityId)) + return; + JSONObject obj = new JSONObject(); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + Long userId = loginUser.getId(); + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + ConfigUserSignatureDO configUserSignatureDO = configUserSignatureService.getByUserId(userId); + obj.put("signatureId", ""); + if(configUserSignatureDO != null) + obj.put("signatureId", configUserSignatureDO.getId()); + obj.put("userId", userId); + obj.put("userName", nickName); + obj.put("signTime", sdf.format(new Date())); + signObj.put(currentActivityId, obj); + entity.setDocumentSignature(signObj.toJSONString()); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeService.java new file mode 100644 index 0000000..7e5bcf8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeService.java @@ -0,0 +1,69 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 报告类型配置 Service 接口 + * + * @author 后台管理 + */ +public interface ReportDocumentTypeService { + + /*保存数据*/ + CommonResult save(@Valid ReportDocumentTypeSaveReqVO reqV); + CommonResult saveWithNewVersion(@Valid ReportDocumentTypeSaveReqVO reqV); + + /** + * 创建报告类型配置 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + ReportDocumentTypeRespVO createReportDocumentType(@Valid ReportDocumentTypeSaveReqVO createReqVO); + + /** + * 更新报告类型配置 + * + * @param updateReqVO 更新信息 + */ + void updateReportDocumentType(@Valid ReportDocumentTypeSaveReqVO updateReqVO); + + /** + * 删除报告类型配置 + * + * @param id 编号 + */ + void deleteReportDocumentType(Long id); + + /** + * 批量删除报告类型配置 + * + * @param ids 编号 + */ + void deleteReportDocumentTypeListByIds(List ids); + + /** + * 获得报告类型配置 + * + * @param id 编号 + * @return 报告类型配置 + */ + ReportDocumentTypeDO getReportDocumentType(Long id); + + /** + * 获得报告类型配置分页 + * + * @param pageReqVO 分页查询 + * @return 报告类型配置分页 + */ + PageResult getReportDocumentTypePage(ReportDocumentTypePageReqVO pageReqVO); + + List selectListWithPermission(ReportDocumentTypePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java new file mode 100644 index 0000000..982a073 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentTypeServiceImpl.java @@ -0,0 +1,143 @@ +package com.zt.plat.module.qms.business.reportdoc.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.security.core.LoginUser; +import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; +import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionSaveReqVO; +import com.zt.plat.module.qms.business.config.service.ConfigPermissionService; +import com.zt.plat.module.qms.business.reportdoc.controller.vo.*; +import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentTypeMapper; +import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO; +import com.zt.plat.module.system.api.permission.PermissionApi; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import java.util.List; +import java.util.Set; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS; + +/** + * 报告类型配置 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class ReportDocumentTypeServiceImpl implements ReportDocumentTypeService { + + @Resource private ReportDocumentTypeMapper reportDocumentTypeMapper; + @Resource private ConfigPermissionService configPermissionService; + + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult save(ReportDocumentTypeSaveReqVO reqVo) { + String newVersionFlag = reqVo.getNewVersionFlag(); + + //处理权限 + List primissionList = reqVo.getPermissionList(); + configPermissionService.savePermissionListWithAutoDelete(primissionList); + if("1".equals(newVersionFlag)) + return saveWithNewVersion(reqVo); + if(reqVo.getId() == null){ + ReportDocumentTypeDO typeDO = BeanUtils.toBean(reqVo, ReportDocumentTypeDO.class); + typeDO.setCurrentFlag(1); + reportDocumentTypeMapper.insert(typeDO); + Long id = typeDO.getId(); + typeDO.setMainId(id); + this.reportDocumentTypeMapper.updateById(typeDO); + } + else + this.updateReportDocumentType(reqVo); + return CommonResult.success("保存成功"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult saveWithNewVersion(ReportDocumentTypeSaveReqVO reqV) { + ReportDocumentTypeDO documentTypeDO = BeanUtils.toBean(reqV, ReportDocumentTypeDO.class); + documentTypeDO.setCurrentFlag(0); + reportDocumentTypeMapper.updateById(documentTypeDO); + //创建新版本 + Integer version = documentTypeDO.getVersion(); + if(version != null) + version ++; + else + version = 1; + documentTypeDO.setId(null); + documentTypeDO.setVersion(version); + documentTypeDO.setCurrentFlag(1); + documentTypeDO.setMainId(reqV.getMainId()); + reportDocumentTypeMapper.insert(documentTypeDO); + return CommonResult.success("保存成功"); + } + + @Override + public ReportDocumentTypeRespVO createReportDocumentType(ReportDocumentTypeSaveReqVO createReqVO) { + // 插入 + ReportDocumentTypeDO reportDocumentType = BeanUtils.toBean(createReqVO, ReportDocumentTypeDO.class); + reportDocumentTypeMapper.insert(reportDocumentType); + // 返回 + return BeanUtils.toBean(reportDocumentType, ReportDocumentTypeRespVO.class); + } + + @Override + public void updateReportDocumentType(ReportDocumentTypeSaveReqVO updateReqVO) { + // 校验存在 + validateReportDocumentTypeExists(updateReqVO.getId()); + // 更新 + ReportDocumentTypeDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentTypeDO.class); + reportDocumentTypeMapper.updateById(updateObj); + } + + @Override + public void deleteReportDocumentType(Long id) { + // 校验存在 + validateReportDocumentTypeExists(id); + // 删除 + reportDocumentTypeMapper.deleteById(id); + } + + @Override + public void deleteReportDocumentTypeListByIds(List ids) { + // 校验存在 + validateReportDocumentTypeExists(ids); + // 删除 + reportDocumentTypeMapper.deleteByIds(ids); + } + + private void validateReportDocumentTypeExists(List ids) { + List list = reportDocumentTypeMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(REPORT_DOCUMENT_TYPE_NOT_EXISTS); + } + } + + private void validateReportDocumentTypeExists(Long id) { + if (reportDocumentTypeMapper.selectById(id) == null) { + throw exception(REPORT_DOCUMENT_TYPE_NOT_EXISTS); + } + } + + @Override + public ReportDocumentTypeDO getReportDocumentType(Long id) { + return reportDocumentTypeMapper.selectById(id); + } + + @Override + public PageResult getReportDocumentTypePage(ReportDocumentTypePageReqVO pageReqVO) { + return reportDocumentTypeMapper.selectPage(pageReqVO); + } + + @Override + public List selectListWithPermission(ReportDocumentTypePageReqVO pageReqVO) { + return reportDocumentTypeMapper.selectListWithPermission(pageReqVO); + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java index 8ff7668..d2c818e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataCollectionFieldController.java @@ -15,7 +15,6 @@ import com.zt.plat.module.qms.common.data.controller.vo.DataCollectionFieldRespV import com.zt.plat.module.qms.common.data.controller.vo.DataCollectionFieldSaveReqVO; import com.zt.plat.module.qms.common.data.service.DataCollectionFieldService; import com.zt.plat.module.qms.common.data.service.DataCollectionService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java index 4d9c971..d51f321 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataFormController.java @@ -11,6 +11,9 @@ import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.excel.core.util.ExcelUtils; import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormSaveReqVO; import com.zt.plat.module.qms.common.data.dal.dataobject.DataFormDO; import com.zt.plat.module.qms.common.data.service.DataFormService; import io.swagger.v3.oas.annotations.Operation; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java new file mode 100644 index 0000000..b73ef47 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/admin/DataTemplateController.java @@ -0,0 +1,160 @@ +package com.zt.plat.module.qms.common.data.controller.admin; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; +import com.zt.plat.module.qms.common.data.dal.mapper.DataTemplateMapper; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import jakarta.validation.*; +import jakarta.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +import com.zt.plat.framework.excel.core.util.ExcelUtils; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DATA_TEMPLATE_NOT_EXISTS; + +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.module.qms.common.data.service.DataTemplateService; + +@Tag(name = "管理后台 - 表单设计器模板") +@RestController +@RequestMapping("/qms/common/data/data-template") +@Validated +public class DataTemplateController implements BusinessControllerMarker { + + + @Resource private DataTemplateService dataTemplateService; + @Resource private DataTemplateMapper dataTemplateMapper; + +// @PostMapping("/create-temp-data") +// @Operation(summary = "创建临时数据") +// public CommonResult createTempData(@Valid @RequestBody DataTemplateSaveReqVO vo) { +// vo.setCancelFlag("-1"); +// vo.setNodeType(DataTypeConstant.DATA_TYPE_DATA); +// vo.setVersion(1); +// return success(dataTemplateService.createDataTemplate(vo)); +// } + + @PostMapping("/saveData") + @Operation(summary = "保存数据") + @PreAuthorize("@ss.hasPermission('qms:data-template:create')") + public CommonResult saveData(@Valid @RequestBody DataTemplateSaveReqVO createReqVO) { + return dataTemplateService.saveData(createReqVO); + } + + @PostMapping("/saveClassify") + @Operation(summary = "保存分类") + @PreAuthorize("@ss.hasPermission('qms:data-template:create')") + public CommonResult saveClassify(@Valid @RequestBody DataTemplateSaveReqVO createReqVO) { + return dataTemplateService.saveClassify(createReqVO); + } + + + @PostMapping("/create") + @Operation(summary = "创建表单设计器模板") + @PreAuthorize("@ss.hasPermission('qms:data-template:create')") + public CommonResult createDataTemplate(@Valid @RequestBody DataTemplateSaveReqVO createReqVO) { + return success(dataTemplateService.createDataTemplate(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新表单设计器模板") + @PreAuthorize("@ss.hasPermission('qms:data-template:update')") + public CommonResult updateDataTemplate(@Valid @RequestBody DataTemplateSaveReqVO updateReqVO) { + dataTemplateService.updateDataTemplate(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除表单设计器模板") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('qms:data-template:delete')") + public CommonResult deleteDataTemplate(@RequestParam("id") Long id) { + dataTemplateService.deleteDataTemplate(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除表单设计器模板") + @PreAuthorize("@ss.hasPermission('qms:data-template:delete')") + public CommonResult deleteDataTemplateList(@RequestBody BatchDeleteReqVO req) { + dataTemplateService.deleteDataTemplateListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得表单设计器模板") + @Parameter(name = "id", description = "编号", required = true, example = "1024") +// @PreAuthorize("@ss.hasPermission('qms:data-template:query')") + public CommonResult getDataTemplate(@RequestParam("id") Long id) { + DataTemplateDO dataTemplate = dataTemplateService.getDataTemplate(id); + return success(BeanUtils.toBean(dataTemplate, DataTemplateRespVO.class)); + } + + @GetMapping("/getByKey") + @Operation(summary = "获得表单设计器模板") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('qms:data-template:query')") + public CommonResult getByKey(@RequestParam("dataKey") String dataKey) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DataTemplateDO::getDataKey, dataKey); + query.eq(DataTemplateDO::getCancelFlag, "0"); + query.eq(DataTemplateDO::getCurrentFlag, "1"); + query.eq(DataTemplateDO::getNodeType, DataTypeConstant.DATA_TYPE_DATA); + query.orderByDesc(DataTemplateDO::getUpdateTime); + List list = dataTemplateMapper.selectList(query); + if(list.size()>0) + return success(BeanUtils.toBean(list.get(0), DataTemplateRespVO.class)); + return CommonResult.error(DATA_TEMPLATE_NOT_EXISTS); + } + + @GetMapping("/page") + @Operation(summary = "获得表单设计器模板分页") + @PreAuthorize("@ss.hasPermission('qms:data-template:query')") + public CommonResult> getDataTemplatePage(@Valid DataTemplatePageReqVO pageReqVO) { + PageResult pageResult = dataTemplateService.getDataTemplatePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DataTemplateRespVO.class)); + } + + @GetMapping("/get-tree-data") + @Operation(summary = "查询分类树") + public CommonResult> getTreeData() { + List list = dataTemplateService.getTreeData(); + return success(BeanUtils.toBean(list, DataTemplateRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出表单设计器模板 Excel") + @PreAuthorize("@ss.hasPermission('qms:data-template:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDataTemplateExcel(@Valid DataTemplatePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = dataTemplateService.getDataTemplatePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "表单设计器模板.xls", "数据", DataTemplateRespVO.class, + BeanUtils.toBean(list, DataTemplateRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionFieldRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionFieldRespVO.java index da10ae2..364420f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionFieldRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionFieldRespVO.java @@ -8,8 +8,6 @@ import lombok.Data; import java.time.LocalDateTime; -import static com.zt.plat.module.qms.core.constant.DataTypeConstant.DICT_ANNOTATION_KEY_TYPE_ID; - @Schema(description = "管理后台 - 数据集字段 Response VO") @Data @ExcelIgnoreUnannotated diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionSaveReqVO.java index 0a815ef..c84eabd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataCollectionSaveReqVO.java @@ -1,7 +1,6 @@ package com.zt.plat.module.qms.common.data.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplatePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplatePageReqVO.java new file mode 100644 index 0000000..b22326d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplatePageReqVO.java @@ -0,0 +1,64 @@ +package com.zt.plat.module.qms.common.data.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 表单设计器模板分页 Request VO") +@Data +public class DataTemplatePageReqVO extends PageParam { + + @Schema(description = "上级id", example = "14825") + private Long parentId; + + @Schema(description = "主数据id,用于版本识别", example = "12080") + private Long mainId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "节点类型,字典:qms_tree_node_type,category-分类;data-表单", example = "2") + private String nodeType; + + @Schema(description = "数据键") + private String dataKey; + + @Schema(description = "版本") + private Integer version; + + @Schema(description = "是否最新版本,默认显示最新版本") + private String currentFlag; + + @Schema(description = "禁用状态,0-启用;1-禁用") + private String cancelFlag; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "模板内容") + private String formContent; + + @Schema(description = "移动端模板内容") + private String mobileContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateRespVO.java new file mode 100644 index 0000000..18dad95 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateRespVO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.common.data.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 表单设计器模板 Response VO") +@Data +@ExcelIgnoreUnannotated +public class DataTemplateRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10340") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "上级id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14825") + @ExcelProperty("上级id") + private Long parentId; + + @Schema(description = "主数据id,用于版本识别", requiredMode = Schema.RequiredMode.REQUIRED, example = "12080") + @ExcelProperty("主数据id,用于版本识别") + private Long mainId; + + @Schema(description = "id路径", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("id路径") + private String idPath; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + @ExcelProperty("名称") + private String name; + + @Schema(description = "节点类型,字典:qms_tree_node_type,category-分类;data-表单", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("节点类型,字典:qms_tree_node_type,category-分类;data-表单") + private String nodeType; + + @Schema(description = "数据键", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数据键") + private String dataKey; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("版本") + private Integer version; + + @Schema(description = "是否最新版本,默认显示最新版本", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否最新版本,默认显示最新版本") + private String currentFlag; + + @Schema(description = "禁用状态,0-启用;1-禁用", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("禁用状态,0-启用;1-禁用") + private String cancelFlag; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "其他配置") + @ExcelProperty("其他配置") + private String customConfig; + + @Schema(description = "模板内容") + @ExcelProperty("模板内容") + private String formContent; + + @Schema(description = "移动端模板内容") + @ExcelProperty("移动端模板内容") + private String mobileContent; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateSaveReqVO.java new file mode 100644 index 0000000..ebca40a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/controller/vo/DataTemplateSaveReqVO.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.common.data.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import jakarta.validation.constraints.*; + +@Schema(description = "管理后台 - 表单设计器模板新增/修改 Request VO") +@Data +public class DataTemplateSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10340") + private Long id; + + @Schema(description = "上级id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14825") + private Long parentId; + + @Schema(description = "主数据id,用于版本识别", requiredMode = Schema.RequiredMode.REQUIRED, example = "12080") + private Long mainId; + + @Schema(description = "id路径", requiredMode = Schema.RequiredMode.REQUIRED) + private String idPath; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") + private String name; + + @Schema(description = "节点类型,字典:qms_tree_node_type,category-分类;data-表单", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + private String nodeType; + + @Schema(description = "数据键", requiredMode = Schema.RequiredMode.REQUIRED) + private String dataKey; + + @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) + private Integer version; + + @Schema(description = "是否最新版本,默认显示最新版本", requiredMode = Schema.RequiredMode.REQUIRED) + private String currentFlag; + + @Schema(description = "禁用状态,0-启用;1-禁用", requiredMode = Schema.RequiredMode.REQUIRED) + private String cancelFlag; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "模板内容") + private String formContent; + + @Schema(description = "移动端模板内容") + private String mobileContent; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +//==============扩展字段=============== + @Schema(description = "是否创建新版本") + private String newVersionFlag; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataTemplateDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataTemplateDO.java new file mode 100644 index 0000000..87ba4af --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/dataobject/DataTemplateDO.java @@ -0,0 +1,107 @@ +package com.zt.plat.module.qms.common.data.dal.dataobject; + +import lombok.*; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +/** +* 表单设计器模板 DO +* +* @author 后台管理 +*/ +@TableName("t_dat_tmpl") +@KeySequence("t_dat_tmpl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DataTemplateDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 上级id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * 主数据id,用于版本识别 + */ + @TableField("MAIN_ID") + private Long mainId; + /** + * id路径 + */ + @TableField("ID_PATH") + private String idPath; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 节点类型,字典:qms_tree_node_type,category-分类;data-表单 + */ + @TableField("NDE_TP") + private String nodeType; + /** + * 数据键 + */ + @TableField("DAT_KY") + private String dataKey; + /** + * 版本 + */ + @TableField("VER") + private Integer version; + /** + * 是否最新版本,默认显示最新版本 + */ + @TableField("CRNT_FLG") + private String currentFlag; + /** + * 禁用状态,0-启用;1-禁用 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + /** + * 模板内容 + */ + @TableField("FORM_CNTT") + private String formContent; + /** + * 移动端模板内容 + */ + @TableField("MOB_CNTT") + private String mobileContent; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataFormMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataFormMapper.java index 046a6bc..baba00c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataFormMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataFormMapper.java @@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormPageReqVO; import com.zt.plat.module.qms.common.data.dal.dataobject.DataFormDO; import org.apache.ibatis.annotations.Mapper; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.java new file mode 100644 index 0000000..d0720df --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.common.data.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.module.qms.common.data.controller.vo.DataTemplatePageReqVO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Arrays; + +/** + * 表单设计器模板 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface DataTemplateMapper extends BaseMapperX { + + default PageResult selectPage(DataTemplatePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DataTemplateDO::getParentId, reqVO.getParentId()) + .eqIfPresent(DataTemplateDO::getMainId, reqVO.getMainId()) + .eqIfPresent(DataTemplateDO::getIdPath, reqVO.getIdPath()) + .likeIfPresent(DataTemplateDO::getName, reqVO.getName()) + .eqIfPresent(DataTemplateDO::getNodeType, reqVO.getNodeType()) + .eqIfPresent(DataTemplateDO::getDataKey, reqVO.getDataKey()) + .eqIfPresent(DataTemplateDO::getVersion, reqVO.getVersion()) + .eqIfPresent(DataTemplateDO::getCurrentFlag, reqVO.getCurrentFlag()) + .eqIfPresent(DataTemplateDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DataTemplateDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(DataTemplateDO::getCustomConfig, reqVO.getCustomConfig()) + .eqIfPresent(DataTemplateDO::getFormContent, reqVO.getFormContent()) + .eqIfPresent(DataTemplateDO::getMobileContent, reqVO.getMobileContent()) + .eqIfPresent(DataTemplateDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DataTemplateDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DataTemplateDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DataTemplateDO::getId) + .select(Arrays.asList( + DataTemplateDO::getId, + DataTemplateDO::getParentId, + DataTemplateDO::getMainId, + DataTemplateDO::getIdPath, + DataTemplateDO::getName, + DataTemplateDO::getNodeType, + DataTemplateDO::getDataKey, + DataTemplateDO::getVersion, + DataTemplateDO::getCurrentFlag, + DataTemplateDO::getCancelFlag, + DataTemplateDO::getSortNo, + DataTemplateDO::getCustomConfig, +// DataTemplateDO::getFormContent, +// DataTemplateDO::getMobileContent, + DataTemplateDO::getSystemDepartmentCode, + DataTemplateDO::getRemark, + DataTemplateDO::getCreator, + DataTemplateDO::getCreateTime, + DataTemplateDO::getUpdater, + DataTemplateDO::getUpdateTime, + DataTemplateDO::getCompanyId, + DataTemplateDO::getCompanyName, + DataTemplateDO::getDeptId, + DataTemplateDO::getDeptName, + DataTemplateDO::getPostId, + DataTemplateDO::getCreatorName, + DataTemplateDO::getUpdaterName + )) + ); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormService.java index 407d54b..9f2409c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormService.java @@ -2,6 +2,9 @@ package com.zt.plat.module.qms.common.data.service; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormSaveReqVO; import com.zt.plat.module.qms.common.data.dal.dataobject.DataFormDO; import jakarta.validation.Valid; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormServiceImpl.java index 4b17500..25fe40f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataFormServiceImpl.java @@ -8,9 +8,11 @@ import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormPageReqVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormRespVO; +import com.zt.plat.module.qms.common.data.controller.vo.DataFormSaveReqVO; import com.zt.plat.module.qms.api.task.BMPCallbackInterface; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; -import com.zt.plat.module.qms.common.data.controller.vo.*; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.dal.dataobject.DataFormDO; import com.zt.plat.module.qms.common.data.dal.mapper.DataFormMapper; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateService.java new file mode 100644 index 0000000..3aa637b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateService.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.common.data.service; + +import java.util.*; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import jakarta.validation.*; +import com.zt.plat.framework.common.pojo.PageResult; + +/** + * 表单设计器模板 Service 接口 + * + * @author 后台管理 + */ +public interface DataTemplateService { + + DataTemplateDO getLatestDataByKey(String key); + + /*获取分类树数据*/ + List getTreeData(); + + //保存数据集 + CommonResult saveData(@Valid DataTemplateSaveReqVO createReqVO); + CommonResult saveDataWithNewVersion(@Valid DataTemplateSaveReqVO createReqVO); + + //保存分类 + CommonResult saveClassify(@Valid DataTemplateSaveReqVO createReqVO); + + //更新后代节点路径-递归调用 + CommonResult updateAllIdPath(Long parentId, Integer level); + + List listByParId(Long parId); + /** + * 创建表单设计器模板 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DataTemplateRespVO createDataTemplate(@Valid DataTemplateSaveReqVO createReqVO); + + /** + * 更新表单设计器模板 + * + * @param updateReqVO 更新信息 + */ + void updateDataTemplate(@Valid DataTemplateSaveReqVO updateReqVO); + + /** + * 删除表单设计器模板 + * + * @param id 编号 + */ + void deleteDataTemplate(Long id); + + /** + * 批量删除表单设计器模板 + * + * @param ids 编号 + */ + void deleteDataTemplateListByIds(List ids); + + /** + * 获得表单设计器模板 + * + * @param id 编号 + * @return 表单设计器模板 + */ + DataTemplateDO getDataTemplate(Long id); + + /** + * 获得表单设计器模板分页 + * + * @param pageReqVO 分页查询 + * @return 表单设计器模板分页 + */ + PageResult getDataTemplatePage(DataTemplatePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateServiceImpl.java new file mode 100644 index 0000000..6a8b182 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/data/service/DataTemplateServiceImpl.java @@ -0,0 +1,240 @@ +package com.zt.plat.module.qms.common.data.service; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.common.data.controller.vo.*; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.enums.ErrorCodeConstants; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.*; + +import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; + +import com.zt.plat.module.qms.common.data.dal.mapper.DataTemplateMapper; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 表单设计器模板 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class DataTemplateServiceImpl implements DataTemplateService { + + private int id_path_update_level_limit = 7; + @Resource private DataTemplateMapper dataTemplateMapper; + + @Override + public DataTemplateDO getLatestDataByKey(String key) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DataTemplateDO::getDataKey, key); + query.eq(DataTemplateDO::getCurrentFlag, "1"); + query.orderByDesc(DataTemplateDO::getUpdateTime); + query.last("limit 1"); + return dataTemplateMapper.selectOne(query); + } + + @Override + public CommonResult saveData(DataTemplateSaveReqVO reqV) { + String newVersionFlag = reqV.getNewVersionFlag(); + if("1".equals(newVersionFlag)) + return saveDataWithNewVersion(reqV); + Long id = reqV.getId(); + if(id == null){ + reqV.setCancelFlag("0"); + reqV.setCurrentFlag("1"); + reqV.setVersion(1); + DataTemplateDO dataTemplate = BeanUtils.toBean(reqV, DataTemplateDO.class); + dataTemplateMapper.insert(dataTemplate); + id = dataTemplate.getId(); + reqV.setMainId(id); + reqV.setId( id); + } +// DataTemplateDO backData = this.getDataTemplate(id); +// if(backData.getCancelFlag() == null || backData.getCancelFlag().equals("-1")){ +// reqV.setCancelFlag("0"); +// reqV.setCurrentFlag("1"); +// reqV.setMainId( id); +// } + + this.updateDataTemplate(reqV); + return CommonResult.success("保存成功"); + } + + @Override + public CommonResult saveDataWithNewVersion(DataTemplateSaveReqVO createReqVO) { + DataTemplateDO dataTemplate = BeanUtils.toBean(createReqVO, DataTemplateDO.class); + dataTemplate.setCurrentFlag("0"); + dataTemplateMapper.updateById(dataTemplate); + + //创建新版本 + Integer version = dataTemplate.getVersion(); + if(version != null) + version ++; + else + version = 1; + dataTemplate.setId(null); + dataTemplate.setVersion(version); + dataTemplate.setCurrentFlag("1"); + dataTemplate.setMainId(createReqVO.getMainId()); + dataTemplateMapper.insert(dataTemplate); + + return CommonResult.success("保存成功"); + } + + @Override + public CommonResult saveClassify(DataTemplateSaveReqVO entity) { + if(ObjectUtils.isEmpty(entity.getParentId())) + entity.setParentId(0L); + Long parentId = entity.getParentId(); + //检查同一层级下是否重名 + List checkList = listByParId(parentId); + boolean duplicate = false; + DataTemplateDO duplicateEntity = checkList.stream().filter(e->e.getName().equals(entity.getName())).findFirst().orElse(null); + if(duplicateEntity != null && !duplicateEntity.getId().equals(entity.getId())) + duplicate = true; + if(duplicate) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_DUPLICATE); + entity.setNodeType(DataTypeConstant.DATA_TYPE_CATEGORY); + Long id = entity.getId(); + DataTemplateDO dataTemplate = BeanUtils.toBean(entity, DataTemplateDO.class); + if(ObjectUtils.isEmpty(id)){ + dataTemplateMapper.insert(dataTemplate); + id = dataTemplate.getId(); + } + DataTemplateDO backData = this.getDataTemplate(id); + Long parentId_ = backData.getParentId(); + //检查parId,避免父节点设置为本节点的后代节点 + if(parentId_.equals(id)) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + String idPath = getIdPath(dataTemplate); + int curIdIndex = idPath.indexOf("/" + id.toString() + "/"); + int parIdIndex = idPath.indexOf("/" + parentId.toString() + "/"); + if(curIdIndex <= parIdIndex) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + dataTemplate.setIdPath(idPath); + + //更新后代节点路径 + updateAllIdPath(id, 1); + dataTemplateMapper.updateById(dataTemplate); + return CommonResult.success(BeanUtils.toBean(dataTemplate, DataTemplateRespVO.class)); + } + + @Override + public CommonResult updateAllIdPath(Long parentId, Integer level) { + if(level > id_path_update_level_limit) + return CommonResult.success("更新完成(超出层数限制:"+id_path_update_level_limit+")"); + List list = listByParId(parentId); + DataTemplateDO parEntity = this.getDataTemplate(parentId); + if(list.isEmpty()) + return CommonResult.success(""); + String parIdPath = "/0/"; + if(parEntity != null) + parIdPath = parEntity.getIdPath(); + for(DataTemplateDO entity : list){ + entity.setIdPath(parIdPath + "/" + entity.getId() + "/"); + dataTemplateMapper.updateById( entity); + updateAllIdPath(entity.getId(),level+1); + } + return CommonResult.success(""); + } + + @Override + public List getTreeData() { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DataTemplateDO::getNodeType, DataTypeConstant.DATA_TYPE_CATEGORY); + query.orderByAsc(DataTemplateDO::getSortNo); + return dataTemplateMapper.selectList(query); + } + + @Override + public List listByParId(Long parId) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DataTemplateDO::getParentId, parId); + query.ne(DataTemplateDO::getCancelFlag, -1); + return dataTemplateMapper.selectList(query); + } + + private String getIdPath(DataTemplateDO entity){ + String parIdPath = ""; + if(ObjectUtils.isEmpty(entity.getParentId()) || 0L == entity.getParentId()) + parIdPath = "/0/"; + DataTemplateDO parEntity = this.getDataTemplate(entity.getParentId()); + if(parEntity != null){ + parIdPath = parEntity.getIdPath(); + } + return parIdPath + entity.getId() + "/"; + } + + @Override + public DataTemplateRespVO createDataTemplate(DataTemplateSaveReqVO createReqVO) { + // 插入 + DataTemplateDO dataTemplate = BeanUtils.toBean(createReqVO, DataTemplateDO.class); + dataTemplateMapper.insert(dataTemplate); + // 返回 + return BeanUtils.toBean(dataTemplate, DataTemplateRespVO.class); + } + + @Override + public void updateDataTemplate(DataTemplateSaveReqVO updateReqVO) { + // 校验存在 + validateDataTemplateExists(updateReqVO.getId()); + // 更新 + DataTemplateDO updateObj = BeanUtils.toBean(updateReqVO, DataTemplateDO.class); + dataTemplateMapper.updateById(updateObj); + } + + @Override + public void deleteDataTemplate(Long id) { + // 校验存在 + validateDataTemplateExists(id); + // 删除 + dataTemplateMapper.deleteById(id); + } + + @Override + public void deleteDataTemplateListByIds(List ids) { + // 校验存在 + validateDataTemplateExists(ids); + // 删除 + dataTemplateMapper.deleteByIds(ids); + } + + private void validateDataTemplateExists(List ids) { + List list = dataTemplateMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DATA_TEMPLATE_NOT_EXISTS); + } + } + + private void validateDataTemplateExists(Long id) { + if (dataTemplateMapper.selectById(id) == null) { + throw exception(DATA_TEMPLATE_NOT_EXISTS); + } + } + + @Override + public DataTemplateDO getDataTemplate(Long id) { + return dataTemplateMapper.selectById(id); + } + + @Override + public PageResult getDataTemplatePage(DataTemplatePageReqVO pageReqVO) { + return dataTemplateMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessPageReqVO.java index c67739c..cba63b9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessPageReqVO.java @@ -1,28 +1,28 @@ package com.zt.plat.module.qms.common.dic.controller.vo; -import com.zt.plat.framework.common.pojo.PageParam; +import lombok.*; +import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; +import com.zt.plat.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; - import java.time.LocalDateTime; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@Schema(description = "管理后台 - 业务参数字典分页 Request VO") +@Schema(description = "管理后台 - 业务字典分页 Request VO") @Data public class DictionaryBusinessPageReqVO extends PageParam { - @Schema(description = "id路径") + @Schema(description = "ID路径") private String idPath; - @Schema(description = "上级id", example = "3392") + @Schema(description = "上级ID", example = "17939") private Long parentId; @Schema(description = "节点类型", example = "2") private String nodeType; - @Schema(description = "名称", example = "芋艿") + @Schema(description = "名称", example = "王五") private String name; @Schema(description = "键") @@ -34,17 +34,17 @@ public class DictionaryBusinessPageReqVO extends PageParam { @Schema(description = "其他配置") private String customConfig; + @Schema(description = "排序号") + private Integer sortNo; + @Schema(description = "所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; @Schema(description = "备注") private String remark; - @Schema(description = "排序号") - private Integer sortNo; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessRespVO.java index 896411e..a5b0c6f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessRespVO.java @@ -1,34 +1,34 @@ package com.zt.plat.module.qms.common.dic.controller.vo; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; -@Schema(description = "管理后台 - 业务参数字典 Response VO") +@Schema(description = "管理后台 - 业务字典 Response VO") @Data @ExcelIgnoreUnannotated public class DictionaryBusinessRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5551") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20038") @ExcelProperty("ID") private Long id; - @Schema(description = "id路径", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("id路径") + @Schema(description = "ID路径") + @ExcelProperty("ID路径") private String idPath; - @Schema(description = "上级id", example = "3392") - @ExcelProperty("上级id") + @Schema(description = "上级ID", example = "17939") + @ExcelProperty("上级ID") private Long parentId; @Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @ExcelProperty("节点类型") private String nodeType; - @Schema(description = "名称", example = "芋艿") + @Schema(description = "名称", example = "王五") @ExcelProperty("名称") private String name; @@ -44,20 +44,20 @@ public class DictionaryBusinessRespVO { @ExcelProperty("其他配置") private String customConfig; + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; - @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建日期") + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") private LocalDateTime createTime; @Schema(description = "备注") @ExcelProperty("备注") private String remark; - @Schema(description = "排序号") - @ExcelProperty("排序号") - private Integer sortNo; - } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessSaveReqVO.java index 8ab227c..21e9743 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/controller/vo/DictionaryBusinessSaveReqVO.java @@ -1,26 +1,28 @@ package com.zt.plat.module.qms.common.dic.controller.vo; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotEmpty; -import lombok.Data; +import lombok.*; +import java.util.*; +import jakarta.validation.constraints.*; -@Schema(description = "管理后台 - 业务参数字典新增/修改 Request VO") +@Schema(description = "管理后台 - 业务字典新增/修改 Request VO") @Data public class DictionaryBusinessSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5551") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20038") private Long id; - @Schema(description = "id路径", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID路径") private String idPath; - @Schema(description = "上级id", example = "3392") + @Schema(description = "上级ID", example = "17939") private Long parentId; @Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "节点类型不能为空") private String nodeType; - @Schema(description = "名称", example = "芋艿") + @Schema(description = "名称", example = "王五") private String name; @Schema(description = "键") @@ -32,12 +34,13 @@ public class DictionaryBusinessSaveReqVO { @Schema(description = "其他配置") private String customConfig; + @Schema(description = "排序号") + private Integer sortNo; + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注") private String remark; - @Schema(description = "排序号") - private Integer sortNo; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/dataobject/DictionaryBusinessDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/dataobject/DictionaryBusinessDO.java index 97d00b6..9ddfcc0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/dataobject/DictionaryBusinessDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/dataobject/DictionaryBusinessDO.java @@ -1,10 +1,13 @@ package com.zt.plat.module.qms.common.dic.dal.dataobject; -import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; -import com.baomidou.mybatisplus.annotation.*; import lombok.*; +import java.util.*; + import java.time.LocalDateTime; + import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; /** -* 业务参数字典 DO +* 业务字典 DO * * @author 后台管理 */ @@ -29,12 +32,12 @@ public class DictionaryBusinessDO extends BusinessBaseDO { @TableId(type = IdType.ASSIGN_ID) private Long id; /** - * id路径 + * ID路径 */ @TableField("ID_PATH") private String idPath; /** - * 上级id + * 上级ID */ @TableField("PRN_ID") private Long parentId; @@ -64,6 +67,11 @@ public class DictionaryBusinessDO extends BusinessBaseDO { @TableField("CST_CFG") private String customConfig; /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** * 所属部门 */ @TableField("SYS_DEPT_CD") @@ -73,10 +81,5 @@ public class DictionaryBusinessDO extends BusinessBaseDO { */ @TableField("RMK") private String remark; - /** - * 排序号 - */ - @TableField("SRT_NO") - private Integer sortNo; } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java index 5c8827d..f438223 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/dal/mapper/DictionaryBusinessMapper.java @@ -4,6 +4,7 @@ import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.module.qms.common.dic.controller.vo.*; +import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessPageReqVO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.module.qms.core.legend.vo.DictModel; import org.apache.ibatis.annotations.Mapper; @@ -28,6 +29,7 @@ public interface DictionaryBusinessMapper extends BaseMapperX queryDictItemsByKey(String key); CommonResult getDataByDataKey(String key); + String getValueByDataKey(String key); //保存分类 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/service/DictionaryBusinessServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/service/DictionaryBusinessServiceImpl.java index f6007b8..318c7f3 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/service/DictionaryBusinessServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/common/dic/service/DictionaryBusinessServiceImpl.java @@ -6,6 +6,9 @@ import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.module.qms.common.dic.controller.vo.*; +import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessPageReqVO; +import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessRespVO; +import com.zt.plat.module.qms.common.dic.controller.vo.DictionaryBusinessSaveReqVO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper; import com.zt.plat.module.qms.core.constant.CacheConstant; @@ -240,6 +243,14 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService return CommonResult.success(vo); } + @Override + public String getValueByDataKey(String key) { + CommonResult result = getDataByDataKey(key); + if(!result.isSuccess()) + return null; + return result.getData().getValue(); + } + @Override public CommonResult saveCategory(DictionaryBusinessSaveReqVO entity) { if(entity.getParentId() == null) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java index 4683d4a..b5209fb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/CodeGenUtil.java @@ -11,8 +11,6 @@ import org.apache.commons.lang.StringUtils; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; -import com.alibaba.fastjson.JSON; - import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; import com.zt.plat.framework.tenant.core.context.TenantContextHolder; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SequenceUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SequenceUtil.java index cfa6d1a..b8d970a 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SequenceUtil.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/code/SequenceUtil.java @@ -25,7 +25,7 @@ public class SequenceUtil { */ public String genCode(String sequenceCode) { if (sequenceApi == null) { - throw new ServiceException(500, "序列号服务为空"); + throw new ServiceException(1_032_100_000, "序列号服务为空"); } String circulationValue = null; List inputStrs = null; @@ -40,7 +40,7 @@ public class SequenceUtil { if (result != null && result.isSuccess() && result.getData() != null) { return result.getData(); } - throw new ServiceException(500, "调用远程服务获取序列号异常"); + throw new ServiceException(1_032_100_000, "调用远程服务获取序列号异常"); } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/liteflow/parser/QmsXmlFlowELParser.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/liteflow/parser/QmsXmlFlowELParser.java index efabf3e..c96540d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/liteflow/parser/QmsXmlFlowELParser.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/liteflow/parser/QmsXmlFlowELParser.java @@ -65,7 +65,7 @@ public class QmsXmlFlowELParser extends ClassXmlFlowELParser { } //当还未配置时,添加一个默认的规则,否则启动会报错 - if (chainResult.size() <= 0) { + if (chainResult.size() <= 0) { chainResult.add(StrUtil.format(QmsXmlFlowElParserConstant.CHAIN_XML_PATTERN, "default-demo", "SER()")); } String chainsContent = CollUtil.join(chainResult, StrUtil.EMPTY); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java new file mode 100644 index 0000000..fcc29d1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/cmp/AllowanceCalculatorComponent.java @@ -0,0 +1,136 @@ +package com.zt.plat.module.qms.core.qlexpress.cmp; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +import org.springframework.stereotype.Component; + +import com.ql.util.express.DefaultContext; +import com.ql.util.express.ExpressRunner; + +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; + +/** + * 允差值计算器工具类 + */ +@Slf4j +@Component +public class AllowanceCalculatorComponent { + + @Resource + private ExpressRunner expressRunner; + + /** + * 计算允差值:支持原生线性公式 和 Express 自定义公式混合模式 + * + * @param minValue 允差范围最小值 (X1) + * @param maxValue 允差范围最大值 (X2) + * @param minYc 最小允差值 (Y1) + * @param maxYc 最大允差值 (Y2) + * @param c 常数偏移量 C + * @param ran 当前测量值 X + * @param isUseFormula 是否使用自定义公式 (1=是, 其他=否) + * @param formula 自定义表达式字符串,如 "X > 10 ? 0.5 : 0.3",变量用 X 表示当前值 + * @param scale 结果保留小数位数 + * @return 允差值 yc + */ + public BigDecimal calculateAllowableValue( + BigDecimal minValue, + BigDecimal maxValue, + BigDecimal minYc, + BigDecimal maxYc, + BigDecimal c, + BigDecimal ran, + Integer isUseFormula, + String formula, + int scale) { + + // 参数校验 + if (minValue == null || maxValue == null || minYc == null || maxYc == null || + c == null || ran == null || scale < 0) { + throw new IllegalArgumentException("参数不能为空,且 scale >= 0"); + } + + boolean useCustomFormula = isUseFormula != null && isUseFormula.intValue() == 1; + + if (useCustomFormula && (formula == null || formula.trim().isEmpty())) { + throw new IllegalArgumentException("启用了自定义公式,但 formula 为空"); + } + + BigDecimal ycValue; + + try { + if (useCustomFormula) { + log.debug("使用自定义公式计算: formula='{}', X={}", formula, ran); + ycValue = evaluateCustomFormula(formula, ran, scale); + } else { + log.debug("使用线性公式计算: X={}, range=[{},{}], yc=[{},{}]", ran, minValue, maxValue, minYc, maxYc); + ycValue = calculateLinearAllowance(minValue, maxValue, minYc, maxYc, c, ran, scale); + } + } catch (Exception e) { + log.error("计算允差值失败", e); + throw new RuntimeException("计算允差值失败: " + e.getMessage(), e); + } + + return ycValue; + } + + /** + * 使用 Express 执行自定义公式 + */ + private BigDecimal evaluateCustomFormula(String formula, BigDecimal xValue, int scale) { + DefaultContext context = new DefaultContext<>(); + context.put("X", xValue); // 用户公式中使用 X 作为变量名 + + try { + Object result = expressRunner.execute(formula, context, null, true, false); + + if (result == null) { + throw new RuntimeException("Express 公式返回结果为 null"); + } + + BigDecimal decimalResult; + if (result instanceof BigDecimal) { + decimalResult = (BigDecimal) result; + } else if (result instanceof Number) { + decimalResult = new BigDecimal(((Number) result).toString()); + } else { + decimalResult = new BigDecimal(result.toString()); + } + + return decimalResult.setScale(scale, RoundingMode.HALF_EVEN); + } catch (Exception e) { + throw new RuntimeException("执行自定义公式失败: '" + formula + "', 错误: " + e.getMessage(), e); + } + } + + /** + * 原生 Java 计算线性允差值:yc = k * X + b + c + */ + private BigDecimal calculateLinearAllowance( + BigDecimal minValue, + BigDecimal maxValue, + BigDecimal minYc, + BigDecimal maxYc, + BigDecimal c, + BigDecimal ran, + int scale) { + + BigDecimal deltaVa = maxValue.subtract(minValue); + BigDecimal deltaYc = maxYc.subtract(minYc); + + BigDecimal k; + if (deltaVa.compareTo(BigDecimal.ZERO) == 0) { + k = BigDecimal.ZERO; // 防止除零 + } else { + k = deltaYc.divide(deltaVa, 10, RoundingMode.HALF_EVEN); // 高精度除法 + } + + BigDecimal b = maxYc.subtract(maxValue.multiply(k)); + return k.multiply(ran) + .add(b) + .add(c) + .setScale(scale, RoundingMode.HALF_EVEN); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java new file mode 100644 index 0000000..5d0180e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/config/QlExpressRuleEngineConfig.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.core.qlexpress.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.ql.util.express.ExpressRunner; +import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven; + +@Configuration +public class QlExpressRuleEngineConfig { + + @Bean + public ExpressRunner expressRunner() { + //需要高精度计算支持 + ExpressRunner expressRunner = new ExpressRunner(true, false); + expressRunner.addFunction("roundToScale", new RoundToScaleHalfEven()); + return expressRunner; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java new file mode 100644 index 0000000..2053ae0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/RoundToScaleHalfEven.java @@ -0,0 +1,25 @@ +package com.zt.plat.module.qms.core.qlexpress.function; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +import com.ql.util.express.Operator; + +public class RoundToScaleHalfEven extends Operator { + + @Override + public Object executeInner(Object[] list) throws Exception { + if (list.length != 2) { + throw new Exception("roundToScale函数需要2个参数:数值和小数位数"); + } + + double value = Double.parseDouble(list[0].toString()); + int scale = Integer.parseInt(list[1].toString()); + + BigDecimal bd = BigDecimal.valueOf(value); + bd = bd.setScale(scale, RoundingMode.HALF_EVEN); + return bd; + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/package-info.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/package-info.java new file mode 100644 index 0000000..02438bd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/qlexpress/function/package-info.java @@ -0,0 +1,4 @@ +/** + * 占位 + */ +package com.zt.plat.module.qms.core.qlexpress.function; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/sampleflow/SampleFlowNode.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/sampleflow/SampleFlowNode.java index caee31e..e69ec8d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/sampleflow/SampleFlowNode.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/core/sampleflow/SampleFlowNode.java @@ -3,6 +3,7 @@ package com.zt.plat.module.qms.core.sampleflow; import java.io.Serializable; import java.util.List; +import cn.hutool.core.collection.CollUtil; import lombok.Data; import lombok.experimental.Accessors; @@ -19,7 +20,7 @@ public class SampleFlowNode implements Serializable { private String nodeName; /** 是否默认流程 **/ - private Boolean isDefault; + private Boolean isDefault = false; /** 条件 **/ private String condition; @@ -29,4 +30,16 @@ public class SampleFlowNode implements Serializable { /** 下级流程节点 **/ private List nextFlowNodeList; + + /** 获取下级流程节点名称 **/ + public String getNextFlowNodeName() { + StringBuilder sb = new StringBuilder(); + if (CollUtil.isNotEmpty(this.nextFlowNodeList)) { + for (SampleFlowNode sampleFlowNode : nextFlowNodeList) { + sb.append(sampleFlowNode.getNodeName()).append("、"); + } + sb.delete(sb.length() - 1, sb.length()); + } + return sb.toString(); + } } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java new file mode 100644 index 0000000..44ef86e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/config/DataPermissionConfiguration.java @@ -0,0 +1,18 @@ +package com.zt.plat.module.qms.framework.datapermission.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.zt.plat.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer; + +@Configuration(proxyBeanMethods = false) +public class DataPermissionConfiguration { + + @Bean + public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { + return rule -> { + // dept + //rule.addUserColumn(AdminUserDO.class, "id"); + }; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java new file mode 100644 index 0000000..ee6e48b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/datapermission/package-info.java @@ -0,0 +1,4 @@ +/** + * qms 模块的数据权限配置 + */ +package com.zt.plat.module.qms.framework.datapermission; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/GridReport.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/GridReport.java new file mode 100644 index 0000000..9ff73f2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/GridReport.java @@ -0,0 +1,180 @@ +package com.zt.plat.module.qms.framework.gridreport; + +import java.io.Serializable; +import java.util.Map; + +import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException; +import gridreport.jni.BinaryObject; +import gridreport.jni.E2IMGOption; +import gridreport.jni.ExportImageType; +import gridreport.jni.ExportOption; +import gridreport.jni.ExportType; +import gridreport.jni.Report; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class GridReport implements Serializable { + + private static final long serialVersionUID = -8308393930858342837L; + + public static final String WR_PREFIX = "_WR_"; + + private String gridReportOutPath; + + public GridReport() {} + + public GridReport(String gridReportOutPath) { + this.gridReportOutPath = gridReportOutPath; + } + + /** + * 输出目录 + * @return + */ + public String getGridReportOutPath() { + return gridReportOutPath; + } + + /** + * 获取报表对象 + * @return + * @throws Exception + */ + public Report getReport() throws Exception { + if (!"amd64".equalsIgnoreCase(System.getProperty("os.arch"))) { + log.error("锐浪报表SDK不支持当前" + System.getProperty("os.arch") + "平台!"); + } + Report report = new Report(); + if (report.getNativeHandle() == 0) { + throw new Exception("Report Create failed."); + } + return report; + } + + /** + * 导出报表二进制数据 + * @param reportTemplate 报表模板json数据 + * @param reportData 报表json数据 + * @param reportParams 报表参数 + * @param type 报表类型 + * @return + * @throws Exception + */ + public BinaryObject genReport(String reportTemplate, String reportData, Map reportParams, ExportType type) throws Exception { + Report report = new Report(); + boolean success = report.LoadFromStr(reportTemplate); + if (!success) { + log.error("加载报表模板数据失败!"); + throw new GridReportException("加载报表模板数据失败!"); + } + success = report.LoadDataFromXML(reportData); + if (!success) { + log.error("加载报表数据失败!"); + throw new GridReportException("加载报表数据失败!"); + } + //处理报表参数 + for (Map.Entry param : reportParams.entrySet()) { + if (report.ParameterByName(param.getKey()) != null) { + report.ParameterByName(param.getKey()).setAsString(param.getValue()); + } + } + BinaryObject bo = report.ExportDirectToBinaryObject(type); + if (bo == null || bo.getNativeHandle() == 0) { + log.error("导出二进制数据失败!"); + throw new GridReportException("导出二进制数据失败!"); + } + return bo; + } + + /** + * 导出报表二进制数据 + * @param reportTemplate 报表模板json数据 + * @param reportData 报表json数据 + * @param reportParams 报表参数 + * @param type 报表类型 + * @param imgType 指定生成的图像数据格式,仅当生成图像数据时需要,可选[png|bmp|jpg|tif] + * @param imgDpi 指定导出图像的分辨率DPI,默认为96。打印的化需要根据打印机来具体设置 + * @return + * @throws Exception + */ + public BinaryObject genReport(String reportTemplate, String reportData, Map reportParams, ExportType type, ExportImageType imgType, Integer imgDPI) throws Exception { + Report report = new Report(); + boolean success = report.LoadFromStr(reportTemplate); + if (!success) { + log.error("加载报表模板数据失败!"); + throw new GridReportException("加载报表模板数据失败!"); + } + success = report.LoadDataFromXML(reportData); + if (!success) { + log.error("加载报表数据失败!"); + throw new GridReportException("加载报表数据失败!"); + } + //处理报表参数 + for (Map.Entry param : reportParams.entrySet()) { + if (report.ParameterByName(param.getKey()) != null) { + report.ParameterByName(param.getKey()).setAsString(param.getValue()); + } + } + //准备进行数据导出,指定要导出的文件类型。 + //在调用Export方法之前一定要调用本方法,在其后一定要调用UnprepareExport方法。本方法返回的选项对象的接口引用可以用来设定选项值。 + ExportOption exportOption = report.PrepareExport(type); + if (type.equals(ExportType.IMG)) {//如果为图片格式 + //获取将本对象转换为导出图像文件选项对象的接口引用。 + E2IMGOption e2imgOption = exportOption.getAsE2IMGOption(); + //设置图片格式 + e2imgOption.setImageType(imgType); + //所有页产生在一个图像文件中 + e2imgOption.setAllInOne(true); + e2imgOption.setDPI(imgDPI); + } + //执行数据导出 + BinaryObject bo = report.ExportToBinaryObject(); + //数据导出完成之后,进行一些内部释放任务。 + report.UnprepareExport(); + if (bo == null || bo.getNativeHandle() == 0) { + log.error("导出二进制数据失败!"); + throw new GridReportException("导出二进制数据失败!"); + } + return bo; + + } + + /** + * 生成报表并保存 + * @param reportName 报表名称 + * @param reportTemplate 报表模板json + * @param reportData 报表数据json + * @param reportParams 报表参数 + * @param type 报表类型 + * @return 报表保存路径 + * @throws Exception + */ + public String genReportAndSave(String reportName, String reportTemplate, String reportData, Map reportParams, ExportType type) throws Exception { + Report report = new Report(); + boolean success = report.LoadFromStr(reportTemplate); + if (!success) { + log.error("加载报表模板数据失败!"); + throw new GridReportException("加载报表模板数据失败!"); + } + success = report.LoadDataFromXML(reportData); + if (!success) { + log.error("加载报表数据失败!"); + throw new GridReportException("加载报表数据失败!"); + } + //处理报表参数 + for (Map.Entry param : reportParams.entrySet()) { + if (report.ParameterByName(param.getKey()) != null) { + report.ParameterByName(param.getKey()).setAsString(param.getValue()); + } + } + BinaryObject bo = report.ExportDirectToBinaryObject(type); + if (bo == null || bo.getNativeHandle() == 0) { + log.error("导出二进制数据失败!"); + throw new GridReportException("导出二进制数据失败!"); + } + String exportPathFile = this.gridReportOutPath + reportName + "." + type.toString().toLowerCase(); + bo.SaveToFile(exportPathFile); + report.Release(); + return exportPathFile; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/PdfHelper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/PdfHelper.java new file mode 100644 index 0000000..04341b9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/PdfHelper.java @@ -0,0 +1,134 @@ +package com.zt.plat.module.qms.framework.gridreport; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import javax.imageio.ImageIO; + +import org.apache.commons.lang3.StringUtils; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.pdmodel.PDDocumentInformation; +import com.spire.pdf.PdfDocument; +import com.spire.pdf.graphics.PdfImageType; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class PdfHelper { + + /** + * 修改pdf属性 + * @param pdfBytes pdf + * @param author 作者 + * @return + */ + public static byte[] modifyDocInfo(byte[] pdfBytes) { + return modifyDocInfo(pdfBytes, null, null, null, null, null, null); + } + + /** + * 修改pdf属性 + * @param pdfBytes pdf + * @param author 作者 + * @return + */ + public static byte[] modifyDocInfo(byte[] pdfBytes, String author) { + return modifyDocInfo(pdfBytes, null, author, null, null, null, null); + } + + /** + * 修改pdf属性 + * @param pdfBytes pdf + * @param author 作者 + * @param subject 主题 + * @return + */ + public static byte[] modifyDocInfo(byte[] pdfBytes, String author, String subject) { + return modifyDocInfo(pdfBytes, null, author, subject, null, null, null); + } + + /** + * 修改pdf属性 + * @param pdfBytes pdf + * @param title 标题 + * @param author 作者 + * @param subject 主题 + * @param keywords 关键字 + * @param creator 应用程序 + * @param producer 制作程序 + * @return + */ + public static byte[] modifyDocInfo(byte[] pdfBytes, String title, String author, String subject, String keywords, String creator, String producer) { + //加载PDF文件 + try (PDDocument pdfDocument = PDDocument.load(pdfBytes); ByteArrayOutputStream baos = new ByteArrayOutputStream();) { + //属性信息 + PDDocumentInformation info = pdfDocument.getDocumentInformation(); + //标题 + if (StringUtils.isNotBlank(title)) { + info.setTitle(title); + } + + //作者 + if (StringUtils.isNotBlank(author)) { + info.setAuthor(author); + } else { + info.setAuthor("王兴荣"); + } + + //主题 + if (StringUtils.isNotBlank(subject)) { + info.setSubject(subject); + } else { + info.setSubject("志者竟成报告系统"); + } + + //关键字 + if (StringUtils.isNotBlank(keywords)) { + info.setKeywords(keywords); + } + + //应用程序 + if (StringUtils.isNotBlank(creator)) { + info.setCreator(creator); + } else { + info.setCreator("志者竟成报告系统"); + } + + //pdf制作程序 + if (StringUtils.isNotBlank(producer)) { + info.setProducer(producer); + } else { + info.setProducer("志者竟成报告系统V1.0"); + } + //将修改后的PDF保存 + pdfDocument.save(baos); + return baos.toByteArray(); + } catch (Exception e) { + log.error("处理pdf出错!"); + } + return null; + } + + /** + * pdf转png图片 + * @param pdfBytes pdf + * @param dpi DPI + * @return + */ + public static byte[] pdfToPng(byte[] pdfBytes, int dpi) { + long startTime = System.nanoTime(); + //加载PDF文件 + PdfDocument pdfDocument = new PdfDocument(); + pdfDocument.loadFromBytes(pdfBytes); + try ( ByteArrayOutputStream baos = new ByteArrayOutputStream();) { + BufferedImage bufferedImage = pdfDocument.saveAsImage(0, PdfImageType.Bitmap, dpi, dpi); + ImageIO.write(bufferedImage, "PNG", baos); + long endTime = System.nanoTime(); + log.info("png转换用时:{}ms", (endTime - startTime)/1000000); + return baos.toByteArray(); + } catch (Exception e) { + log.error("处理pdf出错!"); + } + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/config/GridReportConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/config/GridReportConfig.java new file mode 100644 index 0000000..57f460e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/config/GridReportConfig.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.framework.gridreport.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.zt.plat.module.qms.framework.gridreport.GridReport; +import gridreport.jni.Report; + +@Configuration +public class GridReportConfig { + + /** gridreport服务器安装地址,详见锐浪报表帮助文档,Java报表服务器开发起步-web报表服务器(JAVA) **/ + @Value("${zzjc.report.gridreport.server.path:/usr/local/grsvr6}") + private String gridReportPath; + + /** 文档输出目录 **/ + @Value("${zzjc.report.gridreport.file.out-path:/appdata/data/pdf}") + private String gridReportOutPath; + + @Bean + public GridReport gridReport() { + //初始化报表模块路径 + Report.ConfigModulePath(gridReportPath); + return new GridReport(gridReportOutPath); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/exception/GridReportException.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/exception/GridReportException.java new file mode 100644 index 0000000..82bd5b2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/gridreport/exception/GridReportException.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.framework.gridreport.exception; + +public class GridReportException extends Exception { + + private static final long serialVersionUID = 3767718880859242703L; + + public GridReportException() { + super(); + } + + public GridReportException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + public GridReportException(String message, Throwable cause) { + super(message, cause); + } + + public GridReportException(String message) { + super(message); + } + + public GridReportException(Throwable cause) { + super(cause); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java index 21daebb..4f0e709 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java @@ -1,13 +1,17 @@ package com.zt.plat.module.qms.framework.rpc.config; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; +import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.infra.api.file.FileApi; +import com.zt.plat.module.system.api.dept.DeptApi; +import com.zt.plat.module.system.api.permission.PermissionApi; import com.zt.plat.module.system.api.sequence.SequenceApi; +import com.zt.plat.module.system.api.user.AdminUserApi; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; @Configuration(value = "qmsRpcConfiguration", proxyBeanMethods = false) -@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, BpmProcessInstanceApi.class}) +@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, AdminUserApi.class, DeptApi.class, BpmProcessInstanceApi.class, BpmTaskApi.class, PermissionApi.class}) public class RpcConfiguration { } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java new file mode 100644 index 0000000..4a52207 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/controller/admin/IotConnectManagerStatsController.java @@ -0,0 +1,339 @@ +package com.zt.plat.module.qms.iot.controller.admin; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.iot.service.IotConnectManagerStatsService; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessagePublisher; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageVo; +import com.zt.plat.module.qms.iot.tcpserver.core.*; +import com.github.xingfudeshi.knife4j.annotations.ApiOperationSupport; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.stat.ChannelStat; +import tech.zzjc.tio.starter.TioServerBootstrap; +import tech.zzjc.tio.utils.lock.SetWithLock; + +import java.util.*; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.stream.Collectors; + +import static java.lang.Thread.sleep; + +/** + * IotManagerStatsController + * iot 管理统计 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-12-1          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-12-1 + */ +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/qms/resource/iot/connect-manager-stats") +@Tag(name = "iot连接管理-连接统计") +public class IotConnectManagerStatsController { + + @Autowired private TioServerBootstrap tioServerBootstrap; + @Autowired public RedisSessionComponent redisSessionComponent; + @Autowired private Environment environment; + @Autowired private TioServerMessagePublisher tioServerMessagePublisher; + @Autowired private IotConnectManagerStatsService iotConnectManagerStatsService; + @GetMapping("/all-connect") + @ApiOperationSupport(order = 1) + @Operation(summary = "获取当前所有连接") + public CommonResult currentAllConnect(@RequestParam(name = "clientIp", required = false) String clientIp) { + + //获取spring服务端口 + String serverPort = environment.getProperty("server.port"); + String serverName = environment.getProperty("spring.application.name"); + String msg = "当前服务端口:" + serverPort + ",服务名称:" + serverName; + log.error(msg); + List list = new ArrayList<>(); + Set deviceKeys = redisSessionComponent.scanKeys(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY + "*"); + Set clientKeys = redisSessionComponent.scanKeys(IotClientSessionContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY + "*"); + + for(String key : deviceKeys){ + IotDeviceSessionForRedisContext deviceContext = redisSessionComponent.getByKey( key); + String deviceId = deviceContext.getDeviceId(); + String bsId = Long.toString(Long.valueOf(deviceId), Character.MAX_RADIX); + ChannelStatInfo info = new ChannelStatInfo(); + info.setId(deviceContext.getChannelId()); +// info.setId(deviceContext.getDeviceCode()); + info.setBsId(bsId); + String controlRealName = ObjectUtils.isEmpty(deviceContext.getControlRealName())? "无" : deviceContext.getControlRealName(); + String deviceName = deviceContext.getDeviceName(); + String deviceCode = deviceContext.getDeviceCode(); +// info.setRealName(userRealName); +// info.setRemarks("操作人:" + userRealName); + info.setDeviceId(deviceContext.getDeviceId()); + info.setDeviceCode(deviceCode); + info.setDeviceType(deviceContext.getDeviceType()); + info.setDeviceName(deviceName); + StringBuilder sb = new StringBuilder(); + if (StringUtils.isNoneBlank(deviceName)) { + sb.append("设备名称:").append(deviceName).append(";"); + } else { + sb.append("注册号:").append(deviceCode).append(";"); + //deviceInfo.append("设备Id:").append(deviceId).append(";"); + } + sb.append("控制人:").append(controlRealName); + info.setRemarks(sb.toString()); + info.setClientIp(deviceContext.getClientIp()); + info.setClientPort(deviceContext.getClientPort()); + info.setClientProtocol(deviceContext.getClientProtocol()); + info.setProxyIp(deviceContext.getProxyIp()); + info.setProxyPort(deviceContext.getProxyPort()); + info.setProxyProtocol(deviceContext.getProxyProtocol()); + info.setConnectType(deviceContext.getConnectType()); + //info.setReConnCount(reconnCount); + info.setDecodeFailCount(deviceContext.getDecodeFailCount()); + info.setUserId(deviceContext.getUserId()); +// info.setToken(token); + info.setGmtCreate(deviceContext.getGmtCreate()); + info.setReceivedBytes(deviceContext.getReceivedBytes()); + info.setReceivedPackets(deviceContext.getReceivedPackets()); + info.setReceivedTcps(deviceContext.getReceivedTcps()); + info.setBytesPerTcpReceive(deviceContext.getBytesPerTcpReceive()); + info.setPacketsPerTcpReceive(deviceContext.getPacketsPerTcpReceive()); + info.setHandledBytes(deviceContext.getHandledBytes()); + info.setHandledPackets(deviceContext.getHandledPackets()); + info.setSentBytes(deviceContext.getSentBytes()); + info.setSentPackets(deviceContext.getSentPackets()); + if(deviceContext.getLastBalanceDataTime() != null) + info.setGmtLatestCommunicate(new Date(deviceContext.getLastBalanceDataTime())); + if(deviceContext.getRegTime() != null) + info.setRegTime(deviceContext.getRegTime()); + + list.add(info); + + } + + for(String key : clientKeys){ + IotClientSessionForRedisContext clientContext = redisSessionComponent.getClientByKey( key); + ChannelStatInfo info = new ChannelStatInfo(); + info.setId(clientContext.getChannelId()); + String controlRealName = ObjectUtils.isEmpty(clientContext.getControlRealName())? "无" : clientContext.getControlRealName(); +// info.setRealName(userRealName); +// info.setRemarks("操作人:" + userRealName); + StringBuilder sb = new StringBuilder(); + sb.append("操作人:").append(controlRealName); + info.setRemarks(sb.toString()); + info.setClientIp(clientContext.getClientIp()); + info.setClientPort(clientContext.getClientPort()); + info.setClientProtocol(clientContext.getClientProtocol()); + info.setProxyIp(clientContext.getProxyIp()); + info.setProxyPort(clientContext.getProxyPort()); + info.setProxyProtocol(clientContext.getProxyProtocol()); + info.setConnectType(clientContext.getConnectType()); + //info.setReConnCount(reconnCount); + info.setDecodeFailCount(clientContext.getDecodeFailCount()); + info.setUserId(clientContext.getUserId()); +// info.setToken(token); + info.setGmtCreate(clientContext.getGmtCreate()); + info.setReceivedBytes(clientContext.getReceivedBytes()); + info.setReceivedPackets(clientContext.getReceivedPackets()); + info.setReceivedTcps(clientContext.getReceivedTcps()); + info.setBytesPerTcpReceive(clientContext.getBytesPerTcpReceive()); + info.setPacketsPerTcpReceive(clientContext.getPacketsPerTcpReceive()); + info.setHandledBytes(clientContext.getHandledBytes()); + info.setHandledPackets(clientContext.getHandledPackets()); + info.setSentBytes(clientContext.getSentBytes()); + info.setSentPackets(clientContext.getSentPackets()); + info.setGmtLatestCommunicate(clientContext.getLastCommunicateTime()); + info.setRegTime(clientContext.getRegTime()); + + list.add(info); + + } + + SetWithLock setWithLock = Tio.getAll(tioServerBootstrap.getServerTioConfig()); + Set set = null; + ReentrantReadWriteLock.ReadLock readLock = setWithLock.getLock().readLock(); + +// try { +// readLock.lock(); +// set = setWithLock.getObj(); +// for (ChannelContext channelContext : set) { +// +// ChannelStatInfo info = new ChannelStatInfo(); +// ChannelStat stat = channelContext.stat; +// +// +// String id = channelContext.getId(); +// String bsId = channelContext.getBsId(); +// Date regTime = channelContext.get("regTime") == null ? null : (Date) channelContext.get("regTime"); +// String ip = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); // 客户端IP +// int port = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() : Integer.parseInt(channelContext.get("realClientPort").toString()); // 客户端端口 +// String protocol = channelContext.get("realClientProtocol") == null ? channelContext.getClientNode().getProtocol() : channelContext.get("realClientProtocol").toString();//协议 +// String ipProxy = channelContext.getProxyClientNode() == null ? "" : channelContext.getProxyClientNode().getIp();//代理 ip +// int portProxy = channelContext.getProxyClientNode() == null ? -1 : channelContext.getProxyClientNode().getPort();//代理 端口 +// String protocolProxy = channelContext.getProxyClientNode() == null ? "" : channelContext.getProxyClientNode().getProtocol(); //代理协议 +// +// //连接类型 +// String connectType = channelContext.get(ChannelContextConstant.CONNECT_TYPE) == null ? "" : channelContext.get(ChannelContextConstant.CONNECT_TYPE).toString(); +// if(connectType.equals(ChannelContextConstant.CONNECT_DEVICE)) //设备 +// continue; +// switch (connectType) { +// case ChannelContextConstant.CONNECT_CONSOLE_CLIENT://控制客户端 +// String userRealName = channelContext.get("user-real-name") == null ? "无" : channelContext.get("user-real-name").toString(); +// info.setRealName(userRealName); +// info.setRemarks("操作人:" + userRealName); +// break; +// case ChannelContextConstant.CONNECT_CAA_CLIENT://平板端 +// String caaUserRealName = channelContext.get("user-real-name") == null ? "无" : channelContext.get("user-real-name").toString(); +// info.setRealName(caaUserRealName); +// info.setRemarks("操作人:" + caaUserRealName); +// break; +// case ChannelContextConstant.CONNECT_DEVICE://设备 +// IotDeviceSessionContext deviceSessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); +// String deviceCode = deviceSessionContext.getDeviceCode(); +// IotDeviceSessionForRedisContext deviceContext = redisSessionComponent.getByDeviceCode(deviceCode); +// String deviceId = ""; +// String deviceType = ""; +// String deviceName = ""; +// String controlRealName = ""; +// if(deviceContext != null){ +// deviceId = deviceContext.getDeviceId(); +// deviceType = deviceContext.getDeviceType(); +// deviceName = deviceContext.getDeviceName(); +// controlRealName = deviceContext.getControlRealName(); +// } +// info.setDeviceId(deviceId); +// info.setDeviceCode(deviceCode); +// info.setDeviceType(deviceType); +// info.setDeviceName(deviceName); +// info.setControlRealName(controlRealName); +// StringBuilder deviceInfo = new StringBuilder(); +// if (StringUtils.isNoneBlank(deviceName)) { +// deviceInfo.append("设备名称:").append(deviceName).append(";"); +// } else { +// deviceInfo.append("注册号:").append(deviceCode).append(";"); +// //deviceInfo.append("设备Id:").append(deviceId).append(";"); +// } +// deviceInfo.append("控制人:").append(controlRealName); +// info.setRemarks(deviceInfo.toString()); +// break; +// +// default: +// break; +// } +// +// +// int decodeFailCount = stat.getDecodeFailCount(); // 解码异常次数 +// String userId = channelContext.userid; // 用户ID +// String token = channelContext.getToken(); // 用户token +// long timeStart = stat.getTimeCreated(); // 统计开始时间 +// // 统计时长 +// AtomicLong receivedBytes = stat.getReceivedBytes(); // 已接收字节 +// AtomicLong receivedPackets = stat.getReceivedPackets(); // 已接收业务包 +// AtomicLong receivedTcps = stat.getReceivedTcps(); // 已接收TCP包 +// +// double bytesPerTcpReceive = stat.getBytesPerTcpReceive(); // 平均每次TCP包接收的字节数 +// double packetsPerTcpReceive = stat.getPacketsPerTcpReceive(); // 平均每次TCP包接收的业务包 +// +// AtomicLong handledBytes = stat.getHandledBytes(); // 已处理字节 +// AtomicLong handledPackets = stat.getHandledPackets(); // 已处理业务包 +// +// AtomicLong sentBytes = stat.getSentBytes(); // 已发送字节数 +// AtomicLong sentPackets = stat.getSentPackets(); // 已发送业务包 +// +// long timeLatestReceivedMsg = stat.getLatestTimeOfReceivedByte(); +// long timeLatestSentMsg = stat.getLatestTimeOfSentPacket(); +// long latestCommunicateTime = Math.max(timeLatestReceivedMsg, timeLatestSentMsg); // 最近一次通信时间 +// +// info.setId(id); +// info.setBsId(bsId); +// info.setClientIp(ip); +// info.setClientPort(port); +// info.setClientProtocol(protocol); +// info.setProxyIp(ipProxy); +// info.setProxyPort(portProxy); +// info.setProxyProtocol(protocolProxy); +// info.setConnectType(connectType); +// //info.setReConnCount(reconnCount); +// info.setDecodeFailCount(decodeFailCount); +// info.setUserId(userId); +// info.setToken(token); +// info.setGmtCreate(new Date(timeStart)); +// info.setReceivedBytes(receivedBytes); +// info.setReceivedPackets(receivedPackets); +// info.setReceivedTcps(receivedTcps); +// info.setBytesPerTcpReceive(bytesPerTcpReceive); +// info.setPacketsPerTcpReceive(packetsPerTcpReceive); +// info.setHandledBytes(handledBytes); +// info.setHandledPackets(handledPackets); +// info.setSentBytes(sentBytes); +// info.setSentPackets(sentPackets); +// info.setGmtLatestCommunicate(new Date(latestCommunicateTime)); +// info.setRegTime(regTime); +// +// list.add(info); +// +//// log.info("Current Client Info : [{}].", info); +// } +// } catch (Throwable e) { +// log.error("获取在线连接失败!", e); +// } finally { +// readLock.unlock(); +// } + +// List resultList = list.stream().filter(f -> { +// if (StringUtils.isNotBlank(clientIp)) { +// return clientIp.equals(f.getClientIp()); +// } +// return true; +// }).sorted(Comparator.comparing(ChannelStatInfo::getClientIp).thenComparing(ChannelStatInfo::getConnectType).thenComparing(ChannelStatInfo::getClientPort)).collect(Collectors.toList()); + return CommonResult.success(list); + } + + /** + * 关闭连接 + * @param id ChannelContextId + * @return + */ + @PostMapping("/close") + @ApiOperationSupport(order = 6) + @Operation(summary = "关闭连接") + public CommonResult close(@RequestParam(name="id",required=true) String id) throws InterruptedException { + return iotConnectManagerStatsService.close(id, "0"); + } + + /** + * 清除设备控制 + * @param id + * @return + */ + @PostMapping("/clearDeviceControl") + @ApiOperationSupport(order = 7) + @Operation(summary = "清除设备控制") + public CommonResult clearDeviceControl(@RequestParam(name="id") String id) throws InterruptedException { + return iotConnectManagerStatsService.clearDeviceControl(id, "0"); + } + + @RequestMapping("/testMsg") + public CommonResult testMsg() { + + TioServerMessageVo vo = new TioServerMessageVo(); + vo.setServerClusterMsgType("type1"); + vo.setGroup("aaaa"); + tioServerMessagePublisher.publish( vo); + return CommonResult.success("ok"); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java new file mode 100644 index 0000000..fce43bb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/mapper/IotHelloMapper.java @@ -0,0 +1,8 @@ +//package com.zt.plat.module.qms.iot.mapper; +// +//import com.baomidou.mybatisplus.core.mapper.BaseMapper; +//import com.yncic.modules.iot.entity.IotHelloEntity; +// +//public interface IotHelloMapper extends BaseMapper { +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java new file mode 100644 index 0000000..8337255 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IIotHelloService.java @@ -0,0 +1,13 @@ +//package com.zt.plat.module.qms.iot.service; +// +//import com.baomidou.mybatisplus.extension.service.IService; +//import com.yncic.modules.iot.entity.IotHelloEntity; +// +///** +// * 测试接口 +// */ +//public interface IIotHelloService extends IService { +// +// String hello(); +// +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IotConnectManagerStatsService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IotConnectManagerStatsService.java new file mode 100644 index 0000000..7075b07 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/IotConnectManagerStatsService.java @@ -0,0 +1,80 @@ +package com.zt.plat.module.qms.iot.service; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessagePublisher; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageVo; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.RequestParam; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.starter.TioServerBootstrap; + +import static java.lang.Thread.sleep; + +@Service +public class IotConnectManagerStatsService { + + @Autowired + private TioServerBootstrap tioServerBootstrap; + @Autowired public RedisSessionComponent redisSessionComponent; + @Autowired private TioServerMessagePublisher tioServerMessagePublisher; + + public CommonResult close(String id, String fromSubscribe) throws InterruptedException { + ChannelContext channelContext = Tio.getByChannelContextId(tioServerBootstrap.getServerTioConfig(), id); + if(channelContext == null){ + if("1".equals(fromSubscribe)) + return CommonResult.success("ok"); + //广播消息处理 + TioServerMessageVo message = new TioServerMessageVo(); + message.setServerClusterMsgType(TioServerMessageConfig.MESSAGE_TYPE_CLOSE_MANUAL); + message.setChannelId(id); + tioServerMessagePublisher.publish(message); + //延迟0.5秒返回 + sleep(500); + return CommonResult.success("ok"); + } + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + String deviceId = sessionContext.getDeviceId(); + if(!ObjectUtils.isEmpty(deviceId)) + redisSessionComponent.deleteByDeviceId(deviceId); + Tio.IpBlacklist.clear();//清空全局黑名单 + Tio.close(channelContext, "控制端主动关闭连接"); + return CommonResult.success("ok"); + } + + public CommonResult clearDeviceControl(String id, String fromSubscribe) throws InterruptedException { + ChannelContext channelContext = Tio.getByChannelContextId(tioServerBootstrap.getServerTioConfig(), id); + Tio.IpBlacklist.clear();//清空全局黑名单 + if(channelContext == null){ + if("1".equals(fromSubscribe)) + return CommonResult.success("ok"); + //广播消息处理 + TioServerMessageVo message = new TioServerMessageVo(); + message.setServerClusterMsgType(TioServerMessageConfig.MESSAGE_TYPE_CLEAR_MANUAL); + message.setChannelId(id); + tioServerMessagePublisher.publish(message); + //延迟0.5秒返回 + sleep(500); + return CommonResult.success("ok"); + } + IotDeviceSessionContext deviceSessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + String deviceId = deviceSessionContext.getDeviceId(); + if(!ObjectUtils.isEmpty(deviceId)){ + redisSessionComponent.clearControlByDeviceId(deviceId, channelContext); + } +// if(channelContext != null) { + //设置控制点的channelContext +// deviceSessionContext.setControlChannelContext(null); +// deviceSessionContext.setControlRealName(""); +// channelContext.set(ChannelContextConstant.CONTROL_DEVICE_ID, ""); +// } + return CommonResult.success("ok"); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java new file mode 100644 index 0000000..385848d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/service/impl/IotHelloServiceImpl.java @@ -0,0 +1,19 @@ +//package com.zt.plat.module.qms.iot.service.impl; +// +//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +//import com.yncic.modules.iot.entity.IotHelloEntity; +//import com.yncic.modules.iot.mapper.IotHelloMapper; +//import com.yncic.modules.iot.service.IIotHelloService; +//import org.springframework.stereotype.Service; +// +///** +// * 测试Service +// */ +//@Service +//public class IotHelloServiceImpl extends ServiceImpl implements IIotHelloService { +// +// @Override +// public String hello() { +// return "hello ,我是 iot 微服务节点!"; +// } +//} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IgnorePacket.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IgnorePacket.java new file mode 100644 index 0000000..250830d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IgnorePacket.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import tech.zzjc.tio.core.intf.Packet; + +/** + * IgnorePacket + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +public class IgnorePacket extends Packet { + + private static final long serialVersionUID = 6940342835895273535L; + + /** + * 实例 + */ + public static final IgnorePacket INSTANCE = new IgnorePacket(); + + private IgnorePacket() { + } + + @Override + public String logstr() { + return "IgnorePacket"; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDataUtils.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDataUtils.java new file mode 100644 index 0000000..3f3169b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDataUtils.java @@ -0,0 +1,144 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.core.Balance; +import com.zt.plat.module.qms.iot.tcpserver.core.Weighbridge; +import com.zt.plat.module.qms.iot.tcpserver.core.WeightUnit; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.utils.lock.MapWithLock; + +import java.io.UnsupportedEncodingException; + +import static com.zt.plat.module.qms.iot.tcpserver.IotDeviceType.BALANCE; + +/** + * IotDataUtils + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月16日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月16日 + */ +public class IotDataUtils { + + private static MapWithLock iotToConn = new MapWithLock<>(); + + public static void hander(ChannelContext channelContext, String data) { + IotDeviceType iotDeviceType = (IotDeviceType) channelContext.get("iotType"); + String iotCode = (String) channelContext.get("iotCode"); + String bsId = channelContext.getBsId(); + ChannelContext toChannelContext = iotToConn.get(bsId); + switch (iotDeviceType) { + case BALANCE: + double weightData = 0d; + String weightUnit = null; + if (data.startsWith("S")) { + String[] splits = data.split(" "); + System.out.println("第一个:" + splits[0]); + System.out.println("第二个:" + splits[1]); + System.out.println("重量数据:" + splits[splits.length - 2]); + System.out.println("单位数据:" + splits[splits.length - 1]); + weightData = Double.parseDouble(splits[splits.length - 2]); + weightUnit = splits[splits.length - 1]; + } else { + data = data.replace("(", "").replace(")", ""); + String[] splits = data.split(" "); + System.out.println(iotCode + "重量数据:" + splits[0]); + System.out.println(iotCode + "单位数据:" + splits[1]); + weightData = Double.parseDouble(splits[0]); + weightUnit = splits[1]; + } + if (toChannelContext != null && !toChannelContext.isClosed) { + Balance balance = new Balance(); + balance.setDeviceId(iotCode); + balance.setWeight(weightData); + balance.setWeightUnit(WeightUnit.getByName(weightUnit)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type", BALANCE); + jsonObject.put("data", balance); + IotPacket packet = new IotPacket(); + try { + packet.setBody((jsonObject.toJSONString() + "\r\n").getBytes(IotPacket.CHARSET)); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + Tio.send(toChannelContext, packet); + } + + + break; + case WEIGHBRIDGE: + String[] splits = data.split(" "); + double weightData1 = Double.parseDouble(splits[0]); + String weightUnit1 = splits[1]; + if (toChannelContext != null && !toChannelContext.isClosed) { + Weighbridge weighbridge = new Weighbridge(); + weighbridge.setWeighbridge(weightData1); + weighbridge.setWeightUnit(WeightUnit.getByName(weightUnit1)); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("type", "weighbridge"); + jsonObject.put("data", weighbridge); + IotPacket packet = new IotPacket(); + try { + packet.setBody((jsonObject.toJSONString() + "\r\n").getBytes(IotPacket.CHARSET)); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + Tio.send(toChannelContext, packet); + } + break; + case INFRARED: + //String iotCode = (String) channelContext.get("iotCode"); + Integer intIotCode = Integer.parseInt(iotCode); + JSONObject jsonObject = new JSONObject(); + if (intIotCode % 2 == 0) { + JSONObject infraredRight = new JSONObject(); + infraredRight.put("infraredRight", Integer.parseInt(data)); + jsonObject.put("type", "infraredRight"); + jsonObject.put("data", infraredRight); + } else { + JSONObject infraredLeft = new JSONObject(); + infraredLeft.put("infraredLeft", Integer.parseInt(data)); + jsonObject.put("type", "infraredLeft"); + jsonObject.put("data", infraredLeft); + } + if (toChannelContext != null && !toChannelContext.isClosed) { + IotPacket packet = new IotPacket(); + try { + packet.setBody((jsonObject.toJSONString() + "\r\n").getBytes(IotPacket.CHARSET)); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + Tio.send(toChannelContext, packet); + } + break; + default: + break; + } + + + } + + public static void addIot(String iot, ChannelContext channelContext) { + if (iotToConn.get(iot) != null) { + iotToConn.remove(iot); + iotToConn.put(iot, channelContext); + } else { + iotToConn.put(iot, channelContext); + } + } + + public static void removeIot(ChannelContext channelContext) { + String[] connDeviceCode = (String[]) channelContext.get("connDeviceCode"); + String connType = (String) channelContext.get("connType"); + if (connDeviceCode == null) return; + for (String connDevice : connDeviceCode) { + iotToConn.remove(connType + connDevice); + } + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDeviceType.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDeviceType.java new file mode 100644 index 0000000..7134bf3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotDeviceType.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +/** + * IotDeviceType + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月16日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月16日 + */ +public enum IotDeviceType { + INFRARED("infrared", "红外"), + BALANCE("balance", "天平"), + THERMOMETER("temp", "温度计"), + PACKING_MACHINE("packing_machine", "自动定量包装机"), + WEIGHBRIDGE("weighbridge", "地磅"), + TRAFFIC_LIGHT("traffic_light", "交通灯"); + + private String type; + + private String desc; + + private IotDeviceType(String type, String desc) { + this.type = type; + this.desc = desc; + } + + public static IotDeviceType getByType(String type) { + IotDeviceType[] values = IotDeviceType.values(); + for (IotDeviceType iotDeviceType : values) { + if (iotDeviceType.type.equalsIgnoreCase(type)) { + return iotDeviceType; + } + } + return null; + } + + public String getType() { + return type; + } + + public String getDesc() { + return desc; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotPacket.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotPacket.java new file mode 100644 index 0000000..3fdae4e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotPacket.java @@ -0,0 +1,26 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import tech.zzjc.tio.starter.DefaultPacket; + +/** + * IotPacket + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月10日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月10日 + */ +public class IotPacket extends DefaultPacket { + + private static final long serialVersionUID = 8322462724507348884L; + + public static final String CHARSET = "UTF-8"; + + public static final String PING = "ping"; + + public static final String PONG = "pong"; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerAioListener.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerAioListener.java new file mode 100644 index 0000000..38e39b5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerAioListener.java @@ -0,0 +1,109 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import com.zt.plat.module.qms.iot.tcpserver.core.*; +import com.zt.plat.module.qms.iot.tcpserver.core.IotClientSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.zt.plat.module.qms.iot.tcpserver.proxy.ProxyProtocolDecoder; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import tech.zzjc.tio.common.starter.annotation.TioServerAioListener; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.intf.Packet; +import tech.zzjc.tio.server.intf.ServerAioListener; + +/** + * IotServerAioListener + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月11日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月11日 + */ +@Slf4j +@TioServerAioListener +public class IotServerAioListener implements ServerAioListener { + +// @Autowired +// private IDeviceMeasurePointService deviceMeasurePointService; + +// @Autowired +// private IMeasurePointService measurePointService; + @Autowired public RedisSessionComponent redisSessionComponent; + + @Override + public void onAfterConnected(ChannelContext channelContext, boolean isConnected, boolean isReconnect) throws Exception { + log.info("onAfterConnected channelContext:{}, isConnected:{}, isReconnect:{}", channelContext, isConnected, isReconnect); + //连接后,需要把连接会话对象设置给channelContext + channelContext.set(IotClientSessionContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY, new IotClientSessionContext()); + channelContext.set(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY, new IotDeviceSessionContext()); + //设置为支持代理协议 + ProxyProtocolDecoder.enableProxyProtocol(channelContext); + } + + @Override + public void onAfterDecoded(ChannelContext channelContext, Packet packet, int packetSize) throws Exception { + log.debug("onAfterDecoded"); + } + + @Override + public void onAfterReceivedBytes(ChannelContext channelContext, int receivedBytes) throws Exception { + log.debug("onAfterReceivedBytes"); + } + + @Override + public void onAfterSent(ChannelContext channelContext, Packet packet, boolean isSentSuccess) throws Exception { + log.debug("onAfterSent channelContext:{}, isSentSuccess:{}", channelContext, isSentSuccess); + } + + @Override + public void onAfterHandled(ChannelContext channelContext, Packet packet, long cost) throws Exception { + log.debug("onAfterHandled"); + } + + @Override + public void onBeforeClose(ChannelContext channelContext, Throwable throwable, String remark, boolean isRemove) throws Exception { + + //连接断开,更新数据库连接状态 + IotClientSessionContext iotClientSessionContext = (IotClientSessionContext) channelContext.get(IotClientSessionContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY); + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + + String deviceId = sessionContext.getDeviceId(); + log.info("onBeforeClose deviceId:" + deviceId); + //设备断开,清除redis记录 + if(!ObjectUtils.isEmpty(deviceId)){ + redisSessionComponent.deleteByDeviceId(deviceId); + } + + //客户端断开,清除控制 + Object deviceCode = channelContext.get(ChannelContextConstant.CONTROL_DEVICE_ID); + if(!ObjectUtils.isEmpty(deviceCode)){ + redisSessionComponent.clearControlByDeviceCode(deviceCode.toString(), channelContext); + } + //解绑业务ID + Tio.unbindBsId(channelContext); + //解绑群组 + Tio.unbindGroup(channelContext); + //解绑用户 + Tio.unbindUser(channelContext); + //解绑token + Tio.unbindToken(channelContext); + //移除 + IotDataUtils.removeIot(channelContext); + + log.info(channelContext.get("realClientIp") + ":" + channelContext.get("realClientPort") + " onBeforeClose"); + } + + @Override + public boolean onHeartbeatTimeout(ChannelContext channelContext, Long interval, int heartbeatTimeoutCount) { + log.debug("onHeartbeatTimeout"); + return false; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerMsgHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerMsgHandler.java new file mode 100644 index 0000000..b056252 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotServerMsgHandler.java @@ -0,0 +1,137 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import com.zt.plat.module.qms.iot.tcpserver.handler.IotClientHandler; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDeviceHandler; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotHander; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotHeartbeatHandler; +import com.zt.plat.module.qms.iot.tcpserver.proxy.ProxyProtocolDecoder; +import com.zt.plat.module.qms.iot.tcpserver.proxy.ProxyProtocolMessage; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import tech.zzjc.tio.common.starter.annotation.TioServerMsgHandler; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.TioConfig; +import tech.zzjc.tio.core.exception.LengthOverflowException; +import tech.zzjc.tio.core.exception.TioDecodeException; +import tech.zzjc.tio.core.intf.Packet; +import tech.zzjc.tio.core.utils.ByteBufferUtils; +import tech.zzjc.tio.server.intf.ServerAioHandler; + +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +/** + * IotServerMsgHandler + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月10日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月10日 + */ +@Slf4j +@TioServerMsgHandler +public class IotServerMsgHandler implements ServerAioHandler { + + @Autowired + private IotClientHandler iotClientHandler; + + @Autowired + private IotDeviceHandler iotDeviceHandler; + + @Autowired + private IotHeartbeatHandler iotHeartbeatHandler; + + @Override + public Packet decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext) throws TioDecodeException { + //解析代理协议 + if (ProxyProtocolDecoder.isProxyProtocolEnabled(channelContext)) { + try { + // 标记 + buffer.mark();// 解析 proxy 协议 + ProxyProtocolMessage message = ProxyProtocolDecoder.decodeForTest(buffer, readableLength); + // 半包的情况 + if (message == null) { + return null; + } + // 清除协议 key + ProxyProtocolDecoder.removeProxyProtocol(channelContext); + // 设置客户端代理节点 + String protocol = message.getProtocol(); +// if ("UNKNOWN".equals(protocol)) { +// channelContext.setProxyClientNode(new Node("UNKNOWN", message.getDestinationPort())); +// } else { +// Node realNode = new Node(message.getSourceAddress(), message.getSourcePort()); +// realNode.setProtocol("TCP"); +// channelContext.setClientNode(realNode); +// channelContext.setProxyClientNode(new Node(message.getDestinationAddress(), message.getDestinationPort())); +// } + channelContext.set("realClientIp", message.getSourceAddress()); + channelContext.set("realClientPort", message.getSourcePort()); + channelContext.set("realClientProtocol", protocol); + } catch (TioDecodeException e) { + // 清除协议 key,重置 buffer + ProxyProtocolDecoder.removeProxyProtocol(channelContext); + buffer.reset(); + } + return IgnorePacket.INSTANCE; + } + String line = null; + try { + line = ByteBufferUtils.readLine(buffer, null); + } catch (Exception | LengthOverflowException e) { + throw new TioDecodeException(e); + } + if (line == null) { + return null; + } + //清除左右两边的空格或换行 + line = line.trim(); + log.debug("line = " + line); + IotPacket packet = new IotPacket(); + packet.setBody(line.getBytes(Charset.forName(IotPacket.CHARSET))); + return packet; + } + + @Override + public ByteBuffer encode(Packet packet, TioConfig tioConfig, ChannelContext channelContext) { + IotPacket iotPacket = (IotPacket) packet; + byte[] body = iotPacket.getBody(); + // 消息长度 + int bodyLen = body.length; + // 分配一个新的字节缓冲区 + ByteBuffer buffer = ByteBuffer.allocate(bodyLen); + buffer.order(tioConfig.getByteOrder()); + // 写入消息体 + buffer.put(body); + return buffer; + } + + @Override + public void handler(Packet packet, ChannelContext channelContext) throws Exception { + IotPacket iotPacket = null; + byte[] body = null; + if (packet instanceof IotPacket) { + iotPacket = (IotPacket) packet; + body = iotPacket.getBody(); + } + if (body != null) { + String text = new String(body, IotPacket.CHARSET); + IotHander iotHander = null; + //心跳消息 + if (IotPacket.PING.equalsIgnoreCase(text)) { + iotHander = iotHeartbeatHandler; + } else if (text.startsWith("{") && text.endsWith("}")) { //如果是json格式,为客户端协议 + iotHander = iotClientHandler; + } else { //设备协议 + iotHander = iotDeviceHandler; + } + iotHander.hander(iotPacket, channelContext); + } + return; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java new file mode 100644 index 0000000..6d4fa80 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotUtils.java @@ -0,0 +1,76 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springframework.util.ObjectUtils; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; + +import java.math.BigInteger; +import java.nio.charset.Charset; + +/** + * IotUtils + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月27日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月27日 + */ +@Slf4j +public class IotUtils { + + /** + * 回复客户端心跳 + * @param channelContext + */ + public static void replyHeartbeat(ChannelContext channelContext) { + IotPacket resppacket = new IotPacket(); + resppacket.setBody((IotPacket.PONG + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.send(channelContext, resppacket); + log.debug(channelContext.getClientNode().getIp() + ":" + channelContext.getClientNode().getPort() +": 心跳消息。。。。"); + } + + + /** + * hex转byte数组 + * @param hex + * @return + */ + public static byte[] hexToByte(String hex){ + int m = 0, n = 0; + int byteLen = hex.length() / 2; // 每两个字符描述一个字节 + byte[] ret = new byte[byteLen]; + for (int i = 0; i < byteLen; i++) { + m = i * 2 + 1; + n = m + 1; + int intVal = Integer.decode("0x" + hex.substring(i * 2, m) + hex.substring(m, n)); + ret[i] = Byte.valueOf((byte)intVal); + } + return ret; + } + + public static String bytesToHex(byte[] data) { + StringBuilder sb = new StringBuilder(); + for (int n = 0; n < data.length; n++) { + sb.append(StringUtils.leftPad(Integer.toHexString(data[n] & 0xFF), 2, "0")); // 每个字节由两个字符表示,位数不够,高位补0 + } + return sb.toString(); + } + + public static String transDeviceCodeToId(String deviceCode){ + if(ObjectUtils.isEmpty(deviceCode)) + return ""; + return new BigInteger(deviceCode, Character.MAX_RADIX).toString(); + } + + public static String transDeviceIdToCode(String deviceId){ + if(ObjectUtils.isEmpty(deviceId)) + return ""; + return new BigInteger(deviceId).toString(Character.MAX_RADIX); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotWebSocketMsgHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotWebSocketMsgHandler.java new file mode 100644 index 0000000..d7d1344 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/IotWebSocketMsgHandler.java @@ -0,0 +1,147 @@ +package com.zt.plat.module.qms.iot.tcpserver; + +import com.zt.plat.module.qms.core.constant.CommonConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.ChannelContextConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotClientHandler; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDeviceHandler; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotHander; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotHeartbeatHandler; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import tech.zzjc.tio.common.starter.annotation.TioServerMsgHandler; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.http.common.HttpRequest; +import tech.zzjc.tio.http.common.HttpResponse; +import tech.zzjc.tio.websocket.common.WsRequest; +import tech.zzjc.tio.websocket.server.handler.IWsMsgHandler; + +import java.nio.charset.Charset; +import java.util.Objects; + +/** + * IotWebSocketMsgHandler + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月18日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月18日 + */ +@Slf4j +@TioServerMsgHandler +public class IotWebSocketMsgHandler implements IWsMsgHandler { + + @Autowired + private IotClientHandler iotClientHandler; + + @Autowired + private IotDeviceHandler iotDeviceHandler; + + @Autowired + private IotHeartbeatHandler iotHeartbeatHandler; + @Autowired public RedisSessionComponent redisSessionComponent; + + @Override + public HttpResponse handshake(HttpRequest httpRequest, HttpResponse httpResponse, ChannelContext channelContext) throws Exception { + log.info("WebSocket握手"); + return httpResponse; + } + + @Override + public void onAfterHandshaked(HttpRequest httpRequest, HttpResponse httpResponse, ChannelContext channelContext) throws Exception { + log.info("WebSocket握手完毕"); +// Map headers = httpRequest.getHeaders(); +// for (Map.Entry entry : headers.entrySet()) { +// log.info("请求头:" + entry.getKey() + " = " + entry.getValue()); +// } + String realClientIp = null; + String realClientPort = null; + try { + realClientIp = httpRequest.getHeader("x-forwarded-for"); + realClientPort = httpRequest.getHeader("x-client-port"); + if (StringUtils.isBlank(realClientIp) || CommonConstant.UNKNOWN.equalsIgnoreCase(realClientIp)) { + realClientIp = httpRequest.getHeader("X-Real-IP"); + realClientPort = httpRequest.getHeader("X-Real-PORT"); + } + if (StringUtils.isBlank(realClientIp) || CommonConstant.UNKNOWN.equalsIgnoreCase(realClientIp)) { + realClientIp = httpRequest.getHeader("Proxy-Client-IP"); + } + if (StringUtils.isBlank(realClientIp) || CommonConstant.UNKNOWN.equalsIgnoreCase(realClientIp)) { + realClientIp = httpRequest.getHeader("WL-Proxy-Client-IP"); + } + if (StringUtils.isBlank(realClientIp) || CommonConstant.UNKNOWN.equalsIgnoreCase(realClientIp)) { + realClientIp = httpRequest.getHeader("HTTP_CLIENT_IP"); + } + if (StringUtils.isBlank(realClientIp) || CommonConstant.UNKNOWN.equalsIgnoreCase(realClientIp)) { + realClientIp = httpRequest.getHeader("HTTP_X_FORWARDED_FOR"); + } + } catch (Exception e) { + log.error("IPUtils ERROR ", e); + } + log.info("real ip:" + realClientIp); + if (StringUtils.isNotBlank(realClientIp) && !Objects.equals(realClientIp, channelContext.getClientNode().getIp())) { +// Node realNode = new Node(realIp, channelContext.getClientNode().getPort()); +// realNode.setProtocol("WEB SOCKET"); +// channelContext.setClientNode(realNode); +// channelContext.setProxyClientNode(new Node(channelContext.getClientNode().getIp(), channelContext.getClientNode().getPort())); + channelContext.set("realClientIp", realClientIp); + channelContext.set("realClientPort", realClientPort); + channelContext.set("realClientProtocol", "WebSocket"); + } + } + + @Override + public Object onBytes(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception { + return null; + } + + @Override + public Object onClose(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception { + //获取客户端连接信息 + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String realClient = realClientIp + ":" + realClientPort; + log.info("WebSocket断开{}", realClient); + //当前连接的是什么类型客户端 + String connectType = channelContext.get(ChannelContextConstant.CONNECT_TYPE) == null ? "" : channelContext.get(ChannelContextConstant.CONNECT_TYPE).toString(); + switch (connectType) { + case ChannelContextConstant.CONNECT_CAA_CLIENT: + //判断是否控制设备,如果控制设备则取消设备控制 + String deviceCode = channelContext.get(ChannelContextConstant.CONTROL_DEVICE_ID) == null ? "" : channelContext.get(ChannelContextConstant.CONTROL_DEVICE_ID).toString(); + if (StringUtils.isNotBlank(deviceCode)) { + redisSessionComponent.clearControlByDeviceCode(deviceCode, channelContext); + } + break; + + default: + break; + } + return null; + } + + @Override + public Object onText(WsRequest wsRequest, String text, ChannelContext channelContext) throws Exception { + //IotProtocol.handle(text, channelContext); + IotHander iotHander = null; + //心跳消息 + if (IotPacket.PING.equalsIgnoreCase(text)) { + iotHander = iotHeartbeatHandler; + } else if (text.startsWith("{") && text.endsWith("}")) { //如果是json格式,为客户端协议 + iotHander = iotClientHandler; + } else { //设备协议 + iotHander = iotDeviceHandler; + } + IotPacket iotPacket = new IotPacket(); + iotPacket.setBody(text.getBytes(Charset.forName(IotPacket.CHARSET))); + iotHander.hander(iotPacket, channelContext); + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientControlDeviceHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientControlDeviceHander.java new file mode 100644 index 0000000..b9d509b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientControlDeviceHander.java @@ -0,0 +1,167 @@ +package com.zt.plat.module.qms.iot.tcpserver.caaclient; + +import com.zt.plat.module.qms.iot.tcpserver.IotUtils; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessagePublisher; +import com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageVo; +import com.zt.plat.module.qms.iot.tcpserver.core.*; +import com.zt.plat.module.qms.iot.tcpserver.core.ChannelContextConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.ClientType; +import com.zt.plat.module.qms.iot.tcpserver.core.Command; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.caaclient.bean.ControlDevice; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.cluster.TioClusterConfig; +import tech.zzjc.tio.cluster.TioClusterVo; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.ChannelContextFilter; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.TioConfig; +import tech.zzjc.tio.core.stat.ChannelStat; + +import java.nio.charset.Charset; +import java.util.Date; + +import static com.zt.plat.module.qms.iot.tcpserver.core.GroupConstant.CAA_ALL_CLIENT; + +/** + * IotCaaClientControlDeviceHander + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-11-22          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-11-22 + */ +@Slf4j +@Component +public class IotCaaClientControlDeviceHander implements IotDataHander { + + @Autowired public RedisSessionComponent redisSessionComponent; + + @Autowired + private TioServerMessagePublisher tioServerMessagePublisher; + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + ControlDevice controlDeviceOriginal = JSON.parseObject(data, ControlDevice.class); + ControlDevice controlDevice = JSON.parseObject(data, ControlDevice.class); + //获取客户端连接信息 + ChannelStat stat = channelContext.stat; + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String deviceId = controlDevice.getDeviceId(); + String realClient = realClientIp + ":" + realClientPort; + log.info("{},, APP客户端控制设备 :{}", realClient, controlDevice); + JSONObject json = null; + IotPacket iotPacket = new IotPacket(); + if (StringUtils.isBlank(deviceId)) { + json = new JSONObject(); + json.put("msgId", msgId); + json.put("cmd", Command.REPLY_CONTROL_DEVICE.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); + controlDevice.setSuccess(false); + controlDevice.setMsg("设备解析为空!"); + json.put("data", controlDevice); + iotPacket = new IotPacket(); + iotPacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.send(channelContext, iotPacket); + return null; + } + IotDeviceSessionForRedisContext deviceContext = redisSessionComponent.getByDeviceId(deviceId); + if (deviceContext == null) { + //如果是订阅消息,不再广播 + if("1".equals(controlDevice.getFromSubscribe())) + return null; + json = new JSONObject(); + json.put("msgId", msgId); + json.put("cmd", Command.REPLY_CONTROL_DEVICE.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); + controlDevice.setSuccess(false); + controlDevice.setMsg("设备不在线!"); + json.put("data", controlDevice); + iotPacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.send(channelContext, iotPacket); + return null; + } + String deviceControlUserId = deviceContext.getUserId(); + String curUserId = controlDevice.getControlUserId(); + + String deviceCode = IotUtils.transDeviceIdToCode(deviceId); + ChannelContext deviceChannelContext = Tio.getByBsId(channelContext.getTioConfig(), deviceCode); + //如果设备不在本服务实例,发送广播到其他服务处理 + if(deviceChannelContext == null){ + String channelId = deviceContext.getChannelId(); + TioServerMessageVo message = new TioServerMessageVo(); + message.setServerClusterMsgType(TioServerMessageConfig.MESSAGE_TYPE_CONTROL); + message.setChannelId(channelId); +// message.setChannelContext(channelContext); + controlDeviceOriginal.setFromSubscribe("1"); + iotPacket.setBody((JSONObject.toJSONString(controlDeviceOriginal) + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + message.setPacket(iotPacket); + tioServerMessagePublisher.publish(message); + return null; + } + + TioConfig tioConfig = deviceChannelContext.getTioConfig(); + if (controlDevice.getIsControl()) { + //控制 +// deviceContext.setControlChannelContext(channelContext); + deviceContext.setControlRealName(controlDevice.getControlRealName()); + deviceContext.setUserId(curUserId); + channelContext.set(ChannelContextConstant.CONTROL_DEVICE_ID, deviceCode); + controlDevice.setMsg("设备被“" + controlDevice.getControlRealName() + "”远程控制!"); + redisSessionComponent.update(deviceContext); + } else { + //释放 + redisSessionComponent.clearControlByDeviceId(deviceId, channelContext); + controlDevice.setMsg("“" + controlDevice.getControlRealName() + "”取消设备远程控制!"); + } + + //获取客户端连接信息 +// String deviceRealClientIp = deviceChannelContext.get("realClientIp") == null ? deviceChannelContext.getClientNode().getIp() : deviceChannelContext.get("realClientIp").toString(); +// String deviceRealClientPort = deviceChannelContext.get("realClientPort") == null ? deviceChannelContext.getClientNode().getPort() + "" : deviceChannelContext.get("realClientPort").toString(); +// String deviceRealClient = deviceRealClientIp + ":" + deviceRealClientPort; +// log.info("{}, 设备:{},旧控制:{},新的控制:{}", realClient, deviceRealClient, oldDeviceChannelContext, realClient); + + json = new JSONObject(); + json.put("msgId", msgId); + json.put("cmd", Command.REPLY_CONTROL_DEVICE.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); +// controlDevice.setSuccess(true); +// json.put("data", controlDevice); + json.put("data", JSON.parseObject(data, ControlDevice.class)); + iotPacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + //发送通知到其他服务实例(其他实例通知各自客户端) + TioClusterConfig tioClusterConfig = tioConfig.getTioClusterConfig(); + TioClusterVo iotClusterVo = new TioClusterVo(iotPacket); + iotClusterVo.setGroup(CAA_ALL_CLIENT); + tioClusterConfig.publish(iotClusterVo); + + //发送消息到本服务实例连接的客户端 + Tio.sendToGroup(tioConfig, CAA_ALL_CLIENT, iotPacket, new ChannelContextFilter() { + @Override + public boolean filter(ChannelContext cc) { + if (channelContext.getId().equals(cc.getId())) { + return false; + } + return true; + }} + ); + + + + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientRegisterHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientRegisterHander.java new file mode 100644 index 0000000..f75486e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/IotCaaClientRegisterHander.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.iot.tcpserver.caaclient; + +import com.alibaba.fastjson.JSON; +import com.fhs.common.spring.SpringContextUtil; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean.Register; +import com.zt.plat.module.qms.iot.tcpserver.core.ClientType; +import com.zt.plat.module.qms.iot.tcpserver.core.Command; +import com.zt.plat.module.qms.iot.tcpserver.core.ReplyResult; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.utils.SystemTimer; + +import java.nio.charset.Charset; +import java.util.Date; + +import static com.zt.plat.module.qms.iot.tcpserver.core.GroupConstant.CAA_ALL_CLIENT; + +/** + * IotCaaClientRegisterHander + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-20          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-20 + */ +@Slf4j +@Component +public class IotCaaClientRegisterHander implements IotDataHander { + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + Register register = JSON.parseObject(data, Register.class); + + Tio.bindUser(channelContext, register.getUserId()); + Tio.bindToken(channelContext, register.getUserId()); + channelContext.set("regTime", new Date()); + channelContext.set("user-real-name", register.getUserRealName()); + IotPacket resppacket = new IotPacket(); + resppacket.setBody((ReplyResult.success(msgId, ClientType.CAA_CLIENT.getName(), Command.REPLY_REGISTER.getName()) + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + //回复注册成功 + Tio.send(channelContext, resppacket); + //绑定群组 + Tio.bindGroup(channelContext, CAA_ALL_CLIENT); + + //在redis记录客户端信息 +// RedisSessionComponent redisSessionComponent = (RedisSessionComponent) SpringContextUtil.getBean("redisSessionComponent"); +// redisSessionComponent.regClient(channelContext); + + + // + + + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/bean/ControlDevice.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/bean/ControlDevice.java new file mode 100644 index 0000000..ba8cfc3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/caaclient/bean/ControlDevice.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.iot.tcpserver.caaclient.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * ControlDevice + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-11-22          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-11-22 + */ +@Data +public class ControlDevice implements Serializable { + + private static final long serialVersionUID = -8644114517602085199L; + + /** 设备id **/ + private String deviceId; + + /** 控制者姓名 **/ + private String controlRealName; + private String controlUserId; + + /** 是否控制 **/ + private Boolean isControl; + + /** 回复app时使用 **/ + private Boolean success; + + /** 回复app时使用 消息 **/ + private String msg; + + /** 来自消息订阅 **/ + private String fromSubscribe; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/InstanceIdProvider.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/InstanceIdProvider.java new file mode 100644 index 0000000..5c6fc9a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/InstanceIdProvider.java @@ -0,0 +1,20 @@ +package com.zt.plat.module.qms.iot.tcpserver.cluster; + +import org.springframework.stereotype.Component; + +import java.util.UUID; + +@Component +public class InstanceIdProvider { + + private final String instanceId; + + public InstanceIdProvider() { + //使用随机 UUID(每次重启会变) + this.instanceId = UUID.randomUUID().toString(); + } + + public String getInstanceId() { + return instanceId; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageConfig.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageConfig.java new file mode 100644 index 0000000..3d7209d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageConfig.java @@ -0,0 +1,16 @@ +package com.zt.plat.module.qms.iot.tcpserver.cluster; + +public class TioServerMessageConfig { + + public static final String SERVER_CLUSTER_TOPIC_CHANNEL = "zzjc-cluster-tio-server"; + + + public static final String MESSAGE_TYPE_CONTROL = "control"; //设备控制消息 + public static final String MESSAGE_TYPE_CLEAR_MANUAL = "clearControlManual"; //手动清除控制 + public static final String MESSAGE_TYPE_CLOSE_MANUAL = "closeManual"; //手动断开连接 + public static final String MESSAGE_TYPE_NOTICE = "notice"; //通知消息。应该用不到。 + + + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessagePublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessagePublisher.java new file mode 100644 index 0000000..c71643f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessagePublisher.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver.cluster; + +import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RTopic; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import tech.zzjc.tio.server.ServerTioConfig; + +import static com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig.SERVER_CLUSTER_TOPIC_CHANNEL; + +@Service +@Slf4j +public class TioServerMessagePublisher { + + @Autowired + private RedissonClient redissonClient; + @Autowired + private InstanceIdProvider instanceIdProvider; // 注入实例ID提供者 + + + + public void publish(TioServerMessageVo message) { + message.setSenderInstanceId(instanceIdProvider.getInstanceId()); + RTopic topic = redissonClient.getTopic(SERVER_CLUSTER_TOPIC_CHANNEL); + topic.publish(message); + log.error("[Publisher] 已发布消息: " + message); + + + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageSubscriber.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageSubscriber.java new file mode 100644 index 0000000..2105abd --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageSubscriber.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.iot.tcpserver.cluster; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.service.IotConnectManagerStatsService; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import jakarta.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RTopic; +import org.redisson.api.RedissonClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.TioConfig; +import tech.zzjc.tio.server.ServerTioConfig; +import tech.zzjc.tio.server.TioServer; +import tech.zzjc.tio.starter.TioServerBootstrap; +import tech.zzjc.tio.utils.lock.SetWithLock; + +import static com.zt.plat.module.qms.iot.tcpserver.cluster.TioServerMessageConfig.SERVER_CLUSTER_TOPIC_CHANNEL; + +@Component +@Slf4j +public class TioServerMessageSubscriber { + + @Autowired + private RedissonClient redissonClient; + @Autowired + private InstanceIdProvider instanceIdProvider; + + @Autowired + private IotDataHander iotCaaClientControlDeviceHander; + + @Autowired private TioServerBootstrap tioServerBootstrap; + @Autowired private IotConnectManagerStatsService iotConnectManagerStatsService; + + @PostConstruct + public void subscribe() { + RTopic topic = redissonClient.getTopic(SERVER_CLUSTER_TOPIC_CHANNEL); + topic.addListener(TioServerMessageVo.class, (channel, msg) -> { + String senderId = msg.getSenderInstanceId(); + String channelId = msg.getChannelId(); + String msgType = msg.getServerClusterMsgType(); + String currentId = instanceIdProvider.getInstanceId(); + if (currentId.equals(senderId)) { + log.debug("[Subscriber] 跳过自己发送的消息"); + return; + } + log.debug("[Subscriber] 收到消息频道 '" + channel + "' 的内容: " + msg); + + if(TioServerMessageConfig.MESSAGE_TYPE_CLEAR_MANUAL.equals(msgType)){ + try { + iotConnectManagerStatsService.clearDeviceControl(channelId,"1"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + return; + } + if(TioServerMessageConfig.MESSAGE_TYPE_CLOSE_MANUAL.equals(msgType)){ + try { + iotConnectManagerStatsService.close(channelId,"1"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + return; + } + + ServerTioConfig serverTioConfig = tioServerBootstrap.getServerTioConfig(); + SetWithLock all = Tio.getAll(serverTioConfig); + ChannelContext targetContext = null; + for(ChannelContext context : all.getObj()){ + targetContext = context; + String id = context.getId(); + if(id.equals(channelId)){ + break; + } + } + IotPacket packet = (IotPacket) msg.getPacket(); + byte[] body = packet.getBody(); + String bodyStr = new String(body); + JSONObject json = JSONObject.parseObject(bodyStr); + try { + iotCaaClientControlDeviceHander.hander(json.getString("msgId"), bodyStr, targetContext); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageVo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageVo.java new file mode 100644 index 0000000..aab434c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/cluster/TioServerMessageVo.java @@ -0,0 +1,18 @@ +package com.zt.plat.module.qms.iot.tcpserver.cluster; + +import lombok.Data; +import tech.zzjc.tio.cluster.TioClusterVo; +import tech.zzjc.tio.core.ChannelContext; + +@Data +public class TioServerMessageVo extends TioClusterVo { + + private String senderInstanceId; //发布者id + + + private String serverClusterMsgType; //消息类型: 设备 + + + private ChannelContext channelContext; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientCheckControlHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientCheckControlHander.java new file mode 100644 index 0000000..5c8cfc8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientCheckControlHander.java @@ -0,0 +1,68 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient; + +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; + +/** + * IotConsoleClientCheckControlHander + * 检查计量点是否控制 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-8-12          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-8-12 + */ +@Slf4j +@Component +public class IotConsoleClientCheckControlHander implements IotDataHander { + +// @Autowired +// private IUserMeasurePointService userMeasurePointService; + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + //获取客户端连接信息 + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String realClient = realClientIp + ":" + realClientPort; + log.info("{},检查控制点由谁控制", realClient); + String token = channelContext.getToken(); + IotPacket resppacket = null; +// List userMeasurePointList = userMeasurePointService.list(Wrappers.query().lambda().eq(UserMeasurePoint::getUserId, Func.toLong(userId))); +// for (UserMeasurePoint userMeasurePoint : userMeasurePointList) { +// //处理计量点由谁控制 +// ChannelContext measurePointChannelContext = Tio.getByBsId(channelContext.getTioConfig(), userMeasurePoint.getMeasurePointId().toString()); +// if (measurePointChannelContext == null) {//计量点不在线 +// continue; +// } +// IotClientSessionContext measurePointSessionContext = (IotClientSessionContext) measurePointChannelContext.get(IotClientSessionContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY); +// ChannelContext controlConsoleClientChannelContext = measurePointSessionContext.getControlConsoleClientChannelContext(); +// if (controlConsoleClientChannelContext == null) {//计量点未被控制 +// continue; +// } +// +// //计量点被控制 +// JSONObject json = new JSONObject(); +// json.put("msgId", msgId); +// json.put("cmd", Command.REPLY_CONTROL_MEASURE_POINT.getName()); +// json.put("clientType", ClientType.CONSOLE_CLIENT.getName()); +// ControlMeasurePoint controlMeasurePoint = new ControlMeasurePoint(); +// controlMeasurePoint.setMeasurePointId(userMeasurePoint.getMeasurePointId().toString()); +// controlMeasurePoint.setControlUserName(controlConsoleClientChannelContext.get("user-real-name").toString()); +// controlMeasurePoint.setSuccess(true); +// controlMeasurePoint.setIsControl(true); +// controlMeasurePoint.setMsg("计量点被“" + controlMeasurePoint.getControlUserName() + "”接管控制!"); +// json.put("data", controlMeasurePoint); +// resppacket = new IotPacket(); +// resppacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); +// Tio.send(channelContext, resppacket); +// } + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientRegisterHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientRegisterHander.java new file mode 100644 index 0000000..94cc763 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/IotConsoleClientRegisterHander.java @@ -0,0 +1,94 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient; + +import com.alibaba.fastjson.JSON; +import com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean.Register; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; + +/** + * IotConsoleClientRegisterHander + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-2          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-2 + */ +@Slf4j +@Component +public class IotConsoleClientRegisterHander implements IotDataHander { + + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + //获取客户端连接信息 + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String realClient = realClientIp + ":" + realClientPort; + Register register = JSON.parseObject(data, Register.class); + log.info("{},, APP客户端注册租户ID:{},用户ID:{}", realClient, register.getTenantId(), register.getUserId()); + Tio.bindUser(channelContext, register.getUserId()); + Tio.bindToken(channelContext, register.getToken()); +// UserTokenContext.setToken(register.getToken()); +// channelContext.set("regTime", new Date()); +// channelContext.set("user-real-name", register.getUserRealName()); +// IotPacket resppacket = new IotPacket(); +// resppacket.setBody((ReplyResult.success(msgId, ClientType.CONSOLE_CLIENT.getName(), Command.REPLY_REGISTER.getName()) + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); +// //回复注册成功 +// Tio.send(channelContext, resppacket); +// +// Result> userMeasurePointResult = qmsApi.listByUserId(register.getUserId()); +// if (!userMeasurePointResult.isSuccess()) { +// return null; +// } +// List userMeasurePointList = userMeasurePointResult.getResult(); +// for (QmsBasMeasurePointWithUserAndDevice measurePointWithUserAndDevice : userMeasurePointList) { +// //绑定计量点 +// Tio.bindGroup(channelContext, measurePointWithUserAndDevice.getId()); +// //处理计量点由谁控制 +// ChannelContext measurePointChannelContext = Tio.getByBsId(channelContext.getTioConfig(), measurePointWithUserAndDevice.getId()); +// if (measurePointChannelContext == null) {//计量点不在线 +// continue; +// } +// +// //通知计量点重新上报计量数据 +// JSONObject json = new JSONObject(); +// json.put("msgId", msgId); +// json.put("cmd", Command.MEASURE_POINT_REUPLOAD.getName()); +// json.put("clientType", ClientType.MEASURE_POINT.getName()); +// json.put("data", null); +// resppacket = new IotPacket(); +// resppacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); +// Tio.send(measurePointChannelContext, resppacket); +// +// IotClientSessionContext measurePointSessionContext = (IotClientSessionContext) measurePointChannelContext.get(IotClientSessionContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY); +// ChannelContext controlConsoleClientChannelContext = measurePointSessionContext.getControlConsoleClientChannelContext(); +// if (controlConsoleClientChannelContext == null) {//计量点未被控制 +// continue; +// } +// +// //计量点被控制 +// json = new JSONObject(); +// json.put("msgId", msgId); +// json.put("cmd", Command.REPLY_CONTROL_MEASURE_POINT.getName()); +// json.put("clientType", ClientType.CONSOLE_CLIENT.getName()); +// ControlMeasurePoint controlMeasurePoint = new ControlMeasurePoint(); +// controlMeasurePoint.setMeasurePointId(measurePointWithUserAndDevice.getId()); +// controlMeasurePoint.setControlUserName(controlConsoleClientChannelContext.get("user-real-name").toString()); +// controlMeasurePoint.setSuccess(true); +// controlMeasurePoint.setIsControl(true); +// controlMeasurePoint.setMsg("计量点被“" + controlMeasurePoint.getControlUserName() + "”接管控制!"); +// json.put("data", controlMeasurePoint); +// resppacket = new IotPacket(); +// resppacket.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); +// Tio.send(channelContext, resppacket); +// } + + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/ControlMeasurePoint.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/ControlMeasurePoint.java new file mode 100644 index 0000000..4ef6f21 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/ControlMeasurePoint.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * ControlMeasurePoint + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-22          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-22 + */ +@Data +public class ControlMeasurePoint implements Serializable { + + private static final long serialVersionUID = 9162719990841191554L; + + /** 计量点id **/ + private String measurePointId; + + /** 控制者姓名 **/ + private String controlUserName; + + /** 是否控制 **/ + private Boolean isControl; + + /** 回复app时使用 **/ + private Boolean success; + + /** 回复app时使用 消息 **/ + private String msg; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasureData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasureData.java new file mode 100644 index 0000000..77bc74d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasureData.java @@ -0,0 +1,63 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * MeasureData + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-31          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-31 + */ +@Data +public class MeasureData implements Serializable { + + private static final long serialVersionUID = -3198903054162073974L; + + /** 计量点id **/ + private String measurePointId; + + /** 车号 **/ + private String carNo; + + /** 物料id **/ + private String goodsId; + + /** 物料名称 **/ + private String goodsName; + + /** 发货方ID **/ + private String sellerId; + + /** 发货方名称 **/ + private String sellerName; + + /** 收货方ID **/ + private String buyerId; + + /** 收货方名称 **/ + private String buyerName; + + /** 自编号(样本号/运单号) **/ + private String measureCode; + + /** 重量 **/ + private Double weight; + + /** 扣重 **/ + private Double weightK; + + /** 监磅人(司磅人) **/ + private String supervisor; + + /** 操作人姓名 **/ + private String opRealName; + + /** 备注 **/ + private String remark; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasurePointAutoWork.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasurePointAutoWork.java new file mode 100644 index 0000000..60828bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/MeasurePointAutoWork.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * MeasurePointAutoWork + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-28 + */ +@Data +public class MeasurePointAutoWork implements Serializable { + + private static final long serialVersionUID = 6101960561036835536L; + + /** 计量点id **/ + private String measurePointId; + + /** 计量点是否自动工作 **/ + private Boolean isAutoWork; + + /** 回复app时使用 **/ + private Boolean success; + + /** 回复app时使用 消息 **/ + private String msg; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/Register.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/Register.java new file mode 100644 index 0000000..4767b28 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/consoleclient/bean/Register.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver.consoleclient.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * Register + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-2          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-2 + */ +@Data +public class Register implements Serializable { + + private static final long serialVersionUID = -5968375015563741197L; + + /** 租户Id **/ + private String tenantId; + + /** 用户id **/ + private String userId; + + /** 用户姓名 **/ + private String userRealName; + + /** 令牌 **/ + private String token; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Balance.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Balance.java new file mode 100644 index 0000000..02adbff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Balance.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * Balance + * 天平 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月26日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月26日 + */ +@Data +public class Balance implements Serializable { + + private static final long serialVersionUID = 9077648523694145130L; + + /** 设备编号 **/ + private String deviceId; + + /** 天平重量 **/ + private Double weight; + + /** 重量单位 **/ + private WeightUnit weightUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelContextConstant.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelContextConstant.java new file mode 100644 index 0000000..89e201c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelContextConstant.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * ChannelContextConstant + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-11-26          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-11-26 + */ +public interface ChannelContextConstant { + + /** + * 连接类型 + */ + String CONNECT_TYPE = "CONNECT-TYPE"; + /** + * 连接设备 + */ + String CONNECT_DEVICE = "CONNECT-DEVICE"; + /** + * 连接caaclient + */ + String CONNECT_CAA_CLIENT = "CONNECT-CAA-CLIENT"; + /** + * 连接计量点控制app + */ + String CONNECT_CONSOLE_CLIENT = "CONNECT-CONSOLE-CLIENT"; + /** + * 控制的设备id + */ + String CONTROL_DEVICE_ID = "CONTROL-DEVICE-ID"; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelStatInfo.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelStatInfo.java new file mode 100644 index 0000000..742671f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ChannelStatInfo.java @@ -0,0 +1,169 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.concurrent.atomic.AtomicLong; + +/** + * ChannelStatInfo + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-12-1          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-12-1 + */ +@Data +public class ChannelStatInfo implements Serializable { + + private static final long serialVersionUID = -7066118329627225937L; + + /** + * ID + */ + private String id; + + /** + * 业务id + */ + private String bsId; + + /** + * 客户端IP + */ + private String clientIp; + + /** + * 端口 + */ + private int clientPort; + + /** + * 协议 + */ + private String clientProtocol; + + /** + * 代理ip + */ + private String proxyIp; + + /** + * 代理端口 + */ + private int proxyPort; + + /** + * 代理协议 + */ + private String proxyProtocol; + + /** + * 连接类型 + */ + private String connectType; + + /** + * 解码失败数 + */ + private int decodeFailCount; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户token + */ + private String token; + + /** + * 用户姓名 + */ + private String realName; + + /** 设备Id **/ + private String deviceId; + + /** 设备编码 **/ + private String deviceCode; + + /** 设备类型 **/ + private String deviceType; + + /** 设备名称 **/ + private String deviceName; + + /** 设置控制人名称 **/ + private String controlRealName; + + /** + * 统计开始时间 + */ + private Date gmtCreate; + + /** + * 已接收字节数 + */ + private AtomicLong receivedBytes; + + /** + * 已接收业务包 + */ + private AtomicLong receivedPackets; + + /** + * 已接收TCP包 + */ + private AtomicLong receivedTcps; + + /** + * 平均每个TCP包接收的字节数 + */ + private double bytesPerTcpReceive; + + /** + * 平均每个TCP包接收的业务包 + */ + private double packetsPerTcpReceive; + + /** + * 已处理的字节数 + */ + private AtomicLong handledBytes; + + /** + * 已处理的业务包 + */ + private AtomicLong handledPackets; + + /** + * 已发送的字节数 + */ + private AtomicLong sentBytes; + + /** + * 已发送的业务包 + */ + private AtomicLong sentPackets; + + /** + * 最近一次通信时间 + */ + private Date gmtLatestCommunicate; + + /** + * 注册时间 + */ + private Date regTime; + + /** + * 备注 + */ + private String remarks; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientData.java new file mode 100644 index 0000000..4fcf5e2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientData.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * ClientData + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月29日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @param + * @since 2019年9月29日 + */ +@Data +public class ClientData implements Serializable { + + private static final long serialVersionUID = 398895170386348237L; + + private String type; + + private String data; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientRegister.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientRegister.java new file mode 100644 index 0000000..c89cf61 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientRegister.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * ClientRegister + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月29日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月29日 + */ +@Data +public class ClientRegister implements Serializable { + + private static final long serialVersionUID = 7426700020435308050L; + + /** 客户端类型 **/ + private String clientType; + + /** 客户端编号 **/ + private String clientCode; + + /** 连接设备编号数组 **/ + private String[] connDeviceCode; + + /** 连接类型 **/ + private String connType; + + /** 是否随机 **/ + private Boolean random; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientType.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientType.java new file mode 100644 index 0000000..b9ef426 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ClientType.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * ClientType + * 客户端类型 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +public enum ClientType { + + MEASURE_POINT("measurePoint", "计量点"), + CONSOLE_CLIENT("consoleClient", "控制中心客户端"), + CAA_CLIENT("caaClient", "化学分析天平客户端"); + + + /** 名称 **/ + private String name; + + /** 描述 **/ + private String desc; + + private ClientType(String name, String desc) { + this.name = name; + this.desc = desc; + } + + public String getName() { + return name; + } + + public String getDesc() { + return desc; + } + + /** + * 根据名称获取类型枚举 + * @param name 名称 + * @return + */ + public static ClientType getByName(String name) { + ClientType[] values = ClientType.values(); + for (ClientType clientType : values) { + if (clientType.getName().equalsIgnoreCase(name)) { + return clientType; + } + } + return null; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Command.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Command.java new file mode 100644 index 0000000..eea09c9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Command.java @@ -0,0 +1,58 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * Command + * 命令 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +public enum Command { + + REGISTER("register", "注册"), + REPLY_REGISTER("replyRegister", "回复注册"), + DEVICE_STATUS("deviceStatus", "设备状态"), + DEVICE_DATA("deviceData", "设备数据"), + CONTROL_DEVICE("controlDevice", "控制设备"), + REPLY_CONTROL_DEVICE("replyControlDevice", "设备控制"), + LOG_DATA("logData", "日志数据"), + CHECK_CONTROL("checkControl", "检查计量点由谁控制"); + + /** 名称 **/ + private String name; + + /** 描述 **/ + private String desc; + + private Command(String name, String desc) { + this.name = name; + this.desc = desc; + } + + public String getName() { + return name; + } + + public String getDesc() { + return desc; + } + + /** + * 根据名称获取类型枚举 + * @param name 名称 + * @return + */ + public static Command getByName(String name) { + Command[] values = Command.values(); + for (Command command : values) { + if (command.getName().equalsIgnoreCase(name)) { + return command; + } + } + return null; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/EventConstant.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/EventConstant.java new file mode 100644 index 0000000..5460343 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/EventConstant.java @@ -0,0 +1,40 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * EventConstant + * 事件常量 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-25          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-25 + */ +public interface EventConstant { + + /** + * 计量点 + */ + String EVENT_MEASURE_POINT = "measure-point"; + + /** + * 计量点运行日志 + */ + String EVENT_MEASURE_POINT_RUN_LOGS = "measure-point-run-logs"; + + /** + * 设备注册 + */ + String EVENT_IOT_DEVICE_REGISTER = "iot-device-register"; + + /** + * 温湿计 + */ + String EVENT_HYGROTHERMOGRAPH = "hygrothermograph"; + + /** + * 天平 + */ + String EVENT_BALANCE = "balance"; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/GroupConstant.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/GroupConstant.java new file mode 100644 index 0000000..1bbaf3b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/GroupConstant.java @@ -0,0 +1,5 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +public class GroupConstant { + public static final String CAA_ALL_CLIENT = "CAA-ALL-CLIENT"; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Infrared.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Infrared.java new file mode 100644 index 0000000..c33bb8e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Infrared.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * Infrared + * 红外线 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月24日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月24日 + */ +@Data +public class Infrared implements Serializable { + + private static final long serialVersionUID = 2725294635998950778L; + + /** 设备编号 **/ + private String deviceId; + + /** 设备状态 0:断开,1:连接 **/ + private Integer status; + + /** 设备断开时间 **/ + private Date disconTime; + + /** 设备连接时间 **/ + private Date connectTime; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionContext.java new file mode 100644 index 0000000..dd5c833 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionContext.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; +import tech.zzjc.tio.core.ChannelContext; + +import java.io.Serializable; + +/** + * IotClientSessionContext + * 客户端SessionContext,用于保存连接的会话数据 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +@Data +public class IotClientSessionContext implements Serializable { + + private static final long serialVersionUID = 8738456547503650108L; + + /** 默认客户端sessioncontext键 **/ + public static final String DEFAULT_CLIENT_SESSION_CONTEXT_KEY = "iot-client-session-context"; + + /** 客户端类型 **/ + private String clientType; + + /** 计量点 **/ + private MeasurePoint measurePoint; + + /** 当前控制计量点的ChannelContext **/ + private ChannelContext controlConsoleClientChannelContext; + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionForRedisContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionForRedisContext.java new file mode 100644 index 0000000..6187bce --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotClientSessionForRedisContext.java @@ -0,0 +1,120 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.util.Date; +import java.util.concurrent.atomic.AtomicLong; + +@Data +public class IotClientSessionForRedisContext extends IotClientSessionContext{ + private static final long serialVersionUID = 1L; + + private String channelId; + + private Date regTime; //注册时间 + private Date expireTime; //过期时间 + private Date lastCommunicateTime; //最近一次通信时间 + private String tenantId; //租户ID + private String controlRealName; + + /** + * 客户端IP + */ + private String clientIp; + + /** + * 端口 + */ + private int clientPort; + + /** + * 协议 + */ + private String clientProtocol; + + /** + * 代理ip + */ + private String proxyIp; + + /** + * 代理端口 + */ + private int proxyPort; + + /** + * 代理协议 + */ + private String proxyProtocol; + + /** + * 连接类型 + */ + private String connectType; + + /** + * 解码失败数 + */ + private int decodeFailCount; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户token + */ + private String token; + + + /** + * 统计开始时间 + */ + private Date gmtCreate; + + /** + * 已接收字节数 + */ + private AtomicLong receivedBytes; + + /** + * 已接收业务包 + */ + private AtomicLong receivedPackets; + + /** + * 已接收TCP包 + */ + private AtomicLong receivedTcps; + + /** + * 平均每个TCP包接收的字节数 + */ + private double bytesPerTcpReceive; + + /** + * 平均每个TCP包接收的业务包 + */ + private double packetsPerTcpReceive; + + /** + * 已处理的字节数 + */ + private AtomicLong handledBytes; + + /** + * 已处理的业务包 + */ + private AtomicLong handledPackets; + + /** + * 已发送的字节数 + */ + private AtomicLong sentBytes; + + /** + * 已发送的业务包 + */ + private AtomicLong sentPackets; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionContext.java new file mode 100644 index 0000000..7b3676d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionContext.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; +import tech.zzjc.tio.core.ChannelContext; + +import java.io.Serializable; +import java.util.List; + +/** + * IotDeviceSessionContext + * 设备SessionContext,用于保存连接的会话数据 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +@Data +public class IotDeviceSessionContext implements Serializable { + + private static final long serialVersionUID = 9035659677475646771L; + + /** 默认设备sessioncontext键 **/ + public static final String DEFAULT_DEVICE_SESSION_CONTEXT_KEY = "iot-device-session-context"; + + /** 设备Id **/ + private String deviceId; + + /** 设备编码 **/ + private String deviceCode; + + /** 设备类型 **/ + private String deviceType; + + /** 设备名称 **/ + private String deviceName; + + /** 天平/地磅重量数据稳定计算列表 **/ + private List weightValueList; + + /** 设置控制人名称 **/ + private String controlRealName; + + /** 控制的ChannelContext **/ + private ChannelContext controlChannelContext; + + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionForRedisContext.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionForRedisContext.java new file mode 100644 index 0000000..62fd3c4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotDeviceSessionForRedisContext.java @@ -0,0 +1,123 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; +import tech.zzjc.tio.core.ChannelContext; + +import java.util.Date; +import java.util.concurrent.atomic.AtomicLong; + +@Data +public class IotDeviceSessionForRedisContext extends IotDeviceSessionContext{ + + private static final long serialVersionUID = 1L; + + private String channelId; + + private Date regTime; //注册时间 + private Date expireTime; //过期时间 + private String balanceWeightUnit; //天平重量单位 + private Long lastBalanceDataTime; //天平最后数据时间 + private String tenantId; //租户ID + + /** + * 客户端IP + */ + private String clientIp; + + /** + * 端口 + */ + private int clientPort; + + /** + * 协议 + */ + private String clientProtocol; + + /** + * 代理ip + */ + private String proxyIp; + + /** + * 代理端口 + */ + private int proxyPort; + + /** + * 代理协议 + */ + private String proxyProtocol; + + /** + * 连接类型 + */ + private String connectType; + + /** + * 解码失败数 + */ + private int decodeFailCount; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户token + */ + private String token; + + + /** + * 统计开始时间 + */ + private Date gmtCreate; + + /** + * 已接收字节数 + */ + private AtomicLong receivedBytes; + + /** + * 已接收业务包 + */ + private AtomicLong receivedPackets; + + /** + * 已接收TCP包 + */ + private AtomicLong receivedTcps; + + /** + * 平均每个TCP包接收的字节数 + */ + private double bytesPerTcpReceive; + + /** + * 平均每个TCP包接收的业务包 + */ + private double packetsPerTcpReceive; + + /** + * 已处理的字节数 + */ + private AtomicLong handledBytes; + + /** + * 已处理的业务包 + */ + private AtomicLong handledPackets; + + /** + * 已发送的字节数 + */ + private AtomicLong sentBytes; + + /** + * 已发送的业务包 + */ + private AtomicLong sentPackets; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotProtocol.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotProtocol.java new file mode 100644 index 0000000..c6a1974 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/IotProtocol.java @@ -0,0 +1,96 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import com.zt.plat.module.qms.iot.tcpserver.IotDataUtils; +import com.zt.plat.module.qms.iot.tcpserver.IotDeviceType; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.IotUtils; +import lombok.extern.slf4j.Slf4j; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.utils.json.Json; + + +/** + * IotProtocol + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月25日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月25日 + */ +@Slf4j +public class IotProtocol { + + public static void handle(String text, ChannelContext channelContext) throws Exception { + log.debug("服务端接收:" + text); + //心跳消息 + if (IotPacket.PING.equalsIgnoreCase(text)) { + IotUtils.replyHeartbeat(channelContext); + return; + } + //有人串口服务器,连接时发送数据 注册包格式为:reg-iot-设备名称-设备编号 选择hex发送并在末尾添加换行键0A + if (text.startsWith("reg-")) { + //reg-iot-Balance-001 + String[] regs = text.split("-"); + if ("iot".equalsIgnoreCase(regs[1])) { + channelContext.set("iotType", IotDeviceType.getByType(regs[2])); + Tio.bindBsId(channelContext, regs[2] + regs[3]); + } else { + //reg-user-userid + Tio.bindUser(channelContext, regs[2]); + } + channelContext.set("iotCode", regs[3]); + channelContext.set("bsFlat", regs[1]); + Tio.bindGroup(channelContext, regs[1]); + return; + } + // 串口数据 + String data = null; + // 有人串口服务器,注册包内容为数据携带 + if (text.startsWith("iot-")) { + String[] infos = text.split("\\$"); + String reg = infos[0]; + data = infos[infos.length - 1].trim(); + String[] regs = reg.split("-"); + channelContext.set("iotType", IotDeviceType.getByType(regs[1])); + Tio.bindBsId(channelContext, regs[1] + regs[2]); + channelContext.set("iotCode", regs[2]); + channelContext.set("bsFlat", regs[0]); + Tio.bindGroup(channelContext, regs[0]); + } else { + data = text; + } + if (text.startsWith("{") && text.endsWith("}")) { + ClientData clientData = Json.toBean(text, ClientData.class); + switch (clientData.getType()) { + case "register": + ClientRegister clientRegister = Json.toBean(clientData.getData(), ClientRegister.class); + channelContext.set("clientType", clientRegister.getClientType()); + channelContext.set("clientCode", clientRegister.getClientCode()); + channelContext.set("connDeviceCode", clientRegister.getConnDeviceCode()); + channelContext.set("connType", clientRegister.getConnType()); + channelContext.set("random", clientRegister.getRandom()); + String[] connDeviceCode = clientRegister.getConnDeviceCode(); + for (String connDevice : connDeviceCode) { + String connType = clientRegister.getConnType(); + if(connType.equals(IotDeviceType.BALANCE.getType())){ + IotDataUtils.addIot(clientRegister.getConnType() + connDevice, channelContext); + break; + } + } + break; + } + return; + } + String bsFlat = (String) channelContext.get("bsFlat"); + if ("iot".equals(bsFlat)) { + IotDataUtils.hander(channelContext, data); + return; + } + + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/MeasurePoint.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/MeasurePoint.java new file mode 100644 index 0000000..c715ee7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/MeasurePoint.java @@ -0,0 +1,29 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * MeasurePoint + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2023-4-17          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2023-4-17 + */ +@Data +public class MeasurePoint implements Serializable { + + private static final long serialVersionUID = 3809393624969295520L; + private String id; + private String tenantId; + private String code; + private String name; + private Date lastConnectTime; + private Date lastCloseTime; + private Integer isConnected; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ReplyResult.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ReplyResult.java new file mode 100644 index 0000000..db19029 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/ReplyResult.java @@ -0,0 +1,113 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import com.alibaba.fastjson.JSONObject; + +import java.io.Serializable; + +/** + * ReplyResult + * 回复结果 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-7-1          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-7-1 + */ +public class ReplyResult implements Serializable { + + private static final long serialVersionUID = 502081586271036395L; + + /** 计量点id **/ + private String measurePointId; + + /** 是否成功 **/ + private Boolean success; + + /** 消息 **/ + private String msg; + + private ReplyResult() { + } + + private ReplyResult(Boolean success, String msg) { + this.success = success; + this.msg = msg; + } + + /** + * 成功 + * @param msgId 消息id + * @param clientType 客户端类型 + * @param cmd 命令 + * @return + */ + public static String success(String msgId, String clientType, String cmd) { + JSONObject object = new JSONObject(); + object.put("msgId", msgId); + object.put("clientType", clientType); + object.put("cmd", cmd); + object.put("data", new ReplyResult(true, null)); + return object.toJSONString(); + } + + /** + * 成功 + * @param msgId 消息id + * @param clientType 客户端类型 + * @param cmd 命令 + * @param msg 消息 + * @return + */ + public static String success(String msgId, String clientType, String cmd, String msg) { + JSONObject object = new JSONObject(); + object.put("msgId", msgId); + object.put("clientType", clientType); + object.put("cmd", cmd); + object.put("data", new ReplyResult(true, msg)); + return object.toJSONString(); + } + + /** + * 失败 + * @param msgId 消息id + * @param clientType 客户端类型 + * @param cmd 命令 + * @param msg 消息 + */ + public static String fail(String msgId, String clientType, String cmd, String msg) { + JSONObject object = new JSONObject(); + object.put("msgId", msgId); + object.put("clientType", clientType); + object.put("cmd", cmd); + object.put("data", new ReplyResult(false, msg)); + return object.toJSONString(); + } + + public String getMeasurePointId() { + return measurePointId; + } + + public void setMeasurePointId(String measurePointId) { + this.measurePointId = measurePointId; + } + + public Boolean getSuccess() { + return success; + } + + public void setSuccess(Boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLight.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLight.java new file mode 100644 index 0000000..aa00a2b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLight.java @@ -0,0 +1,30 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * TrafficLight + * 交通灯 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月25日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月25日 + */ +@Data +public class TrafficLight implements Serializable { + + private static final long serialVersionUID = 6068609496777904364L; + + /** 设备编号 **/ + private String deviceId; + + /** 交通灯颜色 **/ + private TrafficLightColor trafficLightColor; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLightColor.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLightColor.java new file mode 100644 index 0000000..bcafa65 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/TrafficLightColor.java @@ -0,0 +1,18 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * TrafficLightColor + * 交通灯颜色 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月25日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月25日 + */ +public enum TrafficLightColor { + RED,GREEN,YELLOW,CLOSE +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleRecognitionCamera.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleRecognitionCamera.java new file mode 100644 index 0000000..eb5978e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleRecognitionCamera.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * VehicleRecognitionCamera + * 车辆识别摄像头 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月24日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月24日 + */ +@Data +public class VehicleRecognitionCamera implements Serializable { + + private static final long serialVersionUID = 220151039553720357L; + + /** 设备编号 **/ + private String deviceId; + + /** 车牌 **/ + private String vehiclePlate; + + /** 车辆图片路径 **/ + private String vehiclePicture; + + /** 车牌图片路径 **/ + private String vehiclePlatePicture; + + /** 车辆识别时间 **/ + private Date vehicleRecognitionTime; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleWeighing.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleWeighing.java new file mode 100644 index 0000000..a65f93d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/VehicleWeighing.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * VehicleWeighing + * 车辆称重 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月24日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月24日 + */ +@Data +public class VehicleWeighing implements Serializable { + + private static final long serialVersionUID = 8413535563770567348L; + + /** 设备编号 **/ + private String deviceId; + + /** 左边红外 **/ + private Infrared infraredLeft; + + /** 右边红外 **/ + private Infrared infraredRight; + + /** 左边抓拍摄像头 **/ + private VehicleRecognitionCamera cameraLeft; + + /** 右边抓拍摄像头 **/ + private VehicleRecognitionCamera cameraRight; + + /** 交通灯左边 **/ + private TrafficLight trafficLightLeft; + + /** 交通灯右边 **/ + private TrafficLight trafficLightRight; + + /** 磅秤 **/ + private Weighbridge weighbridge; + + /** 重量是否稳定后传输 **/ + private Boolean isStableTransfer; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Weighbridge.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Weighbridge.java new file mode 100644 index 0000000..ae7a80c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/Weighbridge.java @@ -0,0 +1,33 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +import lombok.Data; + +import java.io.Serializable; + +/** + * Weighbridge + * 磅秤设备 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月26日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月26日 + */ +@Data +public class Weighbridge implements Serializable { + + private static final long serialVersionUID = 884059728124432632L; + + /** 设备编号 **/ + private String deviceId; + + /** 地磅重量 **/ + private Double weighbridge; + + /** 重量单位 **/ + private WeightUnit weightUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/WeightUnit.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/WeightUnit.java new file mode 100644 index 0000000..757cf73 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/core/WeightUnit.java @@ -0,0 +1,57 @@ +package com.zt.plat.module.qms.iot.tcpserver.core; + +/** + * WeightUnit + * 重量单位 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月24日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月24日 + */ +public enum WeightUnit { + + T("t", "吨"), + KG("Kg", "千克"), + G("g", "克"), + MG("mg", "毫克"), + CT("ct", "克拉"); + + /** 单位名称 **/ + private String name; + + /** 描述 **/ + private String desc; + + private WeightUnit(String name, String desc) { + this.name = name; + this.desc = desc; + } + + public String getName() { + return name; + } + + public String getDesc() { + return desc; + } + + /** + * 根据单位名称获取枚举 + * @param name 单位名称:kg、g + * @return + */ + public static WeightUnit getByName(String name) { + WeightUnit[] values = WeightUnit.values(); + for (WeightUnit weightUnit : values) { + if (weightUnit.getName().equalsIgnoreCase(name)) { + return weightUnit; + } + } + return null; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/BalanceDataCommandLineRunner.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/BalanceDataCommandLineRunner.java new file mode 100644 index 0000000..b949e45 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/BalanceDataCommandLineRunner.java @@ -0,0 +1,127 @@ +package com.zt.plat.module.qms.iot.tcpserver.device; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.IotDeviceType; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.core.ClientType; +import com.zt.plat.module.qms.iot.tcpserver.core.Command; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.starter.TioServerBootstrap; +import tech.zzjc.tio.utils.SystemTimer; +import tech.zzjc.tio.utils.lock.SetWithLock; + +import java.nio.charset.Charset; +import java.util.Set; +import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; + +import static com.zt.plat.module.qms.iot.tcpserver.core.GroupConstant.CAA_ALL_CLIENT; + +/** + * BalanceDataCommandLineRunner + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-24          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-24 + */ +@Slf4j +@Component +@AllArgsConstructor +public class BalanceDataCommandLineRunner implements CommandLineRunner { + + private final TioServerBootstrap tioServerBootstrap; + + //正确天平数据超时时间6s + private final static long BALANCE_DATA_TIMEOUT = 6 * 1000L; + + @Override + public void run(String... args) throws Exception { +// System.out.println(args); +// System.out.println(tioServerBootstrap.getServerTioConfig().heartbeatTimeout); + Thread balanceDataCheckThread = new Thread(new Runnable() { + + @Override + public void run() { + //第一次先休息一下 + try { + Thread.sleep(BALANCE_DATA_TIMEOUT); + } catch (InterruptedException e1) { + log.error(e1.toString(), e1); + } + while (!tioServerBootstrap.getServerTioConfig().isStopped()) { + try { + Thread.sleep(BALANCE_DATA_TIMEOUT); + } catch (InterruptedException e1) { + log.error(e1.toString(), e1); + } + //long start = SystemTimer.currTime; + SetWithLock setWithLock = tioServerBootstrap.getServerTioConfig().connections; + Set set = null; + long start1 = 0; + int count = 0; + ReadLock readLock = setWithLock.readLock(); + readLock.lock(); + try { + start1 = SystemTimer.currTime; + set = setWithLock.getObj(); + + for (ChannelContext channelContext : set) { + count++; + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + if (sessionContext != null && IotDeviceType.BALANCE.getType().equals(sessionContext.getDeviceType())) { + //channelContext.get("lastBalanceDataTime") != null ? channelContext.get("lastBalanceDataTime").toString(); + Object lastBalanceDataTime = channelContext.get("lastBalanceDataTime"); + long compareTime = lastBalanceDataTime == null ? SystemTimer.currTime : Long.parseLong(lastBalanceDataTime.toString()) ; + long currtime = SystemTimer.currTime; + long interval = currtime - compareTime; + if (interval > BALANCE_DATA_TIMEOUT) { +// sessionContext.setControlRealName(""); +// sessionContext.setControlChannelContext(null); + sessionContext.setWeightValueList(null); + + //发送设备断开消息 + //System.out.println("发送设备断开。。。"); + JSONObject deviceStatusData = new JSONObject(); + deviceStatusData.put("deviceId", sessionContext.getDeviceId()); + deviceStatusData.put("deviceType", IotDeviceType.BALANCE.getType()); + deviceStatusData.put("connected", 0); + + JSONObject json = new JSONObject(); + json.put("cmd", Command.DEVICE_STATUS.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); + json.put("data", deviceStatusData); + IotPacket packet = new IotPacket(); + packet.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.sendToGroup(channelContext.getTioConfig(), CAA_ALL_CLIENT, packet); + } + + } + } + } catch (Throwable e) { + log.error("", e); + } finally { + try { + readLock.unlock(); + } catch (Throwable e) { + log.error("", e); + } + } + + } + + } + }); + balanceDataCheckThread.setDaemon(true); + balanceDataCheckThread.setPriority(Thread.MIN_PRIORITY); + balanceDataCheckThread.start(); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java new file mode 100644 index 0000000..89a0fc4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/RedisSessionComponent.java @@ -0,0 +1,237 @@ +package com.zt.plat.module.qms.iot.tcpserver.device; + +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; +import com.zt.plat.module.qms.iot.tcpserver.IotUtils; +import com.zt.plat.module.qms.iot.tcpserver.core.ChannelContextConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.IotClientSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.publisher.IotDeviceRegisterPublisher; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.Cursor; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ScanOptions; +import org.springframework.stereotype.Service; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.stat.ChannelStat; +import tech.zzjc.tio.utils.SystemTimer; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Service +@Slf4j +public class RedisSessionComponent { + + @Autowired private RedisTemplate redisTemplate; + @Autowired private DeviceInfomationService deviceInfomationService; + private final long timeoutSeconds = 60; + + public void update(IotDeviceSessionForRedisContext context){ + String deviceId = IotUtils.transDeviceCodeToId(context.getDeviceCode()); + context.setRegTime(new Date()); + String key = getRedisKeyByDeviceId(deviceId); +// log.info("key={}", key); + redisTemplate.opsForValue().set(key, context, timeoutSeconds, TimeUnit.SECONDS); + } + + public void clearControlByDeviceCode(String deviceCode, ChannelContext channelContext){ + IotDeviceSessionForRedisContext context = getByDeviceCode(deviceCode); + context.setControlRealName(""); + context.setControlChannelContext(null); + channelContext.set(ChannelContextConstant.CONTROL_DEVICE_ID, ""); + redisTemplate.opsForValue().set(getRedisKeyByDeviceCode(deviceCode), context, timeoutSeconds, TimeUnit.SECONDS); + } + + public void clearControlByDeviceId(String deviceId, ChannelContext channelContext){ + IotDeviceSessionForRedisContext context = getByDeviceId(deviceId); + context.setControlRealName(""); + context.setControlChannelContext(null); + channelContext.set(ChannelContextConstant.CONTROL_DEVICE_ID, ""); + redisTemplate.opsForValue().set(getRedisKeyByDeviceId(deviceId), context, timeoutSeconds, TimeUnit.SECONDS); + } + + public void deleteByDeviceId(String deviceId){ + redisTemplate.delete(getRedisKeyByDeviceId(deviceId)); + } + + public IotDeviceSessionForRedisContext getByDeviceCode(String deviceCode){ + String redisKey = getRedisKeyByDeviceCode(deviceCode); + return getByKey(redisKey); + } + + public IotDeviceSessionForRedisContext getByDeviceId(String deviceId){ + String redisKey = getRedisKeyByDeviceId(deviceId); + return getByKey(redisKey); +// return (IotDeviceSessionForRedisContext) redisTemplate.opsForValue().get(getRedisKeyByDeviceId(deviceId)); + } + public IotDeviceSessionForRedisContext getByKey(String key){ + return (IotDeviceSessionForRedisContext) redisTemplate.opsForValue().get(key); + } + + public IotClientSessionForRedisContext getClientByKey(String key){ + return (IotClientSessionForRedisContext) redisTemplate.opsForValue().get(key); + } + + public String getRedisKeyByDeviceCode(String deviceCode){ + String deviceId = IotUtils.transDeviceCodeToId(deviceCode); + return getRedisKeyByDeviceId(deviceId); + } + public String getRedisKeyByDeviceId(String deviceId){ + String redisKey = IotDeviceSessionForRedisContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY + "-" + deviceId; + return redisKey; + } + + public void regDevice(ChannelContext channelContext, String deviceCode, String deviceType){ + IotDeviceSessionForRedisContext clientContext = getByDeviceCode(deviceCode); + if(clientContext != null && Tio.getByBsId(channelContext.getTioConfig(), deviceCode) != null){ + return; + } + + TenantContextHolder.setIgnore(true); + try{ + String deviceId = IotUtils.transDeviceCodeToId(deviceCode); + DeviceInfomationDO deviceInfo = deviceInfomationService.getDeviceInfomation(Long.valueOf(deviceId)); + IotDeviceSessionForRedisContext context = new IotDeviceSessionForRedisContext(); + context.setChannelId(channelContext.getId()); + context.setDeviceId(deviceId); + context.setDeviceType(deviceType); + context.setDeviceCode(deviceCode); + if(deviceInfo != null){ + context.setDeviceName(deviceInfo.getProductName()); + context.setTenantId(deviceInfo.getTenantId().toString()); + deviceInfo.setIsConnect("1"); + deviceInfo.setLastConnectTime(LocalDateTime.now()); + deviceInfomationService.updateDeviceInfomation(deviceInfo); + } + context.setRegTime(new Date()); + context.setControlRealName( ""); + redisTemplate.opsForValue().set(getRedisKeyByDeviceId(deviceId), context, timeoutSeconds, TimeUnit.SECONDS); + + channelContext.set("regTime", new Date()); + //绑定业务id + Tio.bindBsId(channelContext, deviceCode); + //设备注册事件 + IotDeviceRegisterPublisher.publishEvent(deviceCode, deviceType); + }catch (Exception e){ + e.printStackTrace(); + log.error("设备注册异常:{}", e.getMessage()); + }finally { + TenantContextHolder.clear(); + } + + } + + public void regClient(ChannelContext channelContext){ + String channelId = channelContext.getId(); + IotClientSessionForRedisContext context = getByClientChannelId(channelId); + if(context != null){ + return; + } + + TenantContextHolder.setIgnore(true); + try{ + context = new IotClientSessionForRedisContext(); + + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String connectType = channelContext.get(ChannelContextConstant.CONNECT_TYPE) == null ? "" : channelContext.get(ChannelContextConstant.CONNECT_TYPE).toString(); + String userName = channelContext.get("user-real-name") == null ? "无" : channelContext.get("user-real-name").toString(); +// ChannelContext clientChanelContext = Tio.getByBsId(channelContext.getTioConfig(), deviceCode); +// if(clientChanelContext != null){ +// context.setClientProtocol(clientChanelContext.getClientNode().getProtocol()); +// context.setProxyIp(clientChanelContext.getClientNode().getIp()); +// context.setProxyPort(clientChanelContext.getClientNode().getPort()); +// context.setProxyProtocol(clientChanelContext.getClientNode().getProtocol()); +// } + context.setChannelId(channelId); + context.setControlRealName(userName); + context.setClientIp(realClientIp); + context.setClientPort(Integer.parseInt(realClientPort)); + context.setConnectType(connectType); + + updateClientCommonAttrs(context, channelContext); + + String redisKey = getClientRedisKeyByChannelId(channelId); + redisTemplate.opsForValue().set(redisKey, context, timeoutSeconds, TimeUnit.SECONDS); + //todo 客户端注册事件 +// IotDeviceRegisterPublisher.publishEvent(deviceCode, deviceType); + }catch (Exception e){ + e.printStackTrace(); + log.error("设备注册异常:{}", e.getMessage()); + }finally { + TenantContextHolder.clear(); + } + + } + + + public void updateClient(IotClientSessionForRedisContext context, ChannelContext channelContext){ + String channelId = channelContext.getId(); + updateClientCommonAttrs(context, channelContext); + String redisKey = getClientRedisKeyByChannelId(channelId); + redisTemplate.opsForValue().set(redisKey, context, timeoutSeconds, TimeUnit.SECONDS); + } + + private void updateClientCommonAttrs(IotClientSessionForRedisContext context, ChannelContext channelContext){ + ChannelStat stat = channelContext.stat; + context.setGmtCreate(new Date(stat.getTimeCreated())); + context.setDecodeFailCount(stat.getDecodeFailCount()); + context.setReceivedBytes(stat.getReceivedBytes()); + context.setReceivedPackets(stat.getReceivedPackets()); + context.setReceivedTcps(stat.getReceivedTcps()); + context.setBytesPerTcpReceive(stat.getBytesPerTcpReceive()); + context.setPacketsPerTcpReceive(stat.getPacketsPerTcpReceive()); + context.setHandledBytes(stat.getHandledBytes()); + context.setHandledPackets(stat.getHandledPackets()); + context.setSentBytes(stat.getSentBytes()); + context.setSentPackets(stat.getSentPackets()); + context.setLastCommunicateTime(new Date()); + } + + public String getClientRedisKeyByChannelId(String channelId){ + String redisKey = IotClientSessionForRedisContext.DEFAULT_CLIENT_SESSION_CONTEXT_KEY + "-" + channelId; + return redisKey; + } + + + public IotClientSessionForRedisContext getByClientChannelId(String channelId){ + String redisKey = getClientRedisKeyByChannelId(channelId); + return getClientByKey(redisKey); + } + + + /** + * 使用Scan方式查询key(推荐用于大数据量) + * 避免使用KEYS命令导致Redis阻塞 + */ + public Set scanKeys(String matchPattern) { + Set keys = new HashSet<>(); + try { + redisTemplate.execute((RedisCallback) connection -> { + try (Cursor cursor = connection.scan( + ScanOptions.scanOptions() + .match(matchPattern) + .count(1000) // 每次扫描的数量 + .build())) { + while (cursor.hasNext()) { + keys.add(new String(cursor.next())); + } + } + return null; + }); + } catch (Exception e) { + e.printStackTrace(); + } + return keys; + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java new file mode 100644 index 0000000..b4da687 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceBalanceHandler.java @@ -0,0 +1,254 @@ +package com.zt.plat.module.qms.iot.tcpserver.device.handler; + +import com.zt.plat.module.qms.iot.tcpserver.core.*; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.IotDeviceType; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.IotUtils; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import com.zt.plat.module.qms.iot.tcpserver.publisher.BalanceDataPublisher; +import com.fhs.common.spring.SpringContextUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.cluster.TioClusterConfig; +import tech.zzjc.tio.cluster.TioClusterVo; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.core.TioConfig; +import tech.zzjc.tio.core.stat.ChannelStat; +import tech.zzjc.tio.utils.SystemTimer; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import static com.zt.plat.module.qms.iot.tcpserver.core.GroupConstant.CAA_ALL_CLIENT; + +/** + * IotDeviceBalanceHandler + * 天平 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-14          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-14 + */ +@Slf4j +@Component +public class IotDeviceBalanceHandler implements IotDataHander { + + //重量稳定个数 + private int weightStableNum = 10; + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + //获取客户端连接信息 + ChannelStat stat = channelContext.stat; + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String connectType = channelContext.get(ChannelContextConstant.CONNECT_TYPE) == null ? "" : channelContext.get(ChannelContextConstant.CONNECT_TYPE).toString(); + String realClient = realClientIp + ":" + realClientPort; + //通过sessionContext传入设备ID + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + String deviceCode = sessionContext.getDeviceCode(); + String deviceId = IotUtils.transDeviceCodeToId(deviceCode); + RedisSessionComponent redisSessionComponent = (RedisSessionComponent) SpringContextUtil.getBean("redisSessionComponent"); + IotDeviceSessionForRedisContext deviceContext = redisSessionComponent.getByDeviceCode(deviceCode); + String weightData = "0.0"; + String weightUnit = null; + +// if (channelContext.get("TenantId") == null || StringUtils.isBlank(data)) { //设备未注册成功,暂不处理数据 + if (StringUtils.isBlank(data)) { //设备未注册成功,暂不处理数据 + return null; + } + + if ("---- METTLER TOLEDO ----".equals(data) || "METTLER TOLEDO".equals(data) + || "----.---".equals(data) || "---.---".equals(data) + || "S I".equals(data) || "SI".equals(data) || "SI+".equals(data) || "ES".equals(data) + || "EL".equals(data) || data.startsWith("EL") || data.startsWith("I4 A") + || data.startsWith("Stat")) {//天平发送的特殊字符 + return null; + } + + String[] dataArray = analysisData(data, weightUnit); + weightData = dataArray[0]; + weightUnit = dataArray[1]; + if (!NumberUtils.isNumber(weightData)) { + log.error("{},天平接收到的数据不正确!接收到的数据:{} 16进制:{}", realClient, data, IotUtils.bytesToHex(data.getBytes("UTF-8"))); + return null; + } + List weightValueList = deviceContext.getWeightValueList(); + if (weightValueList == null) { + weightValueList = new ArrayList<>(weightStableNum); + deviceContext.setWeightValueList(weightValueList); + + } + if (weightValueList.size() >= weightStableNum) { + weightValueList.remove(0); + } + weightValueList.add(Double.parseDouble(weightData)); + int weightStable = 0; + if (weightValueList.size() == weightStableNum) { + double max = Collections.max(weightValueList); + double min = Collections.min(weightValueList); + double diff = max - min; + //double average = weightValueList.stream().mapToDouble(a -> a.doubleValue()).average().getAsDouble(); + if (diff == 0 && max >= 0 && min >= 0) {//最大减去最小差值为0,并且值需要大于0 + weightStable = 1; + } + } + + if (weightUnit != null) { + deviceContext.setBalanceWeightUnit(weightUnit); + } else { + weightUnit = deviceContext.getBalanceWeightUnit() == null ? "" :deviceContext.getBalanceWeightUnit(); + } + + //更新deviceContext信息 + ChannelContext deviceChannelContext = Tio.getByBsId(channelContext.getTioConfig(), deviceCode); + if(deviceChannelContext != null){ + deviceContext.setClientProtocol(deviceChannelContext.getClientNode().getProtocol()); + deviceContext.setProxyIp(deviceChannelContext.getClientNode().getIp()); + deviceContext.setProxyPort(deviceChannelContext.getClientNode().getPort()); + deviceContext.setProxyProtocol(deviceChannelContext.getClientNode().getProtocol()); + } + deviceContext.setClientIp(realClientIp); + deviceContext.setClientPort(Integer.parseInt(realClientPort)); + deviceContext.setConnectType(connectType); + deviceContext.setDecodeFailCount(stat.getDecodeFailCount()); + deviceContext.setGmtCreate(new Date(stat.getTimeCreated())); + deviceContext.setReceivedBytes(stat.getReceivedBytes()); + deviceContext.setReceivedPackets(stat.getReceivedPackets()); + deviceContext.setReceivedTcps(stat.getReceivedTcps()); + deviceContext.setBytesPerTcpReceive(stat.getBytesPerTcpReceive()); + deviceContext.setPacketsPerTcpReceive(stat.getPacketsPerTcpReceive()); + deviceContext.setHandledBytes(stat.getHandledBytes()); + deviceContext.setHandledPackets(stat.getHandledPackets()); + deviceContext.setSentBytes(stat.getSentBytes()); + deviceContext.setSentPackets(stat.getSentPackets()); + + + deviceContext.setLastBalanceDataTime(SystemTimer.currTime); + redisSessionComponent.update(deviceContext); + //租户ID + String tenantId = deviceContext.getTenantId(); + BalanceDataPublisher.publishEvent(Long.parseLong(deviceId), tenantId, weightData, weightUnit); + JSONObject deviceData = new JSONObject(); + deviceData.put("deviceId", deviceId); + deviceData.put("deviceType", IotDeviceType.BALANCE.getType()); + deviceData.put("controlRealName", deviceContext.getControlRealName()); + deviceData.put("weightData", weightData); + deviceData.put("weightUnit", weightUnit); + deviceData.put("weightStable", weightStable); + + //发布数据到客户端 + TioConfig tioConfig = channelContext.getTioConfig(); + JSONObject json = new JSONObject(); + json.put("cmd", Command.DEVICE_DATA.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); + json.put("data", deviceData); + IotPacket packet = new IotPacket(); + packet.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.sendToGroup(tioConfig, CAA_ALL_CLIENT, packet); + + //通知天平数据到其他服务实例 +// log.info("天平数据:" + realClient + ":" + data); + TioClusterConfig tioClusterConfig = tioConfig.getTioClusterConfig(); + TioClusterVo iotClusterVo = new TioClusterVo(packet); + iotClusterVo.setGroup(CAA_ALL_CLIENT); +// if(!"0.00".equals(weightData)) + tioClusterConfig.publish(iotClusterVo); + + return null; + } + + private String[] analysisData(String data, String weightUnit){ + String weightData = "0.0"; + byte[] nul = {0x00}; + data = data.replace(new String(nul), ""); + data = data.replace(new String(IotUtils.hexToByte("efbfbd"), StandardCharsets.UTF_8), "");//乱码 + if (data.contains("VH")) {//中间特殊字母 + data = data.substring(data.lastIndexOf("VH") + 2); + } + if (data.startsWith("S") || data.startsWith("N") || data.startsWith("G")) { + String[] splits = data.split("\\s+");//按一个或多个空格拆分 + if (splits.length == 5) { + if ("-".equals(splits[2])) { + weightData = splits[2] + splits[3]; + } else { + weightData = splits[3]; + } + weightUnit = splits[4]; + } else if (splits.length == 4) { + if ("M".equals(splits[3])) { + weightData = splits[1]; + weightUnit = splits[2]; + } else { + weightData = splits[2]; + weightUnit = splits[3]; + } + } else if (splits.length == 3) { + if("+".equals(splits[1])) { + weightData = splits[2]; + } else if ("-".equals(splits[1])) { + weightData = splits[1] + splits[2]; + } else if (("S".equals(splits[1]) || "N".equals(splits[1])) && splits[2].length() > 2) { + if (splits[2].endsWith("mg")) { + weightData = splits[2].substring(0, splits[2].length() - 2); + weightUnit = "mg"; + } else if (splits[2].endsWith("g")) { + weightData = splits[2].substring(0, splits[2].length() - 1); + weightUnit = "g"; + } else { + weightData = splits[2]; + } + } else { + weightData = splits[1]; + weightUnit = splits[2]; + } + } else if (splits.length == 2) { + weightData = splits[1]; + } else { + weightData = data; + } + } + else { + data = data.replace("(", "").replace(")", ""); + String[] splits = data.split("\\s+"); + if (splits.length == 3) { + if("+".equals(splits[0])) { + weightData = splits[1]; + } else if ("-".equals(splits[0])) { + weightData = splits[0] + splits[1]; + } else { + weightData = splits[1]; + } + weightUnit = splits[2]; + } else if(splits.length == 2) { + if("+".equals(splits[0])) { + weightData = splits[1]; + } else if ("-".equals(splits[0])) { + weightData = splits[0] + splits[1]; + } else { + weightData = splits[0]; + weightUnit = splits[1]; + } + } else { + weightData = data; + } + } + if (weightData.startsWith("+")) { + weightData = weightData.substring(1); + } + return new String[]{weightData, weightUnit}; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceThermometerHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceThermometerHandler.java new file mode 100644 index 0000000..fc2536a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceThermometerHandler.java @@ -0,0 +1,71 @@ +package com.zt.plat.module.qms.iot.tcpserver.device.handler; + +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.IotDeviceType; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.core.ClientType; +import com.zt.plat.module.qms.iot.tcpserver.core.Command; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import com.zt.plat.module.qms.iot.tcpserver.publisher.HygrothermographPublisher; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; + +import java.nio.charset.Charset; + +import static com.zt.plat.module.qms.iot.tcpserver.core.GroupConstant.CAA_ALL_CLIENT; + +/** + * IotDeviceThermometerHandler + * 温湿度 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-14          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-14 + */ +public class IotDeviceThermometerHandler implements IotDataHander { + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + + if (channelContext.get("TenantId") == null) { //设备未注册成功,暂不处理数据 + return null; + } + + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + int temperature = Integer.parseInt(data.substring(6, 10), 16); + int humidity = Integer.parseInt(data.substring(10, 14), 16); + if (temperature > 32767) {//上传数据需除十,正数的范围为16进制0X0000-0X7FFF,负数采用正数的补码方式传输,其范围为16进制0X8000-0XFFFF + temperature = -(65535 - temperature); + } +// double temperature = 0.0d; +// if (0 < t && t <= 1000) { +// temperature = t * 0.1d; +// } else { +// temperature = -(65535 - t) * 0.1d; +// } +// double humidity = h * 0.1d; + String tenantId = channelContext.get("TenantId").toString(); + HygrothermographPublisher.publishEvent(Long.parseLong(sessionContext.getDeviceId()), tenantId, temperature, humidity); +// System.out.println("温度:" + temperature * 0.1 + "°C,湿度:" + humidity * 0.1 + "%"); + JSONObject deviceData = new JSONObject(); + deviceData.put("deviceId", sessionContext.getDeviceId()); + deviceData.put("deviceType", IotDeviceType.THERMOMETER.getType()); + deviceData.put("temperature", temperature); + deviceData.put("humidity", humidity); + + JSONObject json = new JSONObject(); + json.put("cmd", Command.DEVICE_DATA.getName()); + json.put("clientType", ClientType.CAA_CLIENT.getName()); + json.put("data", deviceData); + IotPacket packet = new IotPacket(); + packet.setBody((json.toJSONString() + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.sendToGroup(channelContext.getTioConfig(), CAA_ALL_CLIENT, packet); + + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceWeighbridgeHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceWeighbridgeHandler.java new file mode 100644 index 0000000..72033b1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/device/handler/IotDeviceWeighbridgeHandler.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.iot.tcpserver.device.handler; + +import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander; +import tech.zzjc.tio.core.ChannelContext; + +/** + * IotDeviceWeighbridgeHandler + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-29          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-29 + */ +public class IotDeviceWeighbridgeHandler implements IotDataHander { + + @Override + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception { + + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/BalanceDataEvent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/BalanceDataEvent.java new file mode 100644 index 0000000..c03c2b3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/BalanceDataEvent.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.iot.tcpserver.event; + +import org.springframework.context.ApplicationEvent; + +/** + * BalanceDataEvent + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +public class BalanceDataEvent extends ApplicationEvent { + + private static final long serialVersionUID = -1762952341801790338L; + + public BalanceDataEvent(Object source) { + super(source); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/HygrothermographEvent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/HygrothermographEvent.java new file mode 100644 index 0000000..24a3bf3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/HygrothermographEvent.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.iot.tcpserver.event; + +import org.springframework.context.ApplicationEvent; + +/** + * HygrothermographEvent + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +public class HygrothermographEvent extends ApplicationEvent { + + private static final long serialVersionUID = -1762952341801790338L; + + public HygrothermographEvent(Object source) { + super(source); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/IotDeviceRegisterEvent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/IotDeviceRegisterEvent.java new file mode 100644 index 0000000..0dc3592 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/IotDeviceRegisterEvent.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.iot.tcpserver.event; + +import org.springframework.context.ApplicationEvent; + +/** + * IotDeviceRegisterEvent + * 设备注册事件 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-17          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-17 + */ +public class IotDeviceRegisterEvent extends ApplicationEvent { + + private static final long serialVersionUID = -1762952341801790338L; + + public IotDeviceRegisterEvent(Object source) { + super(source); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointEvent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointEvent.java new file mode 100644 index 0000000..85224e9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointEvent.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.iot.tcpserver.event; + +import org.springframework.context.ApplicationEvent; + +/** + * MeasurePointEvent + * 计量点事件 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-25          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-25 + */ +public class MeasurePointEvent extends ApplicationEvent { + + private static final long serialVersionUID = 7441527691946951411L; + + public MeasurePointEvent(Object source) { + super(source); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointRunLogsEvent.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointRunLogsEvent.java new file mode 100644 index 0000000..0b7435e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/event/MeasurePointRunLogsEvent.java @@ -0,0 +1,24 @@ +package com.zt.plat.module.qms.iot.tcpserver.event; + +import org.springframework.context.ApplicationEvent; + +/** + * MeasurePointRunLogsEvent + * 计量点运行日志事件 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-8-4          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-8-4 + */ +public class MeasurePointRunLogsEvent extends ApplicationEvent { + + private static final long serialVersionUID = 4480335483883616240L; + + public MeasurePointRunLogsEvent(Object source) { + super(source); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotClientHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotClientHandler.java new file mode 100644 index 0000000..dbbf0d4 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotClientHandler.java @@ -0,0 +1,108 @@ +package com.zt.plat.module.qms.iot.tcpserver.handler; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.caaclient.IotCaaClientControlDeviceHander; +import com.zt.plat.module.qms.iot.tcpserver.caaclient.IotCaaClientRegisterHander; +import com.zt.plat.module.qms.iot.tcpserver.consoleclient.*; +import com.zt.plat.module.qms.iot.tcpserver.consoleclient.IotConsoleClientCheckControlHander; +import com.zt.plat.module.qms.iot.tcpserver.consoleclient.IotConsoleClientRegisterHander; +import com.zt.plat.module.qms.iot.tcpserver.core.ChannelContextConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.Command; +import com.zt.plat.module.qms.iot.tcpserver.core.IotClientSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; + +/** + * IotClientHandler + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +@Slf4j +@Component +public class IotClientHandler implements IotHander { + + + + @Autowired + private IotConsoleClientRegisterHander iotConsoleClientRegisterHander; + + @Autowired + private IotConsoleClientCheckControlHander iotConsoleClientCheckControlHander; + + @Autowired + private IotCaaClientRegisterHander iotCaaClientRegisterHander; + + @Autowired + private IotCaaClientControlDeviceHander iotCaaClientControlDeviceHander; + @Autowired public RedisSessionComponent redisSessionComponent; + + public IotClientHandler() { + } + + @Override + public Object hander(IotPacket iotPacket, ChannelContext channelContext) throws Exception { + //获取客户端连接信息 + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String realClient = realClientIp + ":" + realClientPort; + String text = new String(iotPacket.getBody(), IotPacket.CHARSET); + JSONObject jsonObject = JSON.parseObject(text); + String msgId = jsonObject.getString("msgId"); + String clientType = jsonObject.getString("clientType"); + String cmd = jsonObject.getString("cmd"); + Command command = Command.getByName(cmd); + IotDataHander iotDataHander = null; + String channelId = channelContext.getId(); + IotClientSessionForRedisContext iotClientSessionForRedisContext = redisSessionComponent.getByClientChannelId(channelId); + if ("consoleClient".equals(clientType)) { + channelContext.set(ChannelContextConstant.CONNECT_TYPE, ChannelContextConstant.CONNECT_CONSOLE_CLIENT); + switch (command) { + case REGISTER: + iotDataHander = iotConsoleClientRegisterHander; + break; + + case CHECK_CONTROL: + iotDataHander = iotConsoleClientCheckControlHander; + break; + default: + break; + } + } else if ("caaClient".equals(clientType)) { + channelContext.set(ChannelContextConstant.CONNECT_TYPE, ChannelContextConstant.CONNECT_CAA_CLIENT); + switch (command) { + case REGISTER: + iotDataHander = iotCaaClientRegisterHander; + break; + case CONTROL_DEVICE: + iotDataHander = iotCaaClientControlDeviceHander; + break; + default: + break; + } + } + if (iotDataHander == null) { + log.error("{}, 找不到处理类, 客户端消息ID:{},客户端类型:{},命令:{}", realClient, msgId, clientType, cmd); + return null; + } + + if(iotClientSessionForRedisContext == null){ + redisSessionComponent.regClient(channelContext); + }else{ + redisSessionComponent.updateClient(iotClientSessionForRedisContext, channelContext); + } + + iotDataHander.hander(msgId, jsonObject.getString("data"), channelContext); + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDataHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDataHander.java new file mode 100644 index 0000000..9085196 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDataHander.java @@ -0,0 +1,19 @@ +package com.zt.plat.module.qms.iot.tcpserver.handler; + +import tech.zzjc.tio.core.ChannelContext; + +/** + * IotDataHander + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +public interface IotDataHander { + + public Object hander(String msgId, String data, ChannelContext channelContext) throws Exception; +} + diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDeviceHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDeviceHandler.java new file mode 100644 index 0000000..fae14e1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotDeviceHandler.java @@ -0,0 +1,120 @@ +package com.zt.plat.module.qms.iot.tcpserver.handler; + +import com.zt.plat.module.qms.iot.tcpserver.IotDeviceType; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.IotUtils; +import com.zt.plat.module.qms.iot.tcpserver.core.ChannelContextConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionContext; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.zt.plat.module.qms.iot.tcpserver.device.handler.IotDeviceBalanceHandler; +import com.zt.plat.module.qms.iot.tcpserver.device.handler.IotDeviceThermometerHandler; +import com.zt.plat.module.qms.iot.tcpserver.device.handler.IotDeviceWeighbridgeHandler; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; + +import java.util.HashMap; +import java.util.Map; + +/** + * IotDeviceHandler + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-28          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-28 + */ +@Slf4j +@Component +public class IotDeviceHandler implements IotHander { + + private static Map handlerMap = new HashMap<>(); + + @Autowired public RedisSessionComponent redisSessionComponent; + + + static { + handlerMap.put(IotDeviceType.WEIGHBRIDGE.getType(), new IotDeviceWeighbridgeHandler()); + handlerMap.put(IotDeviceType.BALANCE.getType(), new IotDeviceBalanceHandler()); + handlerMap.put(IotDeviceType.THERMOMETER.getType(), new IotDeviceThermometerHandler()); + } + + @Override + public Object hander(IotPacket iotPacket, ChannelContext channelContext) throws Exception { + channelContext.set(ChannelContextConstant.CONNECT_TYPE, ChannelContextConstant.CONNECT_DEVICE); + //获取客户端连接信息 + String realClientIp = channelContext.get("realClientIp") == null ? channelContext.getClientNode().getIp() : channelContext.get("realClientIp").toString(); + String realClientPort = channelContext.get("realClientPort") == null ? channelContext.getClientNode().getPort() + "" : channelContext.get("realClientPort").toString(); + String realClient = realClientIp + ":" + realClientPort + ", bsId=" + channelContext.getBsId(); + String text = new String(iotPacket.getBody(), IotPacket.CHARSET); +// if(!text.contains("0.00")) +// log.info("{}, 接收到数据:{}", realClient, text); + String[] infos = text.split("\\$"); + String reginfo = infos[0]; + String[] regs = reginfo.split("-"); + String deviceType = null; //设备类型 + String deviceCode = null; //设备编码 + String deviceData = null; //设备数据 + boolean regFlag = false; + String errMsg = "{}, 传入参数错误,无注册信息,断开连接!传入参数:{}"; + IotDeviceSessionContext sessionContext = (IotDeviceSessionContext) channelContext.get(IotDeviceSessionContext.DEFAULT_DEVICE_SESSION_CONTEXT_KEY); + deviceCode = sessionContext.getDeviceCode(); + IotDeviceSessionForRedisContext deviceContext = null; + if(!ObjectUtils.isEmpty(deviceCode)){ + deviceContext = redisSessionComponent.getByDeviceCode(deviceCode); + } + if(deviceContext == null + && !reginfo.startsWith("reg-iot-") + && !reginfo.startsWith("r-i-") + && !reginfo.startsWith("iot-")){ + //无注册信息,断开连接 + log.error(errMsg, realClient, text); + Tio.close(channelContext, "无注册信息,断开连接!"); + return null; + } + //设备注册信息 + if ((reginfo.startsWith("reg-iot-") || reginfo.startsWith("r-i-") ) && regs.length == 4) { + deviceType = regs[2]; + deviceCode = regs[3]; + regFlag = true; + }else if(reginfo.startsWith("iot-") && regs.length == 3){ + deviceType = regs[1]; + deviceCode = regs[2]; + deviceData = infos[1]; + }else{ + deviceData = text; + deviceType = deviceContext.getDeviceType(); + } + if(ObjectUtils.isEmpty(deviceCode)){ + log.error(errMsg, realClient, text); + Tio.close(channelContext, "无注册信息,断开连接!"); + return null; + } + if(regFlag){ + redisSessionComponent.regDevice(channelContext, deviceCode, deviceType); + //在sessionContext记录设备id + sessionContext.setDeviceCode(deviceCode); + sessionContext.setDeviceId(IotUtils.transDeviceCodeToId(deviceCode)); + return null; + } + if(deviceContext == null || Tio.getByBsId(channelContext.getTioConfig(), deviceCode) == null){ + redisSessionComponent.regDevice(channelContext, deviceCode, deviceType); + }else{ + //更新过期时间 + redisSessionComponent.update(deviceContext); + } + IotDataHander iotDataHander = handlerMap.get(deviceType); + if (iotDataHander == null) { + log.error("{}, 找不到处理类,设备类型:{}", realClient, deviceType); + return null; + } + iotDataHander.hander(null, deviceData.trim(), channelContext); + return null; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHander.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHander.java new file mode 100644 index 0000000..2476e84 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHander.java @@ -0,0 +1,27 @@ +package com.zt.plat.module.qms.iot.tcpserver.handler; + +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import tech.zzjc.tio.core.ChannelContext; + +/** + * IotHander + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月16日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月16日 + */ +public interface IotHander { + + /** + * 处理 + * @param iotPacket + * @param channelContext + * @return + */ + public Object hander(IotPacket iotPacket, ChannelContext channelContext) throws Exception; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHeartbeatHandler.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHeartbeatHandler.java new file mode 100644 index 0000000..bae6a2c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/handler/IotHeartbeatHandler.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.iot.tcpserver.handler; + +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; + +import java.nio.charset.Charset; + +/** + * IotHeartbeatHandler + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2019年9月27日 王兴荣 Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2019年9月27日 + */ +@Slf4j +@Component +public class IotHeartbeatHandler implements IotHander { + + @Override + public Object hander(IotPacket iotPacket, ChannelContext channelContext) throws Exception { + IotPacket resppacket = new IotPacket(); + resppacket.setBody((IotPacket.PONG + "\r\n").getBytes(Charset.forName(IotPacket.CHARSET))); + Tio.send(channelContext, resppacket); + log.debug(channelContext.getClientNode().getIp() + ":" + channelContext.getClientNode().getPort() +": 心跳消息。。。。"); + return null; + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/inf/DecoderFunction.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/inf/DecoderFunction.java new file mode 100644 index 0000000..4a1c10f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/inf/DecoderFunction.java @@ -0,0 +1,34 @@ +package com.zt.plat.module.qms.iot.tcpserver.inf; + +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.exception.TioDecodeException; +import tech.zzjc.tio.core.intf.Packet; + +import java.nio.ByteBuffer; + +/** + * DecoderFunction + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +@FunctionalInterface +public interface DecoderFunction { + + /** + * 解码函数 + * + * @param buffer ByteBuffer + * @param readableLength readableLength + * @param context ChannelContext + * @return ProxyProtocolMessage + * @throws TioDecodeException TioDecodeException + */ + Packet apply(ChannelContext context, ByteBuffer buffer, int readableLength) throws TioDecodeException; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/BalanceDataListener.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/BalanceDataListener.java new file mode 100644 index 0000000..dbb57e3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/BalanceDataListener.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.iot.tcpserver.listener; + +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.BalanceDataEvent; +import com.zt.plat.module.qms.iot.tcpserver.pojo.BalanceData; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.core.annotation.Order; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * BalanceDataListener + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +@Slf4j +@Component +@AllArgsConstructor +public class BalanceDataListener { + +// private final ITimeSeriesDataService timeSeriesDataService; + + @Async + @Order + @EventListener(BalanceDataEvent.class) + @SuppressWarnings("unchecked") + public void saveHygrothermograph(BalanceDataEvent event) { + try { + Map source = (Map) event.getSource(); + BalanceData balanceData = (BalanceData) source.get(EventConstant.EVENT_BALANCE); +// timeSeriesDataService.saveBalanceData(balanceData); + } catch (Exception e) { + log.error("保存天平数据出错!", e); + } + + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/HygrothermographListener.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/HygrothermographListener.java new file mode 100644 index 0000000..6a882ee --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/HygrothermographListener.java @@ -0,0 +1,46 @@ +package com.zt.plat.module.qms.iot.tcpserver.listener; + +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.HygrothermographEvent; +import com.zt.plat.module.qms.iot.tcpserver.pojo.Hygrothermograph; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.core.annotation.Order; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * HygrothermographListener + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +@Slf4j +@Component +@AllArgsConstructor +public class HygrothermographListener { + +// private final ITimeSeriesDataService timeSeriesDataService; + + @Async + @Order + @EventListener(HygrothermographEvent.class) + @SuppressWarnings("unchecked") + public void saveHygrothermograph(HygrothermographEvent event) { + try { + Map source = (Map) event.getSource(); + Hygrothermograph hygrothermograph = (Hygrothermograph) source.get(EventConstant.EVENT_HYGROTHERMOGRAPH); +// timeSeriesDataService.saveHygrothermograph(hygrothermograph); + } catch (Exception e) { + log.error("保存温湿度数据出错!", e); + } + + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/IotDeviceRegisterListener.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/IotDeviceRegisterListener.java new file mode 100644 index 0000000..0942cf7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/listener/IotDeviceRegisterListener.java @@ -0,0 +1,76 @@ +package com.zt.plat.module.qms.iot.tcpserver.listener; + +import com.zt.plat.framework.tenant.core.context.TenantContextHolder; +import com.zt.plat.module.qms.iot.tcpserver.IotPacket; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.IotDeviceSessionForRedisContext; +import com.zt.plat.module.qms.iot.tcpserver.device.RedisSessionComponent; +import com.zt.plat.module.qms.iot.tcpserver.event.IotDeviceRegisterEvent; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.event.EventListener; +import org.springframework.core.annotation.Order; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Tio; +import tech.zzjc.tio.starter.TioServerBootstrap; + +import java.time.LocalDateTime; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * IotDeviceRegisterListener + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-17          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-17 + */ +@Component +@AllArgsConstructor +@Slf4j +public class IotDeviceRegisterListener { + +// private final IDeviceLaboratoryService deviceLaboratoryService; + private final DeviceInfomationService deviceInfomationService; + private final RedisSessionComponent redisSessionComponent; + + private final TioServerBootstrap tioServerBootstrap; + + /** TH11S-B 温湿度查询 **/ + private static final byte[] TEMP_QUERY_TH11S_B = {(byte)0x01, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0xC4, (byte)0x0B}; + + @Async + @Order + @EventListener(IotDeviceRegisterEvent.class) + @SuppressWarnings("unchecked") + public void iotDeviceRegister(IotDeviceRegisterEvent event) { + Map source = (Map) event.getSource(); + DeviceInfomationDO deviceInfo = (DeviceInfomationDO) source.get(EventConstant.EVENT_IOT_DEVICE_REGISTER); + Long deviceId = deviceInfo.getId(); + String deviceType = deviceInfo.getCollectDeviceType(); + final String bsId = Long.toString(deviceId, Character.MAX_RADIX); + if("temp".equals(deviceInfo.getCollectDeviceType())) { + ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5); + scheduledExecutorService.scheduleAtFixedRate(new Runnable() { + + @Override + public void run() { + IotPacket iotPacket = new IotPacket(); + iotPacket.setBody(TEMP_QUERY_TH11S_B); + Tio.sendToBsId(tioServerBootstrap.getServerTioConfig(), bsId, iotPacket); + } + }, 1, 1, TimeUnit.SECONDS); + } + ChannelContext channelContext = Tio.getByBsId(tioServerBootstrap.getServerTioConfig(), bsId); + redisSessionComponent.regDevice(channelContext, bsId, deviceType); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/BalanceData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/BalanceData.java new file mode 100644 index 0000000..5c7e69a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/BalanceData.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.iot.tcpserver.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * BalanceData + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +@Data +public class BalanceData implements Serializable { + + private static final long serialVersionUID = 8957095553623616896L; + + /** 设备id **/ + private Long devid; + + /** 租户id **/ + private String tenantId; + + /** 时间戳 **/ + private Date tstamp; + + /** 重量数据 **/ + private String weight; + + /** 重量单位 **/ + private String weightUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/Hygrothermograph.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/Hygrothermograph.java new file mode 100644 index 0000000..f3a7554 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/Hygrothermograph.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.qms.iot.tcpserver.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * Hygrothermograph + * 温湿计 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +@Data +public class Hygrothermograph implements Serializable { + + private static final long serialVersionUID = -4745301459981384644L; + + /** 设备id **/ + private Long devid; + + /** 租户id **/ + private String tenantId; + + /** 时间戳 **/ + private Date tstamp; + + /** 温度,需要乘0.1 **/ + private Integer temperature; + + /** 湿度,需要乘0.1 **/ + private Integer humidity; + + /** + * 获取温度 + * @return + */ + public Double getDoubleTemperature() { + return this.temperature * 0.1d; + } + + /** + * 获取湿度 + * @return + */ + public Double getDoubleHumidity() { + return this.humidity * 0.1d; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointDeviceData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointDeviceData.java new file mode 100644 index 0000000..ecae638 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointDeviceData.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.iot.tcpserver.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * MeasurePointDeviceData + * 计量点设备数据 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +@Data +public class MeasurePointDeviceData implements Serializable { + + private static final long serialVersionUID = 6960810616021935707L; + + /** 计量点Id **/ + private String measurePointId; + + /** 计量点编号 **/ + private String measurePointCode; + + /** 租户id **/ + private String tenantId; + + /** 时间戳 **/ + private Date tstamp; + + /** 磅秤重量 **/ + private Integer weight; + + /** 左红外 **/ + private Integer infraredLeft; + + /** 右红外 **/ + private Integer infraredRight; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointRunLogs.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointRunLogs.java new file mode 100644 index 0000000..5ac7dfa --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/MeasurePointRunLogs.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.iot.tcpserver.pojo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * MeasurePointRunLogs + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-8-4          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-8-4 + */ +@Data +public class MeasurePointRunLogs implements Serializable { + + private static final long serialVersionUID = 6510122594323162290L; + + /** 计量点Id **/ + private String measurePointId; + + /** 计量点编号 **/ + private String measurePointCode; + + /** 租户id **/ + private String tenantId; + + /** 时间 **/ + private String time; + + /** 内容 **/ + private String content; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/PinusDbMeasurePointRunLogs.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/PinusDbMeasurePointRunLogs.java new file mode 100644 index 0000000..7ddde79 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/pojo/PinusDbMeasurePointRunLogs.java @@ -0,0 +1,28 @@ +package com.zt.plat.module.qms.iot.tcpserver.pojo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * PinusDbMeasurePointRunLogs + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-8-10          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-8-10 + */ +@Data +public class PinusDbMeasurePointRunLogs implements Serializable { + + private static final long serialVersionUID = 3004507731172306335L; + + private Long devid; + + private Date tstamp; + + private String log; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolDecoder.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolDecoder.java new file mode 100644 index 0000000..3891820 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolDecoder.java @@ -0,0 +1,233 @@ +package com.zt.plat.module.qms.iot.tcpserver.proxy; + +import com.zt.plat.module.qms.iot.tcpserver.IgnorePacket; +import com.zt.plat.module.qms.iot.tcpserver.inf.DecoderFunction; +import com.zt.plat.module.qms.iot.tcpserver.utils.ByteBufferUtil; +import tech.zzjc.tio.core.ChannelContext; +import tech.zzjc.tio.core.Node; +import tech.zzjc.tio.core.exception.TioDecodeException; +import tech.zzjc.tio.core.intf.Packet; + +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; + +/** + * ProxyProtocolDecoder + * 开启 nginx 代理协议时需要开启,转发代理 ip 信息 + * + *

+ * proxy_protocol on; + *

+ *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +public class ProxyProtocolDecoder { + /** + * 最小头 “PROXY ” 用来判定是否 v1 的协议 + */ + private static final int V1_MIN_HEAD_LENGTH = 6; + /** + * Maximum possible length of a v1 proxy message header per spec + */ + private static final int V1_MAX_LENGTH = 108; + /** + * 开启 proxy_protocol 的 key + */ + private static final String PROXY_PROTOCOL_KEY = "proxy_protocol_key"; + /** + * PROXY UNKNOWN\r\n + */ + private static final String UNKNOWN = "UNKNOWN"; + + private ProxyProtocolDecoder() { + } + + /** + * 开始 proxy message + * + * @param context ChannelContext + */ + public static void enableProxyProtocol(ChannelContext context) { + context.set(PROXY_PROTOCOL_KEY, (byte) 1); + } + + /** + * 去掉 proxy message + * + * @param context ChannelContext + */ + public static void removeProxyProtocol(ChannelContext context) { + context.remove(PROXY_PROTOCOL_KEY); + } + + /** + * 判断是否开启 proxy message + * + * @param context ChannelContext + * @return 是否开启 + */ + public static boolean isProxyProtocolEnabled(ChannelContext context) { + Object obj = context.get(PROXY_PROTOCOL_KEY); + if (obj == null) { + return false; + } + return true; + } + + /** + * 解码,如果开启了 proxy message + * + * @param context ChannelContext + * @param buffer ByteBuffer + * @param readableLength readableLength + * @param next 下一个解码器 + * @return ProxyProtocolMessage + * @throws TioDecodeException TioDecodeException + */ + public static Packet decodeIfEnable(ChannelContext context, ByteBuffer buffer, int readableLength, + DecoderFunction next) throws TioDecodeException { + if (isProxyProtocolEnabled(context)) { + return decode(context, buffer, readableLength, next); + } else { + return next.apply(context, buffer, readableLength); + } + } + + /** + * 解码 proxy message + * + * @param context ChannelContext + * @param buffer ByteBuffer + * @param readableLength readableLength + * @param next 下一个解码器 + * @return ProxyProtocolMessage + * @throws TioDecodeException TioDecodeException + */ + public static Packet decode(ChannelContext context, ByteBuffer buffer, int readableLength, DecoderFunction next) throws TioDecodeException { + // 如果小于最小长度,尝试解析下一个 + if (readableLength < V1_MIN_HEAD_LENGTH) { + return next.apply(context, buffer, readableLength); + } + // 标记 + buffer.mark(); + // PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n + String proxyPrefix = ByteBufferUtil.readString(buffer, V1_MIN_HEAD_LENGTH, StandardCharsets.US_ASCII); + // 非 PROXY 协议,直接返回 + if (!"PROXY ".equals(proxyPrefix)) { + // 清除协议 key,重置 buffer + context.remove(PROXY_PROTOCOL_KEY); + buffer.reset(); + return next.apply(context, buffer, readableLength); + } + // 解析 proxy 协议 + ProxyProtocolMessage message = decodeMessage(buffer, readableLength); + // 半包的情况 + if (message == null) { + return null; + } + // 清除协议 key + context.remove(PROXY_PROTOCOL_KEY); + // 设置客户端代理节点 + String protocol = message.getProtocol(); + if (UNKNOWN.equals(protocol)) { + context.setProxyClientNode(new Node(UNKNOWN, message.getDestinationPort())); + } else { + context.setClientNode(new Node(message.getSourceAddress(), message.getSourcePort())); + context.setProxyClientNode(new Node(message.getDestinationAddress(), message.getDestinationPort())); + } + if (buffer.hasRemaining()) { + return next.apply(context, buffer, readableLength); + } else { + return IgnorePacket.INSTANCE; + } + } + + /** + * 解码 proxy message + * + * @param buffer ByteBuffer + * @param readableLength readableLength + * @return ProxyProtocolMessage + * @throws TioDecodeException TioDecodeException + */ + public static ProxyProtocolMessage decodeForTest(ByteBuffer buffer, int readableLength) throws TioDecodeException { + // PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n + String proxyPrefix = ByteBufferUtil.readString(buffer, V1_MIN_HEAD_LENGTH, StandardCharsets.US_ASCII); + // 非 PROXY 协议,直接返回 + if (!"PROXY ".equals(proxyPrefix)) { + throw new TioDecodeException("unknown identifier: " + proxyPrefix); + } + return decodeMessage(buffer, readableLength); + } + + /** + * 解码 proxy message + * + * @param buffer ByteBuffer + * @param readableLength readableLength + * @return ProxyProtocolMessage + * @throws TioDecodeException TioDecodeException + */ + public static ProxyProtocolMessage decodeMessage(ByteBuffer buffer, int readableLength) throws TioDecodeException { + int endOfLine = findEndOfLine(buffer); + // 判断超长的情况,有可能是半包,多次进入 + if (endOfLine > V1_MAX_LENGTH || (readableLength > V1_MAX_LENGTH && endOfLine == -1)) { + throw new TioDecodeException("Error v1 proxy message, readableLength: " + readableLength); + } + // 有可能半包,所以返回 null + if (endOfLine == -1) { + return null; + } + // PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n 去除前缀 PROXY + // TCP4 192.168.0.1 192.168.0.11 56324 443\r\n + String header = ByteBufferUtil.readString(buffer, endOfLine - V1_MIN_HEAD_LENGTH, StandardCharsets.US_ASCII); + // 跳过 \r\n + ByteBufferUtil.skipBytes(buffer, 2); + String[] parts = header.split(" "); + int numParts = parts.length; + if (numParts < 1) { + throw new TioDecodeException("invalid header: PROXY " + header + " (expected: 'PROXY' and proxied message values)"); + } + String proxyProtocol = parts[0]; + if (!"TCP4".equals(proxyProtocol) && !"TCP6".equals(proxyProtocol) && !UNKNOWN.equals(proxyProtocol)) { + throw new TioDecodeException("unsupported v1 proxy message: " + proxyProtocol); + } + if (UNKNOWN.equals(proxyProtocol)) { + return unknownMsg(); + } + if (numParts != 5) { + throw new TioDecodeException("invalid TCP4/6 header: PROXY " + header + " (expected: 6 parts)"); + } + return new ProxyProtocolMessage(proxyProtocol, parts[1], parts[2], parts[3], parts[4]); + } + + /** + * Proxy message message for 'UNKNOWN' proxied protocols. Per spec, when the proxied message is + * 'UNKNOWN' we must discard all other header values. + */ + private static ProxyProtocolMessage unknownMsg() { + return new ProxyProtocolMessage(UNKNOWN, null, null, 0, 0); + } + + /** + * Returns the index in the buffer of the end of line found. + * Returns -1 if no end of line was found in the buffer. + */ + private static int findEndOfLine(final ByteBuffer buffer) { + final int n = buffer.limit(); + for (int i = buffer.position(); i < n; i++) { + final byte b = buffer.get(i); + if (b == '\r' && i < n - 1 && buffer.get(i + 1) == '\n') { + return i; // \r\n + } + } + return -1; // Not found. + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolMessage.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolMessage.java new file mode 100644 index 0000000..b7795ff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/proxy/ProxyProtocolMessage.java @@ -0,0 +1,109 @@ +package com.zt.plat.module.qms.iot.tcpserver.proxy; + +/** + * ProxyProtocolMessage + * 代理协议 + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +public class ProxyProtocolMessage { + + /** + * 代理的协议,ipv4/6 + */ + private final String protocol; + /** + * 源地址 + */ + private final String sourceAddress; + /** + * 目标地址 + */ + private final String destinationAddress; + /** + * 源端口 + */ + private final int sourcePort; + /** + * 目标端口 + */ + private final int destinationPort; + + public ProxyProtocolMessage(String protocol, + String sourceAddress, + String destinationAddress, + String sourcePort, + String destinationPort) { + this(protocol, sourceAddress, destinationAddress, portStringToInt(sourcePort), portStringToInt(destinationPort)); + } + + public ProxyProtocolMessage(String protocol, + String sourceAddress, + String destinationAddress, + int sourcePort, + int destinationPort) { + this.protocol = protocol; + this.sourceAddress = sourceAddress; + this.destinationAddress = destinationAddress; + this.sourcePort = sourcePort; + this.destinationPort = destinationPort; + } + + public String getProtocol() { + return protocol; + } + + public String getSourceAddress() { + return sourceAddress; + } + + public String getDestinationAddress() { + return destinationAddress; + } + + public int getSourcePort() { + return sourcePort; + } + + public int getDestinationPort() { + return destinationPort; + } + + /** + * Convert port to integer + * + * @param value the port + * @return port as an integer + * @throws IllegalArgumentException if port is not a valid integer + */ + private static int portStringToInt(String value) { + int port; + try { + port = Integer.parseInt(value); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("invalid port: " + value, e); + } + if (port <= 0 || port > 65535) { + throw new IllegalArgumentException("invalid port: " + value + " (expected: 1 ~ 65535)"); + } + return port; + } + + @Override + public String toString() { + return "ProxyProtocolMessage{" + + "message='" + protocol + '\'' + + ", sourceAddress='" + sourceAddress + '\'' + + ", destinationAddress='" + destinationAddress + '\'' + + ", sourcePort=" + sourcePort + + ", destinationPort=" + destinationPort + + '}'; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/BalanceDataPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/BalanceDataPublisher.java new file mode 100644 index 0000000..ece0c3e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/BalanceDataPublisher.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +import cn.hutool.extra.spring.SpringUtil; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.BalanceDataEvent; +import com.zt.plat.module.qms.iot.tcpserver.pojo.BalanceData; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * BalanceDataPublisher + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +public class BalanceDataPublisher { + + /** + * 发布事件 + * @param deviceId 设备id + * @param tenantId 租户id + * @param weight 重量 + * @param weightUnit 重量单位 + */ + public static void publishEvent(Long deviceId, String tenantId, String weight, String weightUnit) { + BalanceData balanceData = new BalanceData(); + balanceData.setDevid(deviceId); + balanceData.setTenantId(tenantId); + balanceData.setTstamp(new Date()); + balanceData.setWeight(weight); + balanceData.setWeightUnit(weightUnit); + Map event = new HashMap<>(16); + event.put(EventConstant.EVENT_BALANCE, balanceData); + SpringUtil.publishEvent(new BalanceDataEvent(event)); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/HygrothermographPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/HygrothermographPublisher.java new file mode 100644 index 0000000..a873886 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/HygrothermographPublisher.java @@ -0,0 +1,42 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +import cn.hutool.extra.spring.SpringUtil; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.HygrothermographEvent; +import com.zt.plat.module.qms.iot.tcpserver.pojo.Hygrothermograph; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * HygrothermographPublisher + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +public class HygrothermographPublisher { + + /** + * 发布事件 + * @param deviceId 设备id + * @param tenantId 租户id + * @param temperature 温度 + * @param humidity 湿度 + */ + public static void publishEvent(Long deviceId, String tenantId, Integer temperature, Integer humidity) { + Hygrothermograph hygrothermograph = new Hygrothermograph(); + hygrothermograph.setDevid(deviceId); + hygrothermograph.setTenantId(tenantId); + hygrothermograph.setTstamp(new Date()); + hygrothermograph.setTemperature(temperature); + hygrothermograph.setHumidity(humidity); + Map event = new HashMap<>(16); + event.put(EventConstant.EVENT_HYGROTHERMOGRAPH, hygrothermograph); + SpringUtil.publishEvent(new HygrothermographEvent(event)); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/IotDeviceRegisterPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/IotDeviceRegisterPublisher.java new file mode 100644 index 0000000..d7ea0f7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/IotDeviceRegisterPublisher.java @@ -0,0 +1,32 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +import cn.hutool.extra.spring.SpringUtil; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.IotDeviceRegisterEvent; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; + +/** + * IotDeviceRegisterPublisher + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-17          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-17 + */ +public class IotDeviceRegisterPublisher { + + public static void publishEvent(String deviceCode, String deviceType) { + DeviceInfomationDO deviceInfo = new DeviceInfomationDO(); + deviceInfo.setId(new BigInteger(deviceCode, Character.MAX_RADIX).longValue()); + deviceInfo.setCollectDeviceType(deviceType); + Map event = new HashMap<>(16); + event.put(EventConstant.EVENT_IOT_DEVICE_REGISTER, deviceInfo); + SpringUtil.publishEvent(new IotDeviceRegisterEvent(event)); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointDeviceDataPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointDeviceDataPublisher.java new file mode 100644 index 0000000..c87b4f3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointDeviceDataPublisher.java @@ -0,0 +1,15 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +/** + * MeasurePointDeviceDataPublisher + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-10-18          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-10-18 + */ +public class MeasurePointDeviceDataPublisher { + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointPublisher.java new file mode 100644 index 0000000..a01cda8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointPublisher.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +import cn.hutool.extra.spring.SpringUtil; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.core.MeasurePoint; +import com.zt.plat.module.qms.iot.tcpserver.event.MeasurePointEvent; + +import java.util.HashMap; +import java.util.Map; + +/** + * MeasurePointPublisher + * 计量点事件发送 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-6-25          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-6-25 + */ +public class MeasurePointPublisher { + + public static void publishEvent() { + MeasurePoint measurePoint = new MeasurePoint(); + + Map event = new HashMap<>(16); + event.put(EventConstant.EVENT_MEASURE_POINT, measurePoint); + SpringUtil.publishEvent(new MeasurePointEvent(event)); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointRunLogsPublisher.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointRunLogsPublisher.java new file mode 100644 index 0000000..2b130a8 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/publisher/MeasurePointRunLogsPublisher.java @@ -0,0 +1,43 @@ +package com.zt.plat.module.qms.iot.tcpserver.publisher; + +import cn.hutool.extra.spring.SpringUtil; +import com.zt.plat.module.qms.iot.tcpserver.core.EventConstant; +import com.zt.plat.module.qms.iot.tcpserver.event.MeasurePointRunLogsEvent; +import com.zt.plat.module.qms.iot.tcpserver.pojo.MeasurePointRunLogs; + +import java.util.HashMap; +import java.util.Map; + +/** + * MeasurePointRunLogsPublisher + * 计量点运行日志 + *

更新历史:

+ *
 版本         更新时间            更新者        更新内容
+ * V1.0      2021-8-4          王兴荣         Add
+ * Copyright (C) 云南志者竟成科技有限公司 + * @author 王兴荣 <xingrong_wang@will-way.cn> + * @version V1.0 + * @since 2021-8-4 + */ +public class MeasurePointRunLogsPublisher { + + /** + * 发布计量点运行日志事件 + * @param measurePointId 计量点Id + * @param measurePointCode 计量点编号 + * @param tenantId 租户id + * @param time C# utc long时间 + * @param content 日志内容 + */ + public static void publishEvent(String measurePointId, String measurePointCode, String tenantId, String utcTime, String content) { + MeasurePointRunLogs measurePointRunLogs = new MeasurePointRunLogs(); + measurePointRunLogs.setMeasurePointId(measurePointId); + measurePointRunLogs.setMeasurePointCode(measurePointCode); + measurePointRunLogs.setTenantId(tenantId); + measurePointRunLogs.setTime(utcTime); + measurePointRunLogs.setContent(content); + Map event = new HashMap<>(16); + event.put(EventConstant.EVENT_MEASURE_POINT_RUN_LOGS, measurePointRunLogs); + SpringUtil.publishEvent(new MeasurePointRunLogsEvent(event)); + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/ByteBufferUtil.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/ByteBufferUtil.java new file mode 100644 index 0000000..e349ff5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/ByteBufferUtil.java @@ -0,0 +1,1107 @@ +package com.zt.plat.module.qms.iot.tcpserver.utils; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; + +/** + * ByteBufferUtil + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +public class ByteBufferUtil { + + private ByteBufferUtil() { + } + + /** + * 空 byte 数组 + */ + public static final byte[] EMPTY_BYTES = new byte[0]; + + /** + * read byte + * + * @param buffer ByteBuffer + * @return byte + */ + public static byte readByte(ByteBuffer buffer) { + return buffer.get(); + } + + /** + * read unsigned byte,1个字节无符号 + * + * @param buffer ByteBuffer + * @return short + */ + public static short readUnsignedByte(ByteBuffer buffer) { + return (short) (buffer.get() & 0xFF); + } + + /** + * 读取 byte 数组 + * + * @param buffer ByteBuffer + * @param length 长度 + * @return byte array + */ + public static byte[] readBytes(ByteBuffer buffer, int length) { + byte[] data = new byte[length]; + buffer.get(data, 0, length); + return data; + } + + /** + * 读取 short + * + * @param buffer ByteBuffer + * @return short + */ + public static short readShort(ByteBuffer buffer) { + return buffer.getShort(); + } + + /** + * 读取 short,小端 + * + * @param buffer ByteBuffer + * @return short + */ + public static short readShortLE(ByteBuffer buffer) { + byte[] value = new byte[2]; + buffer.get(value, 0, 2); + short ret = value[0]; + ret |= (short) ((value[1] & 0xff) << 8); + return ret; + } + + /** + * 读取 short,大端 + * + * @param buffer ByteBuffer + * @return short + */ + public static short readShortBE(ByteBuffer buffer) { + byte[] value = new byte[2]; + buffer.get(value, 0, 2); + short ret = (short) ((value[0]) << 8); + ret |= (short) (value[1] & 0xff); + return ret; + } + + /** + * read unsigned short,2个字节无符号 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedShort(ByteBuffer buffer) { + ByteOrder order = buffer.order(); + if (ByteOrder.BIG_ENDIAN == order) { + return readUnsignedShortBE(buffer); + } else { + return readUnsignedShortLE(buffer); + } + } + + /** + * read unsigned short,2个字节无符号 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedShortLE(ByteBuffer buffer) { + byte[] value = new byte[2]; + buffer.get(value, 0, 2); + int ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + return ret; + } + + /** + * read unsigned short,2个字节无符号,大端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedShortBE(ByteBuffer buffer) { + byte[] value = new byte[2]; + buffer.get(value, 0, 2); + int ret = (value[0] & 0xff) << 8; + ret |= value[1] & 0xff; + return ret; + } + + /** + * 读取3个字节有符号 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readMedium(ByteBuffer buffer) { + ByteOrder order = buffer.order(); + if (ByteOrder.BIG_ENDIAN == order) { + return readMediumBE(buffer); + } else { + return readMediumLE(buffer); + } + } + + /** + * 读取3个字节有符号,小端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readMediumLE(ByteBuffer buffer) { + int ret = readUnsignedMediumLE(buffer); + // 如果最高位为1,则表示是负数 + if ((ret & 0x800000) != 0) { + // 将最高位之上的位全部设置为1,以保持有符号性质 + ret |= 0xff000000; + } + return ret; + } + + /** + * 读取3个字节有符号,大端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readMediumBE(ByteBuffer buffer) { + int ret = readUnsignedMediumBE(buffer); + // 如果最高位为1,则表示是负数 + if ((ret & 0x800000) != 0) { + // 将最高位之上的位全部设置为1,以保持有符号性质 + ret |= 0xff000000; + } + return ret; + } + + /** + * read unsigned 3个字节无符号 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedMedium(ByteBuffer buffer) { + ByteOrder order = buffer.order(); + if (ByteOrder.BIG_ENDIAN == order) { + return readUnsignedMediumBE(buffer); + } else { + return readUnsignedMediumLE(buffer); + } + } + + /** + * read unsigned 3个字节无符号,小端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedMediumLE(ByteBuffer buffer) { + byte[] value = new byte[3]; + buffer.get(value, 0, 3); + int ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + ret |= (value[2] & 0xff) << 16; + return ret; + } + + /** + * read unsigned 3个字节无符号,大端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readUnsignedMediumBE(ByteBuffer buffer) { + byte[] value = new byte[3]; + buffer.get(value, 0, 3); + int ret = (value[0] & 0xff) << 16; + ret |= (value[1] & 0xff) << 8; + ret |= value[2] & 0xff; + return ret; + } + + /** + * read int, 4个字节 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readInt(ByteBuffer buffer) { + return buffer.getInt(); + } + + /** + * read int, 4个字节,小端 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readIntLE(ByteBuffer buffer) { + byte[] value = new byte[4]; + buffer.get(value, 0, 4); + int ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + ret |= (value[2] & 0xff) << 16; + ret |= value[3] << 24; + return ret; + } + + /** + * read int, 4个字节,大端在前 + * + * @param buffer ByteBuffer + * @return int + */ + public static int readIntBE(ByteBuffer buffer) { + byte[] value = new byte[4]; + buffer.get(value, 0, 4); + int ret = value[0] << 24; + ret |= (value[1] & 0xff) << 16; + ret |= (value[2] & 0xff) << 8; + ret |= value[3] & 0xff; + return ret; + } + + /** + * read unsigned int, 4个字节无符号 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedInt(ByteBuffer buffer) { + ByteOrder order = buffer.order(); + if (ByteOrder.BIG_ENDIAN == order) { + return readUnsignedIntBE(buffer); + } else { + return readUnsignedIntLE(buffer); + } + } + + /** + * read unsigned int, 4个字节无符号 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedIntLE(ByteBuffer buffer) { + byte[] value = new byte[4]; + buffer.get(value, 0, 4); + long ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + ret |= (value[2] & 0xff) << 16; + ret |= (long) (value[3] & 0xff) << 24; + return ret; + } + + /** + * read unsigned int, 4个字节无符号,大端在前 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedIntBE(ByteBuffer buffer) { + byte[] value = new byte[4]; + buffer.get(value, 0, 4); + long ret = (long) (value[0] & 0xff) << 24; + ret |= (value[1] & 0xff) << 16; + ret |= (value[2] & 0xff) << 8; + ret |= value[3] & 0xff; + return ret; + } + + /** + * read n 个字节无符号,大端在前 + * + * @param buffer ByteBuffer + * @param n n 个字符 + * @return int + */ + public static long readUnsignedNByteBE(ByteBuffer buffer, int n) { + byte[] value = new byte[n]; + buffer.get(value, 0, n); + long ret = 0; + for (int i = 0; i < n; i++) { + ret |= (long) (value[i] & 0xff) << (8 * (n - i - 1)); + } + return ret; + } + + /** + * read n 个字节无符号,小端在前 + * + * @param buffer ByteBuffer + * @param n n 个字符 + * @return long + */ + public static long readUnsignedNByteLE(ByteBuffer buffer, int n) { + byte[] value = new byte[n]; + buffer.get(value, 0, n); + long ret = 0; + for (int i = 0; i < n; i++) { + ret |= (long) (value[i] & 0xff) << (8 * i); + } + return ret; + } + + /** + * read float, 4个字节,小端 + * + * @param buffer ByteBuffer + * @return float + */ + public static float readFloat(ByteBuffer buffer) { + return buffer.getFloat(); + } + + /** + * read float, 4个字节,小端 + * + * @param buffer ByteBuffer + * @return float + */ + public static float readFloatLE(ByteBuffer buffer) { + return Float.intBitsToFloat(readIntLE(buffer)); + } + + /** + * read float, 4个字节,大端 + * + * @param buffer ByteBuffer + * @return float + */ + public static float readFloatBE(ByteBuffer buffer) { + return Float.intBitsToFloat(readIntBE(buffer)); + } + + /** + * read long, 8个字节 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readLong(ByteBuffer buffer) { + return buffer.getLong(); + } + + /** + * read long, 8个字节,无符号 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readLongLE(ByteBuffer buffer) { + byte[] value = new byte[8]; + buffer.get(value, 0, 8); + long ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + ret |= (value[2] & 0xff) << 16; + ret |= (long) (value[3] & 0xff) << 24; + ret |= (long) (value[4] & 0xff) << 32; + ret |= (long) (value[5] & 0xff) << 40; + ret |= (long) (value[6] & 0xff) << 48; + ret |= (long) value[7] << 56; + return ret; + } + + /** + * read long, 8个字节,无符号,大端在前 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readLongBE(ByteBuffer buffer) { + byte[] value = new byte[8]; + buffer.get(value, 0, 8); + long ret = (long) value[0] << 56; + ret |= (long) (value[1] & 0xff) << 48; + ret |= (long) (value[2] & 0xff) << 40; + ret |= (long) (value[3] & 0xff) << 32; + ret |= (long) (value[4] & 0xff) << 24; + ret |= (value[5] & 0xff) << 16; + ret |= (value[6] & 0xff) << 8; + ret |= value[7] & 0xff; + return ret; + } + + /** + * read long, 8个字节,无符号 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedLong(ByteBuffer buffer) { + ByteOrder order = buffer.order(); + if (ByteOrder.BIG_ENDIAN == order) { + return readUnsignedLongBE(buffer); + } else { + return readUnsignedLongLE(buffer); + } + } + + /** + * read long, 8个字节,无符号 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedLongLE(ByteBuffer buffer) { + byte[] value = new byte[8]; + buffer.get(value, 0, 8); + long ret = value[0] & 0xff; + ret |= (value[1] & 0xff) << 8; + ret |= (value[2] & 0xff) << 16; + ret |= (long) (value[3] & 0xff) << 24; + ret |= (long) (value[4] & 0xff) << 32; + ret |= (long) (value[5] & 0xff) << 40; + ret |= (long) (value[6] & 0xff) << 48; + ret |= (long) (value[7] & 0xff) << 56; + return ret; + } + + /** + * read long, 8个字节,无符号,大端在前 + * + * @param buffer ByteBuffer + * @return long + */ + public static long readUnsignedLongBE(ByteBuffer buffer) { + byte[] value = new byte[8]; + buffer.get(value, 0, 8); + long ret = (long) (value[0] & 0xff) << 56; + ret |= (long) (value[1] & 0xff) << 48; + ret |= (long) (value[2] & 0xff) << 40; + ret |= (long) (value[3] & 0xff) << 32; + ret |= (long) (value[4] & 0xff) << 24; + ret |= (value[5] & 0xff) << 16; + ret |= (value[6] & 0xff) << 8; + ret |= value[7] & 0xff; + return ret; + } + + /** + * read double, 8个字节 + * + * @param buffer ByteBuffer + * @return double + */ + public static double readDouble(ByteBuffer buffer) { + return buffer.getDouble(); + } + + /** + * read double, 8个字节,小端在前 + * + * @param buffer ByteBuffer + * @return double + */ + public static double readDoubleLE(ByteBuffer buffer) { + return Double.longBitsToDouble(readLongLE(buffer)); + } + + /** + * read double, 8个字节,大端在前 + * + * @param buffer ByteBuffer + * @return double + */ + public static double readDoubleBE(ByteBuffer buffer) { + return Double.longBitsToDouble(readLongBE(buffer)); + } + + /** + * 写出 1 个字节的无符号 byte + * + * @param buffer ByteBuffer + * @param s 数据 + */ + public static void writeByte(ByteBuffer buffer, short s) { + buffer.put((byte) s); + } + + /** + * 写出 2 个字节的 short,小端模式 + * + * @param buffer ByteBuffer + * @param s 数据 + */ + public static void writeShortLE(ByteBuffer buffer, int s) { + byte[] value = new byte[2]; + value[0] = (byte) s; + value[1] = (byte) (s >> 8); + buffer.put(value, 0, 2); + } + + /** + * 写出 2 个字节的 short,大端模式 + * + * @param buffer ByteBuffer + * @param s 数据 + */ + public static void writeShortBE(ByteBuffer buffer, int s) { + byte[] value = new byte[2]; + value[0] = (byte) (s >> 8); + value[1] = (byte) s; + buffer.put(value, 0, 2); + } + + /** + * 写出 3 个字节的无符号 + * + * @param buffer ByteBuffer + * @param i 数据 + */ + public static void writeMediumLE(ByteBuffer buffer, int i) { + byte[] value = new byte[3]; + value[0] = (byte) (i); + value[1] = (byte) (i >>> 8); + value[2] = (byte) (i >>> 16); + buffer.put(value, 0, 3); + } + + /** + * 写出 3 个字节的无符号,大端模式 + * + * @param buffer ByteBuffer + * @param i 数据 + */ + public static void writeMediumBE(ByteBuffer buffer, int i) { + byte[] value = new byte[3]; + value[0] = (byte) (i >>> 16); + value[1] = (byte) (i >>> 8); + value[2] = (byte) (i); + buffer.put(value, 0, 3); + } + + /** + * 写出 4 个字节的 int,小端模式 + * + * @param buffer ByteBuffer + * @param i 数据 + */ + public static void writeIntLE(ByteBuffer buffer, long i) { + byte[] value = new byte[4]; + value[0] = (byte) i; + value[1] = (byte) (i >> 8); + value[2] = (byte) (i >> 16); + value[3] = (byte) (i >> 24); + buffer.put(value, 0, 4); + } + + /** + * 写出 4 个字节的 int,大端模式 + * + * @param buffer ByteBuffer + * @param i 数据 + */ + public static void writeIntBE(ByteBuffer buffer, long i) { + byte[] value = new byte[4]; + value[0] = (byte) (i >> 24); + value[1] = (byte) (i >> 16); + value[2] = (byte) (i >> 8); + value[3] = (byte) i; + buffer.put(value, 0, 4); + } + + /** + * 写出 4 个字节的 float + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeFloat(ByteBuffer buffer, float value) { + buffer.putFloat(value); + } + + /** + * 写出 4 个字节的 float,小端模式 + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeFloatLE(ByteBuffer buffer, float value) { + writeIntLE(buffer, Float.floatToRawIntBits(value)); + } + + /** + * 写出 4 个字节的 float,大端模式 + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeFloatBE(ByteBuffer buffer, float value) { + writeIntBE(buffer, Float.floatToRawIntBits(value)); + } + + /** + * 写出 8 个字节的 long,小端模式 + * + * @param buffer ByteBuffer + * @param l 数据 + */ + public static void writeLongLE(ByteBuffer buffer, long l) { + byte[] value = new byte[8]; + value[0] = (byte) l; + value[1] = (byte) (l >> 8); + value[2] = (byte) (l >> 16); + value[3] = (byte) (l >> 24); + value[4] = (byte) (l >> 32); + value[5] = (byte) (l >> 40); + value[6] = (byte) (l >> 48); + value[7] = (byte) (l >> 56); + buffer.put(value, 0, 8); + } + + /** + * 写出 8 个字节的 long,大端模式 + * + * @param buffer ByteBuffer + * @param l 数据 + */ + public static void writeLongBE(ByteBuffer buffer, long l) { + byte[] value = new byte[8]; + value[0] = (byte) (l >> 56); + value[1] = (byte) (l >> 48); + value[2] = (byte) (l >> 40); + value[3] = (byte) (l >> 32); + value[4] = (byte) (l >> 24); + value[5] = (byte) (l >> 16); + value[6] = (byte) (l >> 8); + value[7] = (byte) l; + buffer.put(value, 0, 8); + } + + /** + * 写出 8 个字节的 value + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeDouble(ByteBuffer buffer, double value) { + buffer.putDouble(value); + } + + /** + * 写出 8 个字节的 value,小端模式 + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeDoubleLE(ByteBuffer buffer, double value) { + writeLongLE(buffer, Double.doubleToRawLongBits(value)); + } + + /** + * 写出 8 个字节的 value,大端模式 + * + * @param buffer ByteBuffer + * @param value 数据 + */ + public static void writeDoubleBE(ByteBuffer buffer, double value) { + writeLongBE(buffer, Double.doubleToRawLongBits(value)); + } + + /** + * skip bytes + * + * @param buffer ByteBuffer + * @param skip skip bytes + * @return ByteBuffer + */ + public static ByteBuffer skipBytes(ByteBuffer buffer, int skip) { + buffer.position(buffer.position() + skip); + return buffer; + } + + /** + * 组合两个 bytebuffer,把可读部分的组合成一个新的 bytebuffer + * + * @param byteBuffer1 ByteBuffer + * @param byteBuffer2 ByteBuffer + * @return ByteBuffer + */ + public static ByteBuffer composite(ByteBuffer byteBuffer1, ByteBuffer byteBuffer2) { + int capacity = byteBuffer1.remaining() + byteBuffer2.remaining(); + ByteBuffer ret = ByteBuffer.allocate(capacity); + ret.put(byteBuffer1); + ret.put(byteBuffer2); + ret.position(0); + ret.limit(ret.capacity()); + return ret; + } + + /** + * ByteBuffer clone + * + * @param original ByteBuffer + * @return ByteBuffer + */ + public static ByteBuffer clone(ByteBuffer original) { + ByteBuffer clone = ByteBuffer.allocate(original.capacity()); + // copy from the beginning + original.rewind(); + clone.put(original); + original.rewind(); + clone.flip(); + return clone; + } + + /** + * @param src ByteBuffer + * @param srcStartIndex srcStartIndex + * @param dest ByteBuffer + * @param destStartIndex destStartIndex + * @param length length + */ + public static void copy(ByteBuffer src, int srcStartIndex, ByteBuffer dest, int destStartIndex, int length) { + System.arraycopy(src.array(), srcStartIndex, dest.array(), destStartIndex, length); + } + + /** + * @param src 本方法不会改变position等指针变量 + * @param startIndex 从0开始 + * @param endIndex endIndex + * @return ByteBuffer + */ + public static ByteBuffer copy(ByteBuffer src, int startIndex, int endIndex) { + int size = endIndex - startIndex; + int initPosition = src.position(); + int initLimit = src.limit(); + + src.position(startIndex); + src.limit(endIndex); + ByteBuffer ret = ByteBuffer.allocate(size); + ret.put(src); + ret.flip(); + + src.position(initPosition); + src.limit(initLimit); + return ret; + } + + /** + * @param src 本方法不会改变position等指针变量 + * @return ByteBuffer + */ + public static ByteBuffer copy(ByteBuffer src) { + int startIndex = src.position(); + int endIndex = src.limit(); + return copy(src, startIndex, endIndex); + } + + /** + * @param src ByteBuffer + * @param unitSize 每个单元的大小 + * @return 如果不需要拆分,则返回null + */ + public static ByteBuffer[] split(ByteBuffer src, int unitSize) { + int limit = src.limit(); + if (unitSize >= limit) { + return null; + } + int size = (int) (Math.ceil((double) src.limit() / (double) unitSize)); + ByteBuffer[] ret = new ByteBuffer[size]; + int srcIndex = 0; + for (int i = 0; i < size; i++) { + int bufferSize = unitSize; + if (i == size - 1) { + bufferSize = src.limit() % unitSize; + } + byte[] dest = new byte[bufferSize]; + System.arraycopy(src.array(), srcIndex, dest, 0, dest.length); + srcIndex = srcIndex + bufferSize; + + ret[i] = ByteBuffer.wrap(dest); + ret[i].position(0); + ret[i].limit(ret[i].capacity()); + } + return ret; + } + + /** + * @param buffer ByteBuffer + * @return index + */ + public static int lineEnd(ByteBuffer buffer) { + return lineEnd(buffer, Integer.MAX_VALUE); + } + + /** + * @param buffer ByteBuffer + * @param maxLength maxLength + * @return index + */ + public static int lineEnd(ByteBuffer buffer, int maxLength) { + int initPosition = buffer.position(); + int endPosition = indexOf(buffer, '\n', maxLength); + if ((endPosition - initPosition > 0) && (buffer.get(endPosition - 1) == '\r')) { + return endPosition - 1; + } + return endPosition; + } + + /** + * @param buffer position会被移动 + * @param theChar 结束 + * @param maxLength maxLength + * @return index + */ + public static int indexOf(ByteBuffer buffer, char theChar, int maxLength) { + int count = 0; + boolean needJudgeLengthOverflow = buffer.remaining() > maxLength; + while (buffer.hasRemaining()) { + if (buffer.get() == theChar) { + return buffer.position() - 1; + } + if (needJudgeLengthOverflow) { + count++; + if (count > maxLength) { + throw new IndexOutOfBoundsException("maxlength is " + maxLength); + } + } + } + return -1; + } + + /** + * 读取一行 + * + * @param buffer ByteBuffer + * @param charset Charset + * @return String + */ + public static String readLine(ByteBuffer buffer, Charset charset) { + return readLine(buffer, charset, Integer.MAX_VALUE); + } + + /** + * @param buffer ByteBuffer + * @param charset Charset + * @param maxLength maxLength + * @return String + */ + public static String readLine(ByteBuffer buffer, Charset charset, int maxLength) { + int startPosition = buffer.position(); + int endPosition = lineEnd(buffer, maxLength); + if (endPosition == -1) { + return null; + } + int nowPosition = buffer.position(); + if (endPosition > startPosition) { + byte[] bs = new byte[endPosition - startPosition]; + buffer.position(startPosition); + buffer.get(bs); + buffer.position(nowPosition); + if (charset == null) { + return new String(bs); + } else { + return new String(bs, charset); + } + } else if (endPosition == startPosition) { + return ""; + } + return null; + } + + /** + * 读取字符串 + * + * @param buffer ByteBuffer + * @param count count + * @return String + */ + public static String readString(ByteBuffer buffer, int count) { + return readString(buffer, count, StandardCharsets.UTF_8); + } + + /** + * 读取字符串 + * + * @param buffer ByteBuffer + * @param count count + * @param charset Charset + * @return String + */ + public static String readString(ByteBuffer buffer, int count, Charset charset) { + byte[] bytes = new byte[count]; + buffer.get(bytes); + return new String(bytes, charset); + } + + /** + * @param buffer ByteBuffer + * @param charset Charset + * @param endChar endChar + * @param maxLength maxLength + * @return String + */ + public static String readString(ByteBuffer buffer, Charset charset, char endChar, int maxLength) { + int startPosition = buffer.position(); + int endPosition = indexOf(buffer, endChar, maxLength); + if (endPosition == -1) { + return null; + } + int nowPosition = buffer.position(); + if (endPosition > startPosition) { + byte[] bs = new byte[endPosition - startPosition]; + buffer.position(startPosition); + buffer.get(bs); + buffer.position(nowPosition); + if (charset == null) { + return new String(bs); + } else { + return new String(bs, charset); + } + } else if (endPosition == startPosition) { + return ""; + } + return null; + } + + /** + * 转成 string,读取 ByteBuffer 所有数据 + * + * @param buffer ByteBuffer + * @return 字符串 + */ + public static String toString(ByteBuffer buffer) { + return toString(buffer, StandardCharsets.UTF_8); + } + + /** + * 转成 string,读取 ByteBuffer 所有数据 + * + * @param buffer ByteBuffer + * @param charset Charset + * @return 字符串 + */ + public static String toString(ByteBuffer buffer, Charset charset) { + return new String(buffer.array(), charset); + } + + /** + * 转成 string + * + * @param buffer ByteBuffer + * @return 字符串 + */ + public static String toString(byte[] buffer) { + return toString(buffer, StandardCharsets.UTF_8); + } + + /** + * 转成 string + * + * @param buffer ByteBuffer + * @param charset Charset + * @return 字符串 + */ + public static String toString(byte[] buffer, Charset charset) { + return new String(buffer, charset); + } + + /** + * 以16进制 打印 ByteBuffer + * + * @param byteBuffer ByteBuffer + * @return hex String + */ + public static String hexDump(ByteBuffer byteBuffer) { + byte[] data = Arrays.copyOf(byteBuffer.array(), byteBuffer.remaining()); + return toHexString(data); + } + + /** + * 以16进制 打印字节数组 + * + * @param bytes byte[] + * @return hex String + */ + public static String toHexString(final byte[] bytes) { + final StringBuilder buffer = new StringBuilder(bytes.length); + buffer.append("\r\n\t\t 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n"); + int startIndex = 0; + int column = 0; + for (int i = 0; i < bytes.length; i++) { + column = i % 16; + switch (column) { + case 0: + startIndex = i; + buffer.append(fixHexString(Integer.toHexString(i))).append(": "); + buffer.append(HexUtils.encode(bytes[i])); + buffer.append(' '); + break; + case 15: + buffer.append(HexUtils.encode(bytes[i])); + buffer.append(" ; "); + buffer.append(filterString(bytes, startIndex, column + 1)); + buffer.append("\r\n"); + break; + default: + buffer.append(HexUtils.encode(bytes[i])); + buffer.append(' '); + } + } + if (column != 15) { + for (int i = 0; i < 15 - column; i++) { + buffer.append(" "); + } + buffer.append("; ").append(filterString(bytes, startIndex, column + 1)); + buffer.append("\r\n"); + } + + return buffer.toString(); + } + + /** + * 过滤掉字节数组中0x0 - 0x1F的控制字符,生成字符串 + * + * @param bytes byte[] + * @param offset int + * @param count int + * @return String + */ + private static String filterString(final byte[] bytes, final int offset, final int count) { + final byte[] buffer = new byte[count]; + System.arraycopy(bytes, offset, buffer, 0, count); + for (int i = 0; i < count; i++) { + if (buffer[i] >= 0x0 && buffer[i] <= 0x1F) { + buffer[i] = 0x2e; + } + } + return new String(buffer); + } + + /** + * 将hexStr格式化成length长度16进制数,并在后边加上h + * + * @param hexStr String + * @return String + */ + private static String fixHexString(final String hexStr) { + if (hexStr == null || hexStr.isEmpty()) { + return "00000000h"; + } else { + final StringBuilder buf = new StringBuilder(8); + final int strLen = hexStr.length(); + for (int i = 0; i < 8 - strLen; i++) { + buf.append('0'); + } + buf.append(hexStr).append('h'); + return buf.toString(); + } + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/HexUtils.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/HexUtils.java new file mode 100644 index 0000000..21f871d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/iot/tcpserver/utils/HexUtils.java @@ -0,0 +1,289 @@ +package com.zt.plat.module.qms.iot.tcpserver.utils; + +import tech.zzjc.tio.utils.hutool.StrUtil; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * HexUtils + *

+ * 更新历史: + *

 版本         更新时间            更新者        更新内容
+ * V1.0 2024年9月10日 wxr Add
+ * Copyright (C) 云南志者竟成科技有限公司 + *

+ * @author 王兴荣 + * @version V1.0 + * @since 2024年9月10日 + */ +public class HexUtils { + public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + private static final byte[] DIGITS_LOWER = new byte[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + private static final byte[] DIGITS_UPPER = new byte[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + private static final int OFFSET_BASIS = (int) 2166136261L; + private static final int PRIME = 16777619; + + /** + * FNV1算法 + * + * @param src src + * @return int + */ + public static int hashFNV1(byte[] src) { + return hashFNV1(src, 0, src.length); + } + + /** + * FNV1算法 + * + * @param src src + * @param start start + * @param len len + * @return int + */ + public static int hashFNV1(byte[] src, int start, int len) { + int hash = OFFSET_BASIS; + int end = start + len; + for (int i = start; i < end; i++) { + hash = (hash ^ src[i]) * PRIME; + } + return hash; + } + + /** + * encode Hex + * + * @param data data to hex + * @return hex bytes + */ + public static byte[] encode(byte[] data) { + return encode(data, true); + } + + /** + * encode Hex + * + * @param data data to hex + * @param toLowerCase 是否小写 + * @return hex bytes + */ + public static byte[] encode(byte[] data, boolean toLowerCase) { + return encode(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + + /** + * encode Hex + * + * @param data byte to Hex + * @return bytes as a hex string + */ + public static String encode(byte data) { + byte[] out = new byte[2]; + out[0] = DIGITS_LOWER[(0xF0 & data) >>> 4]; + out[1] = DIGITS_LOWER[0xF & data]; + return new String(out); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @return bytes as a hex string + */ + private static byte[] encode(byte[] data, byte[] digits) { + int len = data.length; + byte[] out = new byte[len << 1]; + for (int i = 0, j = 0; i < len; i++) { + out[j++] = digits[(0xF0 & data[i]) >>> 4]; + out[j++] = digits[0xF & data[i]]; + } + return out; + } + + /** + * encode Hex + * + * @param data Data to Hex + * @param toLowerCase 是否小写 + * @return bytes as a hex string + */ + public static String encodeToString(byte[] data, boolean toLowerCase) { + return new String(encode(data, toLowerCase), DEFAULT_CHARSET); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @return bytes as a hex string + */ + public static String encodeToString(byte[] data) { + return encodeToString(data, DEFAULT_CHARSET); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @param charset Charset + * @return bytes as a hex string + */ + public static String encodeToString(byte[] data, Charset charset) { + return new String(encode(data), charset); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @return bytes as a hex string + */ + public static String encodeToString(String data) { + if (StrUtil.isBlank(data)) { + return null; + } + return encodeToString(data.getBytes(DEFAULT_CHARSET)); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @param charset Charset + * @return bytes as a hex string + */ + public static String encodeToString(String data, Charset charset) { + return encodeToString(data, charset, charset); + } + + /** + * encode Hex + * + * @param data Data to Hex + * @param dataCharset Charset + * @param toCharset Charset + * @return bytes as a hex string + */ + public static String encodeToString(String data, Charset dataCharset, Charset toCharset) { + if (StrUtil.isBlank(data)) { + return null; + } + return encodeToString(data.getBytes(dataCharset), toCharset); + } + + /** + * decode Hex + * + * @param data Hex data + * @return decode hex to bytes + */ + public static byte[] decode(String data) { + return decode(data, DEFAULT_CHARSET); + } + + /** + * decode Hex + * + * @param data Hex data + * @param charset Charset + * @return decode hex to bytes + */ + public static byte[] decode(String data, Charset charset) { + if (StrUtil.isBlank(data)) { + return null; + } + return decode(data.getBytes(charset)); + } + + /** + * decodeToString Hex + * + * @param data Data to Hex + * @return bytes as a hex string + */ + public static String decodeToString(byte[] data) { + return decodeToString(data, DEFAULT_CHARSET); + } + + /** + * decodeToString Hex + * + * @param data Data to Hex + * @param charset Charset + * @return bytes as a hex string + */ + public static String decodeToString(byte[] data, Charset charset) { + byte[] decodeBytes = decode(data); + return new String(decodeBytes, charset); + } + + /** + * decodeToString Hex + * + * @param data Data to Hex + * @return bytes as a hex string + */ + public static String decodeToString(String data) { + if (StrUtil.isBlank(data)) { + return null; + } + return decodeToString(data.getBytes(DEFAULT_CHARSET)); + } + + /** + * decodeToString Hex + * + * @param data Data to Hex + * @param charset Charset + * @return bytes as a hex string + */ + public static String decodeToString(String data, Charset charset) { + return decodeToString(data, charset, charset); + } + + /** + * decodeToString Hex + * + * @param data Data to Hex + * @param dataCharset Charset + * @param toCharset Charset + * @return bytes as a hex string + */ + public static String decodeToString(String data, Charset dataCharset, Charset toCharset) { + if (StrUtil.isBlank(data)) { + return null; + } + return decodeToString(data.getBytes(dataCharset), toCharset); + } + + /** + * decode Hex + * + * @param data Hex data + * @return decode hex to bytes + */ + public static byte[] decode(byte[] data) { + int len = data.length; + if ((len & 0x01) != 0) { + throw new IllegalArgumentException("hexBinary needs to be even-length: " + len); + } + byte[] out = new byte[len >> 1]; + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + j++; + f |= toDigit(data[j], j); + j++; + out[i] = (byte) (f & 0xFF); + } + return out; + } + + private static int toDigit(byte b, int index) { + int digit = Character.digit(b, 16); + if (digit == -1) { + throw new IllegalArgumentException("Illegal hexadecimal byte " + b + " at index " + index); + } + return digit; + } +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/manage/deleteme b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/manage/deleteme new file mode 100644 index 0000000..e69de29 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/office/deleteme new file mode 100644 index 0000000..e69de29 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java new file mode 100644 index 0000000..a87a47a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceInfomationController.java @@ -0,0 +1,124 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import com.zt.plat.module.qms.resource.device.service.DeviceInfomationService; +import com.zt.plat.module.qms.resource.device.service.DeviceProductService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 设备-设备信息") +@RestController +@RequestMapping("/qms/resource/device-infomation") +@Validated +@FileUploadController(source = "resource.deviceinfomation") +public class DeviceInfomationController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceInfomationController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private DeviceInfomationService deviceInfomationService; + @Resource private DeviceProductService deviceProductService; + + @PostMapping("/create") + @Operation(summary = "创建设备-设备信息") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:create')") + public CommonResult createDeviceInfomation(@Valid @RequestBody DeviceInfomationSaveReqVO createReqVO) { + return success(deviceInfomationService.createDeviceInfomation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-设备信息") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:update')") + public CommonResult updateDeviceInfomation(@Valid @RequestBody DeviceInfomationSaveReqVO updateReqVO) { + deviceInfomationService.updateDeviceInfomation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-设备信息") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('resource:device-infomation:delete')") + public CommonResult deleteDeviceInfomation(@RequestParam("id") Long id) { + deviceInfomationService.deleteDeviceInfomation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-设备信息") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:delete')") + public CommonResult deleteDeviceInfomationList(@RequestBody BatchDeleteReqVO req) { + deviceInfomationService.deleteDeviceInfomationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-设备信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") + public CommonResult getDeviceInfomation(@RequestParam("id") Long id) { + DeviceInfomationDO deviceInfomation = deviceInfomationService.getDeviceInfomation(id); + return success(BeanUtils.toBean(deviceInfomation, DeviceInfomationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-设备信息分页") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')") + public CommonResult> getDeviceInfomationPage(@Valid DeviceInfomationPageReqVO pageReqVO) { + Long productId = pageReqVO.getProductId(); + if(productId != null){ + List productDOList = deviceProductService.listByIdPath(productId, DataTypeConstant.DATA_TYPE_DATA); + List productIds = productDOList.stream().map(DeviceProductDO::getId).toList(); + pageReqVO.setProductIds(productIds); + pageReqVO.setProductId(null); + } + PageResult pageResult = deviceInfomationService.getDeviceInfomationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceInfomationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-设备信息 Excel") + @PreAuthorize("@ss.hasPermission('resource:device-infomation:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceInfomationExcel(@Valid DeviceInfomationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceInfomationService.getDeviceInfomationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-设备信息.xls", "数据", DeviceInfomationRespVO.class, + BeanUtils.toBean(list, DeviceInfomationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java new file mode 100644 index 0000000..1a28046 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java @@ -0,0 +1,142 @@ +package com.zt.plat.module.qms.resource.device.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import com.zt.plat.module.qms.resource.device.service.DeviceProductService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 设备-设备大类") +@RestController +@RequestMapping("/qms/resource/device-product") +@Validated +@FileUploadController(source = "resource.deviceproduct") +public class DeviceProductController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = DeviceProductController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private DeviceProductService deviceProductService; + + @PostMapping("/saveData") + @Operation(summary = "保存数据") + public CommonResult saveData(@Valid @RequestBody DeviceProductSaveReqVO createReqVO) { + return deviceProductService.saveData(createReqVO); + } + + @PostMapping("/saveClassify") + @Operation(summary = "保存分类") + public CommonResult saveClassify(@Valid @RequestBody DeviceProductSaveReqVO createReqVO) { + return deviceProductService.saveCategory(createReqVO); + } + + @GetMapping("/getTreeData") + @Operation(summary = "查询分类树") + public CommonResult> getTreeData() { + List list = deviceProductService.getTreeData(DataTypeConstant.DATA_TYPE_CATEGORY); + return success(BeanUtils.toBean(list, DeviceProductRespVO.class)); + } + + @GetMapping("/getProductTreeData") + @Operation(summary = "获取分类和产品树") + public CommonResult> getProductTreeData() { + List list = deviceProductService.getTreeData(""); + return success(BeanUtils.toBean(list, DeviceProductRespVO.class)); + } + + @PostMapping("/create") + @Operation(summary = "创建设备-设备大类") + @PreAuthorize("@ss.hasPermission('resource:device-product:create')") + public CommonResult createDeviceProduct(@Valid @RequestBody DeviceProductSaveReqVO createReqVO) { + return success(deviceProductService.createDeviceProduct(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新设备-设备大类") + @PreAuthorize("@ss.hasPermission('resource:device-product:update')") + public CommonResult updateDeviceProduct(@Valid @RequestBody DeviceProductSaveReqVO updateReqVO) { + deviceProductService.updateDeviceProduct(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除设备-设备大类") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('resource:device-product:delete')") + public CommonResult deleteDeviceProduct(@RequestParam("id") Long id) { + deviceProductService.deleteDeviceProduct(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除设备-设备大类") + @PreAuthorize("@ss.hasPermission('resource:device-product:delete')") + public CommonResult deleteDeviceProductList(@RequestBody BatchDeleteReqVO req) { + deviceProductService.deleteDeviceProductListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得设备-设备大类") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('resource:device-product:query')") + public CommonResult getDeviceProduct(@RequestParam("id") Long id) { + DeviceProductDO deviceProduct = deviceProductService.getDeviceProduct(id); + return success(BeanUtils.toBean(deviceProduct, DeviceProductRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得设备-设备大类分页") + @PreAuthorize("@ss.hasPermission('resource:device-product:query')") + public CommonResult> getDeviceProductPage(@Valid DeviceProductPageReqVO pageReqVO) { + PageResult pageResult = deviceProductService.getDeviceProductPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, DeviceProductRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出设备-设备大类 Excel") + @PreAuthorize("@ss.hasPermission('resource:device-product:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportDeviceProductExcel(@Valid DeviceProductPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = deviceProductService.getDeviceProductPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "设备-设备大类.xls", "数据", DeviceProductRespVO.class, + BeanUtils.toBean(list, DeviceProductRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java new file mode 100644 index 0000000..341ebc7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationPageReqVO.java @@ -0,0 +1,138 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 设备-设备信息分页 Request VO") +@Data +public class DeviceInfomationPageReqVO extends PageParam { + + @Schema(description = "设备大类id", example = "32101") + private Long productId; + + @Schema(description = "设备名称", example = "张三") + private String productName; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "设备状态", example = "2") + private String deviceStatus; + + @Schema(description = "维修状态") + private String repairFlag; + + @Schema(description = "降级状态") + private String demoteFlag; + + @Schema(description = "报废状态") + private String scrapFlag; + + @Schema(description = "停用状态") + private String disableFlag; + + @Schema(description = "验收状态") + private String acceptanceFlag; + + @Schema(description = "外借状态") + private String lendFlag; + + @Schema(description = "使用中状态") + private String inUseFlag; + + @Schema(description = "等级分类") + private String gradeCategory; + + @Schema(description = "数量") + private String deviceNumber; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "资产编号") + private String assetCode; + + @Schema(description = "出厂编号") + private String factoryCode; + + @Schema(description = "存放位置") + private String position; + + @Schema(description = "购入价格", example = "25826") + private BigDecimal purchasePrice; + + @Schema(description = "采购时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] purchaseDate; + + @Schema(description = "生产时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] productiveDate; + + @Schema(description = "安装日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] deployDate; + + @Schema(description = "安装工程师") + private String deployEngineer; + + @Schema(description = "安装位置") + private String deployLocation; + + @Schema(description = "验收人员id", example = "26830") + private String acceptanceUserId; + + @Schema(description = "验收人员", example = "李四") + private String acceptanceUserName; + + @Schema(description = "负责人ID", example = "1902") + private String managerUserId; + + @Schema(description = "负责人", example = "芋艿") + private String managerUserName; + + @Schema(description = "自定义表单数据") + private String customFormData; + + @Schema(description = "设备图片") + private String photo; + + @Schema(description = "技术指标") + private String deviceParameter; + + @Schema(description = "状态(显示)") + private String stateShow; + + @Schema(description = "状态栈") + private String stateStack; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "是否连接") + private String isConnect; + + @Schema(description = "上次连接时间") + private LocalDateTime[] lastConnectTime; + + @Schema(description = "数据采集设备类型") + private String collectDeviceType; + //===================扩展属性============== + @Schema(description = "大类ids") + List productIds; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java new file mode 100644 index 0000000..44ea0d7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationRespVO.java @@ -0,0 +1,171 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-设备信息 Response VO") +@Data +@ExcelIgnoreUnannotated +public class DeviceInfomationRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32125") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "设备大类id", example = "32101") + @ExcelProperty("设备大类id") + private Long productId; + + @Schema(description = "设备名称", example = "张三") + @ExcelProperty("设备名称") + private String productName; + + @Schema(description = "别名") + @ExcelProperty("别名") + private String alias; + + @Schema(description = "设备状态", example = "2") + @ExcelProperty("设备状态") + private String deviceStatus; + + @Schema(description = "维修状态") + @ExcelProperty("维修状态") + private String repairFlag; + + @Schema(description = "降级状态") + @ExcelProperty("降级状态") + private String demoteFlag; + + @Schema(description = "报废状态") + @ExcelProperty("报废状态") + private String scrapFlag; + + @Schema(description = "停用状态") + @ExcelProperty("停用状态") + private String disableFlag; + + @Schema(description = "验收状态") + @ExcelProperty("验收状态") + private String acceptanceFlag; + + @Schema(description = "外借状态") + @ExcelProperty("外借状态") + private String lendFlag; + + @Schema(description = "使用中状态") + @ExcelProperty("使用中状态") + private String inUseFlag; + + @Schema(description = "等级分类") + @ExcelProperty("等级分类") + private String gradeCategory; + + @Schema(description = "数量") + @ExcelProperty("数量") + private String deviceNumber; + + @Schema(description = "管理编号") + @ExcelProperty("管理编号") + private String deviceCode; + + @Schema(description = "资产编号") + @ExcelProperty("资产编号") + private String assetCode; + + @Schema(description = "出厂编号") + @ExcelProperty("出厂编号") + private String factoryCode; + + @Schema(description = "存放位置") + @ExcelProperty("存放位置") + private String position; + + @Schema(description = "购入价格", example = "25826") + @ExcelProperty("购入价格") + private BigDecimal purchasePrice; + + @Schema(description = "采购时间") + @ExcelProperty("采购时间") + private LocalDateTime purchaseDate; + + @Schema(description = "生产时间") + @ExcelProperty("生产时间") + private LocalDateTime productiveDate; + + @Schema(description = "安装日期") + @ExcelProperty("安装日期") + private LocalDateTime deployDate; + + @Schema(description = "安装工程师") + @ExcelProperty("安装工程师") + private String deployEngineer; + + @Schema(description = "安装位置") + @ExcelProperty("安装位置") + private String deployLocation; + + @Schema(description = "验收人员id", example = "26830") + @ExcelProperty("验收人员id") + private String acceptanceUserId; + + @Schema(description = "验收人员", example = "李四") + @ExcelProperty("验收人员") + private String acceptanceUserName; + + @Schema(description = "负责人ID", example = "1902") + @ExcelProperty("负责人ID") + private String managerUserId; + + @Schema(description = "负责人", example = "芋艿") + @ExcelProperty("负责人") + private String managerUserName; + + @Schema(description = "自定义表单数据") + @ExcelProperty("自定义表单数据") + private String customFormData; + + @Schema(description = "设备图片") + @ExcelProperty("设备图片") + private String photo; + + @Schema(description = "技术指标") + @ExcelProperty("技术指标") + private String deviceParameter; + + @Schema(description = "状态(显示)") + @ExcelProperty("状态(显示)") + private String stateShow; + + @Schema(description = "状态栈") + @ExcelProperty("状态栈") + private String stateStack; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "是否连接") + @ExcelProperty("是否连接") + private String isConnect; + + @Schema(description = "上次连接时间") + @ExcelProperty("上次连接时间") + private LocalDateTime lastConnectTime; + + @Schema(description = "数据采集设备类型") + @ExcelProperty("数据采集设备类型") + private String collectDeviceType; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java new file mode 100644 index 0000000..0b72082 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceInfomationSaveReqVO.java @@ -0,0 +1,128 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +@Schema(description = "管理后台 - 设备-设备信息新增/修改 Request VO") +@Data +public class DeviceInfomationSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32125") + private Long id; + + @Schema(description = "设备大类id", example = "32101") + private Long productId; + + @Schema(description = "设备名称", example = "张三") + private String productName; + + @Schema(description = "别名") + private String alias; + + @Schema(description = "设备状态", example = "2") + private String deviceStatus; + + @Schema(description = "维修状态") + private String repairFlag; + + @Schema(description = "降级状态") + private String demoteFlag; + + @Schema(description = "报废状态") + private String scrapFlag; + + @Schema(description = "停用状态") + private String disableFlag; + + @Schema(description = "验收状态") + private String acceptanceFlag; + + @Schema(description = "外借状态") + private String lendFlag; + + @Schema(description = "使用中状态") + private String inUseFlag; + + @Schema(description = "等级分类") + private String gradeCategory; + + @Schema(description = "数量") + private String deviceNumber; + + @Schema(description = "管理编号") + private String deviceCode; + + @Schema(description = "资产编号") + private String assetCode; + + @Schema(description = "出厂编号") + private String factoryCode; + + @Schema(description = "存放位置") + private String position; + + @Schema(description = "购入价格", example = "25826") + private BigDecimal purchasePrice; + + @Schema(description = "采购时间") + private LocalDateTime purchaseDate; + + @Schema(description = "生产时间") + private LocalDateTime productiveDate; + + @Schema(description = "安装日期") + private LocalDateTime deployDate; + + @Schema(description = "安装工程师") + private String deployEngineer; + + @Schema(description = "安装位置") + private String deployLocation; + + @Schema(description = "验收人员id", example = "26830") + private String acceptanceUserId; + + @Schema(description = "验收人员", example = "李四") + private String acceptanceUserName; + + @Schema(description = "负责人ID", example = "1902") + private String managerUserId; + + @Schema(description = "负责人", example = "芋艿") + private String managerUserName; + + @Schema(description = "自定义表单数据") + private String customFormData; + + @Schema(description = "设备图片") + private String photo; + + @Schema(description = "技术指标") + private String deviceParameter; + + @Schema(description = "状态(显示)") + private String stateShow; + + @Schema(description = "状态栈") + private String stateStack; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "是否连接") + private String isConnect; + + @Schema(description = "上次连接时间") + private LocalDateTime lastConnectTime; + + @Schema(description = "数据采集设备类型") + private String collectDeviceType; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductPageReqVO.java new file mode 100644 index 0000000..2ba24b1 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductPageReqVO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 设备-设备大类分页 Request VO") +@Data +public class DeviceProductPageReqVO extends PageParam { + + @Schema(description = "父ID", example = "5458") + private Long parentId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "节点类型,分类|大类", example = "1") + private String nodeType; + + @Schema(description = "是否叶子节点") + private String leafFlag; + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + private String customForm; + + @Schema(description = "扩展数据值") + private String customData; + + @Schema(description = "标签") + private String tag; + + @Schema(description = "标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "技术指标") + private String parameter; + + @Schema(description = "设备用途") + private String deviceUse; + + @Schema(description = "制造国家") + private String manufacturerNation; + + @Schema(description = "制造商") + private String manufacturer; + + @Schema(description = "排序码") + private Integer sortNo; + + @Schema(description = "禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "数据采集设备类型") + private String collectDeviceType; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductRespVO.java new file mode 100644 index 0000000..1b8baec --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductRespVO.java @@ -0,0 +1,106 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 设备-设备大类 Response VO") +@Data +@ExcelIgnoreUnannotated +public class DeviceProductRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2648") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父ID", example = "5458") + @ExcelProperty("父ID") + private Long parentId; + + @Schema(description = "id路径") + @ExcelProperty("id路径") + private String idPath; + + @Schema(description = "节点类型,分类|大类", example = "1") + @ExcelProperty("节点类型,分类|大类") + private String nodeType; + + @Schema(description = "是否叶子节点") + @ExcelProperty("是否叶子节点") + private String leafFlag; + + @Schema(description = "名称", example = "王五") + @ExcelProperty("名称") + private String name; + + @Schema(description = "其他配置") + @ExcelProperty("其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + @ExcelProperty("自定义表单") + private String customForm; + + @Schema(description = "扩展数据值") + @ExcelProperty("扩展数据值") + private String customData; + + @Schema(description = "标签") + @ExcelProperty("标签") + private String tag; + + @Schema(description = "标签模板") + @ExcelProperty("标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + @ExcelProperty("型号") + private String modelNo; + + @Schema(description = "规格") + @ExcelProperty("规格") + private String specification; + + @Schema(description = "技术指标") + @ExcelProperty("技术指标") + private String parameter; + + @Schema(description = "设备用途") + @ExcelProperty("设备用途") + private String deviceUse; + + @Schema(description = "制造国家") + @ExcelProperty("制造国家") + private String manufacturerNation; + + @Schema(description = "制造商") + @ExcelProperty("制造商") + private String manufacturer; + + @Schema(description = "排序码") + @ExcelProperty("排序码") + private Integer sortNo; + + @Schema(description = "禁用标识") + @ExcelProperty("禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "数据采集设备类型") + @ExcelProperty("数据采集设备类型") + private String collectDeviceType; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductSaveReqVO.java new file mode 100644 index 0000000..98562a2 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/vo/DeviceProductSaveReqVO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.resource.device.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 设备-设备大类新增/修改 Request VO") +@Data +public class DeviceProductSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2648") + private Long id; + + @Schema(description = "父ID", example = "5458") + private Long parentId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "节点类型,分类|大类", example = "1") + private String nodeType; + + @Schema(description = "是否叶子节点") + private String leafFlag; + + @Schema(description = "名称", example = "王五") + private String name; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + private String customForm; + + @Schema(description = "扩展数据值") + private String customData; + + @Schema(description = "标签") + private String tag; + + @Schema(description = "标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "技术指标") + private String parameter; + + @Schema(description = "设备用途") + private String deviceUse; + + @Schema(description = "制造国家") + private String manufacturerNation; + + @Schema(description = "制造商") + private String manufacturer; + + @Schema(description = "排序码") + private Integer sortNo; + + @Schema(description = "禁用标识") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "数据采集设备类型") + private String collectDeviceType; +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java new file mode 100644 index 0000000..8c5895c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceInfomationDO.java @@ -0,0 +1,218 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import com.baomidou.mybatisplus.annotation.*; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** +* 设备-设备信息 DO +* +* @author 后台管理 +*/ +@TableName("t_dev_inf") +@KeySequence("t_dev_inf_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceInfomationDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 设备大类id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 设备名称 + */ + @TableField("PDT_NAME") + private String productName; + /** + * 别名 + */ + @TableField("ALS") + private String alias; + /** + * 设备状态 + */ + @TableField("DEV_STS") + private String deviceStatus; + /** + * 维修状态 + */ + @TableField("RPR_FLG") + private String repairFlag; + /** + * 降级状态 + */ + @TableField("DMOT_FLG") + private String demoteFlag; + /** + * 报废状态 + */ + @TableField("SCR_FLG") + private String scrapFlag; + /** + * 停用状态 + */ + @TableField("DSBL_FLG") + private String disableFlag; + /** + * 验收状态 + */ + @TableField("ACPT_FLG") + private String acceptanceFlag; + /** + * 外借状态 + */ + @TableField("LND_FLG") + private String lendFlag; + /** + * 使用中状态 + */ + @TableField("IN_USE_FLG") + private String inUseFlag; + /** + * 等级分类 + */ + @TableField("GRD_CTGR") + private String gradeCategory; + /** + * 数量 + */ + @TableField("DEV_NUM") + private String deviceNumber; + /** + * 管理编号 + */ + @TableField("DEV_CD") + private String deviceCode; + /** + * 资产编号 + */ + @TableField("AST_CD") + private String assetCode; + /** + * 出厂编号 + */ + @TableField("FACT_CD") + private String factoryCode; + /** + * 存放位置 + */ + @TableField("POS") + private String position; + /** + * 购入价格 + */ + @TableField("PRCH_PRC") + private BigDecimal purchasePrice; + /** + * 采购时间 + */ + @TableField("PRCH_DT") + private LocalDateTime purchaseDate; + /** + * 生产时间 + */ + @TableField("PDTV_DT") + private LocalDateTime productiveDate; + /** + * 安装日期 + */ + @TableField("DPLY_DT") + private LocalDateTime deployDate; + /** + * 安装工程师 + */ + @TableField("DPLY_ENGR") + private String deployEngineer; + /** + * 安装位置 + */ + @TableField("DPLY_LOC") + private String deployLocation; + /** + * 验收人员id + */ + @TableField("ACPT_USER_ID") + private String acceptanceUserId; + /** + * 验收人员 + */ + @TableField("ACPT_USER_NAME") + private String acceptanceUserName; + /** + * 负责人ID + */ + @TableField("MNGR_USER_ID") + private String managerUserId; + /** + * 负责人 + */ + @TableField("MNGR_USER_NAME") + private String managerUserName; + /** + * 自定义表单数据 + */ + @TableField("CST_FORM_DAT") + private String customFormData; + /** + * 设备图片 + */ + @TableField("PHTO") + private String photo; + /** + * 技术指标 + */ + @TableField("DEV_PRM") + private String deviceParameter; + /** + * 状态(显示) + */ + @TableField("STA_SHW") + private String stateShow; + /** + * 状态栈 + */ + @TableField("STA_STK") + private String stateStack; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + @TableField("IS_CONN") + private String isConnect; + + @TableField("LST_CONN_TM") + private LocalDateTime lastConnectTime; + + @TableField("COLT_DEV_TP") + private String collectDeviceType; + + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceProductDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceProductDO.java new file mode 100644 index 0000000..b88f063 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/dataobject/DeviceProductDO.java @@ -0,0 +1,136 @@ +package com.zt.plat.module.qms.resource.device.dal.dataobject; + +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import com.baomidou.mybatisplus.annotation.*; +import lombok.*; +/** +* 设备-设备大类 DO +* +* @author 后台管理 +*/ +@TableName("t_dev_pdt") +@KeySequence("t_dev_pdt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class DeviceProductDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父ID + */ + @TableField("PRN_ID") + private Long parentId; + /** + * id路径 + */ + @TableField("ID_PATH") + private String idPath; + /** + * 节点类型,分类|大类 + */ + @TableField("NDE_TP") + private String nodeType; + /** + * 是否叶子节点 + */ + @TableField("LEAF_FLG") + private String leafFlag; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + /** + * 自定义表单 + */ + @TableField("CST_FORM") + private String customForm; + /** + * 扩展数据值 + */ + @TableField("CST_DAT") + private String customData; + /** + * 标签 + */ + @TableField("TAG") + private String tag; + /** + * 标签模板 + */ + @TableField("LBL_TMPL_KY") + private String labelTemplateKey; + /** + * 型号 + */ + @TableField("MDL_NO") + private String modelNo; + /** + * 规格 + */ + @TableField("SPEC") + private String specification; + /** + * 技术指标 + */ + @TableField("PRM") + private String parameter; + /** + * 设备用途 + */ + @TableField("DEV_USE") + private String deviceUse; + /** + * 制造国家 + */ + @TableField("MFR_NTN") + private String manufacturerNation; + /** + * 制造商 + */ + @TableField("MFR") + private String manufacturer; + /** + * 排序码 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 禁用标识 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + + @TableField("COLT_DEV_TP") + private String collectDeviceType; + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java new file mode 100644 index 0000000..b67c198 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceInfomationMapper.java @@ -0,0 +1,59 @@ +package com.zt.plat.module.qms.resource.device.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-设备信息 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface DeviceInfomationMapper extends BaseMapperX { + + default PageResult selectPage(DeviceInfomationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductId()) + .inIfPresent(DeviceInfomationDO::getProductId, reqVO.getProductIds()) + .likeIfPresent(DeviceInfomationDO::getProductName, reqVO.getProductName()) + .eqIfPresent(DeviceInfomationDO::getAlias, reqVO.getAlias()) + .eqIfPresent(DeviceInfomationDO::getDeviceStatus, reqVO.getDeviceStatus()) + .eqIfPresent(DeviceInfomationDO::getRepairFlag, reqVO.getRepairFlag()) + .eqIfPresent(DeviceInfomationDO::getDemoteFlag, reqVO.getDemoteFlag()) + .eqIfPresent(DeviceInfomationDO::getScrapFlag, reqVO.getScrapFlag()) + .eqIfPresent(DeviceInfomationDO::getDisableFlag, reqVO.getDisableFlag()) + .eqIfPresent(DeviceInfomationDO::getAcceptanceFlag, reqVO.getAcceptanceFlag()) + .eqIfPresent(DeviceInfomationDO::getLendFlag, reqVO.getLendFlag()) + .eqIfPresent(DeviceInfomationDO::getInUseFlag, reqVO.getInUseFlag()) + .eqIfPresent(DeviceInfomationDO::getGradeCategory, reqVO.getGradeCategory()) + .eqIfPresent(DeviceInfomationDO::getDeviceNumber, reqVO.getDeviceNumber()) + .eqIfPresent(DeviceInfomationDO::getDeviceCode, reqVO.getDeviceCode()) + .eqIfPresent(DeviceInfomationDO::getAssetCode, reqVO.getAssetCode()) + .eqIfPresent(DeviceInfomationDO::getFactoryCode, reqVO.getFactoryCode()) + .eqIfPresent(DeviceInfomationDO::getPosition, reqVO.getPosition()) + .eqIfPresent(DeviceInfomationDO::getPurchasePrice, reqVO.getPurchasePrice()) + .betweenIfPresent(DeviceInfomationDO::getPurchaseDate, reqVO.getPurchaseDate()) + .betweenIfPresent(DeviceInfomationDO::getProductiveDate, reqVO.getProductiveDate()) + .betweenIfPresent(DeviceInfomationDO::getDeployDate, reqVO.getDeployDate()) + .eqIfPresent(DeviceInfomationDO::getDeployEngineer, reqVO.getDeployEngineer()) + .eqIfPresent(DeviceInfomationDO::getDeployLocation, reqVO.getDeployLocation()) + .eqIfPresent(DeviceInfomationDO::getAcceptanceUserId, reqVO.getAcceptanceUserId()) + .likeIfPresent(DeviceInfomationDO::getAcceptanceUserName, reqVO.getAcceptanceUserName()) + .eqIfPresent(DeviceInfomationDO::getManagerUserId, reqVO.getManagerUserId()) + .likeIfPresent(DeviceInfomationDO::getManagerUserName, reqVO.getManagerUserName()) + .eqIfPresent(DeviceInfomationDO::getCustomFormData, reqVO.getCustomFormData()) + .eqIfPresent(DeviceInfomationDO::getPhoto, reqVO.getPhoto()) + .eqIfPresent(DeviceInfomationDO::getDeviceParameter, reqVO.getDeviceParameter()) + .eqIfPresent(DeviceInfomationDO::getStateShow, reqVO.getStateShow()) + .eqIfPresent(DeviceInfomationDO::getStateStack, reqVO.getStateStack()) + .eqIfPresent(DeviceInfomationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceInfomationDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceInfomationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceInfomationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java new file mode 100644 index 0000000..fd64a7c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/dal/mapper/DeviceProductMapper.java @@ -0,0 +1,45 @@ +package com.zt.plat.module.qms.resource.device.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备-设备大类 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface DeviceProductMapper extends BaseMapperX { + + default PageResult selectPage(DeviceProductPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(DeviceProductDO::getParentId, reqVO.getParentId()) + .likeIfPresent(DeviceProductDO::getIdPath, reqVO.getIdPath()) + .eqIfPresent(DeviceProductDO::getNodeType, reqVO.getNodeType()) + .eqIfPresent(DeviceProductDO::getLeafFlag, reqVO.getLeafFlag()) + .likeIfPresent(DeviceProductDO::getName, reqVO.getName()) + .eqIfPresent(DeviceProductDO::getCustomConfig, reqVO.getCustomConfig()) + .eqIfPresent(DeviceProductDO::getCustomForm, reqVO.getCustomForm()) + .eqIfPresent(DeviceProductDO::getCustomData, reqVO.getCustomData()) + .eqIfPresent(DeviceProductDO::getTag, reqVO.getTag()) + .eqIfPresent(DeviceProductDO::getLabelTemplateKey, reqVO.getLabelTemplateKey()) + .eqIfPresent(DeviceProductDO::getModelNo, reqVO.getModelNo()) + .eqIfPresent(DeviceProductDO::getSpecification, reqVO.getSpecification()) + .eqIfPresent(DeviceProductDO::getParameter, reqVO.getParameter()) + .eqIfPresent(DeviceProductDO::getDeviceUse, reqVO.getDeviceUse()) + .eqIfPresent(DeviceProductDO::getManufacturerNation, reqVO.getManufacturerNation()) + .eqIfPresent(DeviceProductDO::getManufacturer, reqVO.getManufacturer()) + .eqIfPresent(DeviceProductDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(DeviceProductDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(DeviceProductDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(DeviceProductDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(DeviceProductDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(DeviceProductDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java new file mode 100644 index 0000000..5adbbf7 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationService.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.resource.device.service; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 设备-设备信息 Service 接口 + * + * @author 后台管理 + */ +public interface DeviceInfomationService { + + /** + * 创建设备-设备信息 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceInfomationRespVO createDeviceInfomation(@Valid DeviceInfomationSaveReqVO createReqVO); + + /** + * 更新设备-设备信息 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceInfomation(@Valid DeviceInfomationSaveReqVO updateReqVO); + void updateDeviceInfomation(DeviceInfomationDO entity); + + /** + * 删除设备-设备信息 + * + * @param id 编号 + */ + void deleteDeviceInfomation(Long id); + + /** + * 批量删除设备-设备信息 + * + * @param ids 编号 + */ + void deleteDeviceInfomationListByIds(List ids); + + /** + * 获得设备-设备信息 + * + * @param id 编号 + * @return 设备-设备信息 + */ + DeviceInfomationDO getDeviceInfomation(Long id); + + /** + * 获得设备-设备信息分页 + * + * @param pageReqVO 分页查询 + * @return 设备-设备信息分页 + */ + PageResult getDeviceInfomationPage(DeviceInfomationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java new file mode 100644 index 0000000..eb8da8e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceInfomationServiceImpl.java @@ -0,0 +1,95 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO; +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceInfomationMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_INFOMATION_NOT_EXISTS; + + +/** + * 设备-设备信息 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class DeviceInfomationServiceImpl implements DeviceInfomationService { + + @Resource + private DeviceInfomationMapper deviceInfomationMapper; + + @Override + public DeviceInfomationRespVO createDeviceInfomation(DeviceInfomationSaveReqVO createReqVO) { + // 插入 + DeviceInfomationDO deviceInfomation = BeanUtils.toBean(createReqVO, DeviceInfomationDO.class); + deviceInfomationMapper.insert(deviceInfomation); + // 返回 + return BeanUtils.toBean(deviceInfomation, DeviceInfomationRespVO.class); + } + + @Override + public void updateDeviceInfomation(DeviceInfomationSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceInfomationExists(updateReqVO.getId()); + // 更新 + DeviceInfomationDO updateObj = BeanUtils.toBean(updateReqVO, DeviceInfomationDO.class); + deviceInfomationMapper.updateById(updateObj); + } + + @Override + public void updateDeviceInfomation(DeviceInfomationDO entity) { + deviceInfomationMapper.updateById(entity); + } + + @Override + public void deleteDeviceInfomation(Long id) { + // 校验存在 + validateDeviceInfomationExists(id); + // 删除 + deviceInfomationMapper.deleteById(id); + } + + @Override + public void deleteDeviceInfomationListByIds(List ids) { + // 校验存在 + validateDeviceInfomationExists(ids); + // 删除 + deviceInfomationMapper.deleteByIds(ids); + } + + private void validateDeviceInfomationExists(List ids) { + List list = deviceInfomationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_INFOMATION_NOT_EXISTS); + } + } + + private void validateDeviceInfomationExists(Long id) { + if (deviceInfomationMapper.selectById(id) == null) { + throw exception(DEVICE_INFOMATION_NOT_EXISTS); + } + } + + @Override + public DeviceInfomationDO getDeviceInfomation(Long id) { + return deviceInfomationMapper.selectById(id); + } + + @Override + public PageResult getDeviceInfomationPage(DeviceInfomationPageReqVO pageReqVO) { + return deviceInfomationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java new file mode 100644 index 0000000..6f716b5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductService.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.resource.device.service; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 设备-设备大类 Service 接口 + * + * @author 后台管理 + */ +public interface DeviceProductService { + + //保存分类 + CommonResult saveCategory(@Valid DeviceProductSaveReqVO createReqVO); + + //保存数据 + CommonResult saveData(@Valid DeviceProductSaveReqVO createReqVO); + + /*获取分类树数据*/ + List getTreeData(String nodeType); + + List listByIdPath(Long id, String nodeType); + List listByParId(Long parId, String nodeType); + + CommonResult updateAllIdPath(Long parentId, Integer level); + + /** + * 创建设备-设备大类 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + DeviceProductRespVO createDeviceProduct(@Valid DeviceProductSaveReqVO createReqVO); + + /** + * 更新设备-设备大类 + * + * @param updateReqVO 更新信息 + */ + void updateDeviceProduct(@Valid DeviceProductSaveReqVO updateReqVO); + + /** + * 删除设备-设备大类 + * + * @param id 编号 + */ + void deleteDeviceProduct(Long id); + + /** + * 批量删除设备-设备大类 + * + * @param ids 编号 + */ + void deleteDeviceProductListByIds(List ids); + + /** + * 获得设备-设备大类 + * + * @param id 编号 + * @return 设备-设备大类 + */ + DeviceProductDO getDeviceProduct(Long id); + + /** + * 获得设备-设备大类分页 + * + * @param pageReqVO 分页查询 + * @return 设备-设备大类分页 + */ + PageResult getDeviceProductPage(DeviceProductPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java new file mode 100644 index 0000000..01d5dbe --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/service/DeviceProductServiceImpl.java @@ -0,0 +1,217 @@ +package com.zt.plat.module.qms.resource.device.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.enums.ErrorCodeConstants; +import com.zt.plat.module.qms.resource.device.controller.vo.*; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductPageReqVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductRespVO; +import com.zt.plat.module.qms.resource.device.controller.vo.DeviceProductSaveReqVO; +import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceProductDO; +import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceProductMapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 设备-设备大类 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class DeviceProductServiceImpl implements DeviceProductService { + + private int id_path_update_level_limit = 7; + + @Resource + private DeviceProductMapper deviceProductMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult saveCategory(DeviceProductSaveReqVO entity) { + if(entity.getParentId() == null || entity.getParentId() == 0L) + entity.setParentId(0L); + Long parentId = entity.getParentId(); + List checkList = listByParId(parentId, DataTypeConstant.DATA_TYPE_CATEGORY); + boolean duplicate = false; + DeviceProductDO duplicateEntity = checkList.stream().filter(e->e.getName().equals(entity.getName())).findFirst().orElse(null); + if(duplicateEntity != null && !duplicateEntity.getId().equals(entity.getId())) + duplicate = true; + if(duplicate) + throw exception(ErrorCodeConstants.DICTIONARY_BUSINESS_CLASSIFY_DUPLICATE); + entity.setNodeType(DataTypeConstant.DATA_TYPE_CATEGORY); + Long id = entity.getId(); + DeviceProductDO dic = BeanUtils.toBean(entity, DeviceProductDO.class); + if(ObjectUtils.isEmpty(id)){ + deviceProductMapper.insert(dic); + id = dic.getId(); + } + DeviceProductDO backData = this.getDeviceProduct(id); + Long parentId_ = backData.getParentId(); + //检查parId,避免父节点设置为本节点的后代节点 + if(parentId_.equals(id)) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + String idPath = getIdPath(dic); + int curIdIndex = idPath.indexOf("/" + id.toString() + "/"); + int parIdIndex = idPath.indexOf("/" + parentId.toString() + "/"); + if(curIdIndex <= parIdIndex) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + dic.setIdPath(idPath); + + //更新后代节点路径 + updateAllIdPath(id, 1); + deviceProductMapper.updateById(dic); + return CommonResult.success(BeanUtils.toBean(dic, DeviceProductRespVO.class)); + } + + @Override + public CommonResult saveData(DeviceProductSaveReqVO createReqVO) { + Long id = createReqVO.getId(); + DeviceProductDO entity = BeanUtils.toBean(createReqVO, DeviceProductDO.class); + entity.setNodeType(DataTypeConstant.DATA_TYPE_DATA); + Long parentId = createReqVO.getParentId(); + if(id == null){ + deviceProductMapper.insert(entity); + }else{ + deviceProductMapper.updateById(entity); + } + if(parentId != null && parentId != 0L){ + DeviceProductDO parEntity = this.getDeviceProduct(parentId); + String parPath = parEntity.getIdPath(); + entity.setIdPath(parPath + "/" + entity.getId() + "/"); + deviceProductMapper.updateById(entity); + } + DeviceProductRespVO vo = BeanUtils.toBean(entity, DeviceProductRespVO.class); + return CommonResult.success( vo); + } + + @Override + public List listByIdPath(Long id, String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.like(DeviceProductDO::getIdPath, id); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(DeviceProductDO::getNodeType, nodeType); + query.orderByAsc(DeviceProductDO::getSortNo); + return deviceProductMapper.selectList(query); + } + + @Override + public List listByParId(Long parId, String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(DeviceProductDO::getParentId, parId); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(DeviceProductDO::getNodeType, nodeType); + query.orderByAsc(DeviceProductDO::getSortNo); + return deviceProductMapper.selectList(query); + } + + @Override + public CommonResult updateAllIdPath(Long parentId, Integer level) { + if(level > id_path_update_level_limit) + return CommonResult.success("更新完成(超出层数限制:"+id_path_update_level_limit+")"); + List list = listByParId(parentId, ""); + DeviceProductDO parEntity = this.getDeviceProduct(parentId); + if(list.isEmpty()) + return CommonResult.success(""); + String parIdPath = "/0/"; + if(parEntity != null) + parIdPath = parEntity.getIdPath(); + for(DeviceProductDO entity : list){ + entity.setIdPath(parIdPath + "/" + entity.getId() + "/"); + deviceProductMapper.updateById( entity); + updateAllIdPath(entity.getId(),level+1); + } + return CommonResult.success(""); + } + + @Override + public List getTreeData(String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(DeviceProductDO::getNodeType, nodeType); + query.orderByAsc(DeviceProductDO::getSortNo); + return deviceProductMapper.selectList(query); + } + + @Override + public DeviceProductRespVO createDeviceProduct(DeviceProductSaveReqVO createReqVO) { + // 插入 + DeviceProductDO deviceProduct = BeanUtils.toBean(createReqVO, DeviceProductDO.class); + deviceProductMapper.insert(deviceProduct); + // 返回 + return BeanUtils.toBean(deviceProduct, DeviceProductRespVO.class); + } + + @Override + public void updateDeviceProduct(DeviceProductSaveReqVO updateReqVO) { + // 校验存在 + validateDeviceProductExists(updateReqVO.getId()); + // 更新 + DeviceProductDO updateObj = BeanUtils.toBean(updateReqVO, DeviceProductDO.class); + deviceProductMapper.updateById(updateObj); + } + + @Override + public void deleteDeviceProduct(Long id) { + // 校验存在 + validateDeviceProductExists(id); + // 删除 + deviceProductMapper.deleteById(id); + } + + @Override + public void deleteDeviceProductListByIds(List ids) { + // 校验存在 + validateDeviceProductExists(ids); + // 删除 + deviceProductMapper.deleteByIds(ids); + } + + private void validateDeviceProductExists(List ids) { + List list = deviceProductMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(DEVICE_PRODUCT_NOT_EXISTS); + } + } + + private void validateDeviceProductExists(Long id) { + if (deviceProductMapper.selectById(id) == null) { + throw exception(DEVICE_PRODUCT_NOT_EXISTS); + } + } + + @Override + public DeviceProductDO getDeviceProduct(Long id) { + return deviceProductMapper.selectById(id); + } + + @Override + public PageResult getDeviceProductPage(DeviceProductPageReqVO pageReqVO) { + return deviceProductMapper.selectPage(pageReqVO); + } + + private String getIdPath(DeviceProductDO entity){ + String parIdPath = ""; + if(ObjectUtils.isEmpty(entity.getParentId()) || 0L == entity.getParentId()) + parIdPath = "/0/"; + DeviceProductDO parEntity = this.getDeviceProduct(entity.getParentId()); + if(parEntity != null){ + parIdPath = parEntity.getIdPath(); + } + return parIdPath + entity.getId() + "/"; + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java new file mode 100644 index 0000000..39e61b6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialInfomationController.java @@ -0,0 +1,127 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.service.MaterialInfomationService; +import com.zt.plat.module.qms.resource.material.service.MaterialProductService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 物料实例") +@RestController +@RequestMapping("/qms/resource/material-infomation") +@Validated +@FileUploadController(source = "resource.materialinfomation") +public class MaterialInfomationController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialInfomationController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource private MaterialInfomationService materialInfomationService; + @Resource private MaterialProductService materialProductService; + + @PostMapping("/create") + @Operation(summary = "创建物料实例") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:create')") + public CommonResult createMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqVO createReqVO) { + return success(materialInfomationService.createMaterialInfomation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料实例") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:update')") + public CommonResult updateMaterialInfomation(@Valid @RequestBody MaterialInfomationSaveReqVO updateReqVO) { + materialInfomationService.updateMaterialInfomation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料实例") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('resource:material-infomation:delete')") + public CommonResult deleteMaterialInfomation(@RequestParam("id") Long id) { + materialInfomationService.deleteMaterialInfomation(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料实例") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:delete')") + public CommonResult deleteMaterialInfomationList(@RequestBody BatchDeleteReqVO req) { + materialInfomationService.deleteMaterialInfomationListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料实例") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:query')") + public CommonResult getMaterialInfomation(@RequestParam("id") Long id) { + MaterialInfomationDO materialInfomation = materialInfomationService.getMaterialInfomation(id); + return success(BeanUtils.toBean(materialInfomation, MaterialInfomationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料实例分页") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:query')") + public CommonResult> getMaterialInfomationPage(@Valid MaterialInfomationPageReqVO pageReqVO) { + + Long productId = pageReqVO.getProductId(); + if(productId != null){ + List productDOList = materialProductService.listByIdPath(productId, DataTypeConstant.DATA_TYPE_DATA); + List productIds = productDOList.stream().map(MaterialProductDO::getId).toList(); + pageReqVO.setProductIds(productIds); + pageReqVO.setProductId(null); + } + + PageResult pageResult = materialInfomationService.getMaterialInfomationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialInfomationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料实例 Excel") + @PreAuthorize("@ss.hasPermission('resource:material-infomation:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialInfomationExcel(@Valid MaterialInfomationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialInfomationService.getMaterialInfomationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料实例.xls", "数据", MaterialInfomationRespVO.class, + BeanUtils.toBean(list, MaterialInfomationRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java new file mode 100644 index 0000000..13bcbab --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/admin/MaterialProductController.java @@ -0,0 +1,142 @@ +package com.zt.plat.module.qms.resource.material.controller.admin; + +import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; +import com.zt.plat.framework.business.annotation.FileUploadController; +import com.zt.plat.framework.business.controller.AbstractFileUploadController; +import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageParam; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.framework.excel.core.util.ExcelUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.service.MaterialProductService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; +import java.util.List; + +import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import static com.zt.plat.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 物料大类") +@RestController +@RequestMapping("/qms/resource/material-product") +@Validated +@FileUploadController(source = "resource.materialproduct") +public class MaterialProductController extends AbstractFileUploadController implements BusinessControllerMarker{ + + static { + FileUploadController annotation = MaterialProductController.class.getAnnotation(FileUploadController.class); + if (annotation != null) { + setFileUploadInfo(annotation); + } + } + + @Resource + private MaterialProductService materialProductService; + + @PostMapping("/saveData") + @Operation(summary = "保存数据") + public CommonResult saveData(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) { + return materialProductService.saveData(createReqVO); + } + + @PostMapping("/saveClassify") + @Operation(summary = "保存分类") + public CommonResult saveClassify(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) { + return materialProductService.saveCategory(createReqVO); + } + + @GetMapping("/getTreeData") + @Operation(summary = "查询分类树") + public CommonResult> getTreeData() { + List list = materialProductService.getTreeData(DataTypeConstant.DATA_TYPE_CATEGORY); + return success(BeanUtils.toBean(list, MaterialProductRespVO.class)); + } + + @GetMapping("/getProductTreeData") + @Operation(summary = "获取分类和产品树") + public CommonResult> getProductTreeData() { + List list = materialProductService.getTreeData(""); + return success(BeanUtils.toBean(list, MaterialProductRespVO.class)); + } + + @PostMapping("/create") + @Operation(summary = "创建物料大类") + @PreAuthorize("@ss.hasPermission('resource:material-product:create')") + public CommonResult createMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO createReqVO) { + return success(materialProductService.createMaterialProduct(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料大类") + @PreAuthorize("@ss.hasPermission('resource:material-product:update')") + public CommonResult updateMaterialProduct(@Valid @RequestBody MaterialProductSaveReqVO updateReqVO) { + materialProductService.updateMaterialProduct(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料大类") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('resource:material-product:delete')") + public CommonResult deleteMaterialProduct(@RequestParam("id") Long id) { + materialProductService.deleteMaterialProduct(id); + return success(true); + } + + @DeleteMapping("/delete-list") + @Parameter(name = "ids", description = "编号", required = true) + @Operation(summary = "批量删除物料大类") + @PreAuthorize("@ss.hasPermission('resource:material-product:delete')") + public CommonResult deleteMaterialProductList(@RequestBody BatchDeleteReqVO req) { + materialProductService.deleteMaterialProductListByIds(req.getIds()); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料大类") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('resource:material-product:query')") + public CommonResult getMaterialProduct(@RequestParam("id") Long id) { + MaterialProductDO materialProduct = materialProductService.getMaterialProduct(id); + return success(BeanUtils.toBean(materialProduct, MaterialProductRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料大类分页") + @PreAuthorize("@ss.hasPermission('resource:material-product:query')") + public CommonResult> getMaterialProductPage(@Valid MaterialProductPageReqVO pageReqVO) { + PageResult pageResult = materialProductService.getMaterialProductPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialProductRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料大类 Excel") + @PreAuthorize("@ss.hasPermission('resource:material-product:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportMaterialProductExcel(@Valid MaterialProductPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialProductService.getMaterialProductPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料大类.xls", "数据", MaterialProductRespVO.class, + BeanUtils.toBean(list, MaterialProductRespVO.class)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java new file mode 100644 index 0000000..5ed177c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationPageReqVO.java @@ -0,0 +1,82 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.List; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料实例分页 Request VO") +@Data +public class MaterialInfomationPageReqVO extends PageParam { + + @Schema(description = "物料大类id", example = "23383") + private Long productId; + + @Schema(description = "批次id", example = "30468") + private Long batchId; + + @Schema(description = "存放位置", example = "10632") + private String locationId; + + @Schema(description = "编码") + private String code; + + @Schema(description = "技术参数") + private String parameter; + + @Schema(description = "负责人id", example = "10411") + private Long managerUserId; + + @Schema(description = "负责人", example = "张三") + private String managerUserName; + + @Schema(description = "上架状态,0-未上架;1-已上架,默认0", example = "2") + private String publishStatus; + + @Schema(description = "领用状态", example = "1") + private String usageStatus; + + @Schema(description = "开封状态", example = "1") + private String openStatus; + + @Schema(description = "开封人", example = "李四") + private String openUserName; + + @Schema(description = "开封人id", example = "3244") + private Long openUserId; + + @Schema(description = "开封日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] openDate; + + @Schema(description = "到期日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] expirationDate; + + @Schema(description = "过期状态") + private String expirationFlag; + + @Schema(description = "剩余量") + private String remainingVolume; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + //===================扩展属性============== + @Schema(description = "大类ids") + List productIds; + + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java new file mode 100644 index 0000000..44f73a6 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationRespVO.java @@ -0,0 +1,100 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料实例 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialInfomationRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25067") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "物料大类id", example = "23383") + @ExcelProperty("物料大类id") + private Long productId; + + @Schema(description = "批次id", example = "30468") + @ExcelProperty("批次id") + private Long batchId; + + @Schema(description = "存放位置", example = "10632") + @ExcelProperty("存放位置") + private String locationId; + + @Schema(description = "编码") + @ExcelProperty("编码") + private String code; + + @Schema(description = "技术参数") + @ExcelProperty("技术参数") + private String parameter; + + @Schema(description = "负责人id", example = "10411") + @ExcelProperty("负责人id") + private Long managerUserId; + + @Schema(description = "负责人", example = "张三") + @ExcelProperty("负责人") + private String managerUserName; + + @Schema(description = "上架状态,0-未上架;1-已上架,默认0", example = "2") + @ExcelProperty("上架状态,0-未上架;1-已上架,默认0") + @Dict(dicCode = "yes_or_no") + private String publishStatus; + + @Schema(description = "领用状态", example = "1") + @ExcelProperty("领用状态") + @Dict(dicCode = "yes_or_no") + private String usageStatus; + + @Schema(description = "开封状态", example = "1") + @ExcelProperty("开封状态") + @Dict(dicCode = "yes_or_no") + private String openStatus; + + @Schema(description = "开封人", example = "李四") + @ExcelProperty("开封人") + private String openUserName; + + @Schema(description = "开封人id", example = "3244") + @ExcelProperty("开封人id") + private Long openUserId; + + @Schema(description = "开封日期") + @ExcelProperty("开封日期") + private LocalDateTime openDate; + + @Schema(description = "到期日期") + @ExcelProperty("到期日期") + private LocalDateTime expirationDate; + + @Schema(description = "过期状态") + @ExcelProperty("过期状态") + @Dict(dicCode = "yes_or_no") + private String expirationFlag; + + @Schema(description = "剩余量") + @ExcelProperty("剩余量") + private String remainingVolume; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationSaveReqVO.java new file mode 100644 index 0000000..f2966db --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialInfomationSaveReqVO.java @@ -0,0 +1,69 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料实例新增/修改 Request VO") +@Data +public class MaterialInfomationSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25067") + private Long id; + + @Schema(description = "物料大类id", example = "23383") + private Long productId; + + @Schema(description = "批次id", example = "30468") + private Long batchId; + + @Schema(description = "存放位置", example = "10632") + private String locationId; + + @Schema(description = "编码") + private String code; + + @Schema(description = "技术参数") + private String parameter; + + @Schema(description = "负责人id", example = "10411") + private Long managerUserId; + + @Schema(description = "负责人", example = "张三") + private String managerUserName; + + @Schema(description = "上架状态,0-未上架;1-已上架,默认0", example = "2") + private String publishStatus; + + @Schema(description = "领用状态", example = "1") + private String usageStatus; + + @Schema(description = "开封状态", example = "1") + private String openStatus; + + @Schema(description = "开封人", example = "李四") + private String openUserName; + + @Schema(description = "开封人id", example = "3244") + private Long openUserId; + + @Schema(description = "开封日期") + private LocalDateTime openDate; + + @Schema(description = "到期日期") + private LocalDateTime expirationDate; + + @Schema(description = "过期状态") + private String expirationFlag; + + @Schema(description = "剩余量") + private String remainingVolume; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductPageReqVO.java new file mode 100644 index 0000000..4a901a3 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductPageReqVO.java @@ -0,0 +1,98 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.zt.plat.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料大类分页 Request VO") +@Data +public class MaterialProductPageReqVO extends PageParam { + + @Schema(description = "父id", example = "6098") + private Long parentId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "节点类型,分类|产品", example = "2") + private String nodeType; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + private String customForm; + + @Schema(description = "扩展数据") + private String customData; + + @Schema(description = "标签") + private String tag; + + @Schema(description = "标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "技术参数") + private String parameter; + + @Schema(description = "制造商") + private String manufacturer; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "允许按量领取") + private String enablePartial; + + @Schema(description = "保质期(天)") + private Integer due; + + @Schema(description = "开封后保质期是否变化") + private String openDueFlag; + + @Schema(description = "开封后保质期(天)") + private Integer openDueAfter; + + @Schema(description = "是否危险品") + private String hazardous; + + @Schema(description = "是否标准溶液") + private String standardSolutionFlag; + + @Schema(description = "是否标准物质") + private String standardMaterialFlag; + + @Schema(description = "复标周期,单位:天。小于等于0-不复标") + private Integer reviewDue; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "禁用") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductRespVO.java new file mode 100644 index 0000000..dc51e5e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductRespVO.java @@ -0,0 +1,133 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import com.zt.plat.module.qms.core.aspect.annotation.Dict; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料大类 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialProductRespVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32133") + @ExcelProperty("主键") + private Long id; + + @Schema(description = "父id", example = "6098") + @ExcelProperty("父id") + private Long parentId; + + @Schema(description = "id路径") + @ExcelProperty("id路径") + private String idPath; + + @Schema(description = "节点类型,分类|产品", example = "2") + @ExcelProperty("节点类型,分类|产品") + private String nodeType; + + @Schema(description = "名称", example = "张三") + @ExcelProperty("名称") + private String name; + + @Schema(description = "其他配置") + @ExcelProperty("其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + @ExcelProperty("自定义表单") + private String customForm; + + @Schema(description = "扩展数据") + @ExcelProperty("扩展数据") + private String customData; + + @Schema(description = "标签") + @ExcelProperty("标签") + private String tag; + + @Schema(description = "标签模板") + @ExcelProperty("标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + @ExcelProperty("型号") + private String modelNo; + + @Schema(description = "规格") + @ExcelProperty("规格") + private String specification; + + @Schema(description = "技术参数") + @ExcelProperty("技术参数") + private String parameter; + + @Schema(description = "制造商") + @ExcelProperty("制造商") + private String manufacturer; + + @Schema(description = "单位") + @ExcelProperty("单位") + private String unit; + + @Schema(description = "允许按量领取") + @ExcelProperty("允许按量领取") + @Dict(dicCode = "yes_or_no") + private String enablePartial; + + @Schema(description = "保质期(天)") + @ExcelProperty("保质期(天)") + private Integer due; + + @Schema(description = "开封后保质期是否变化") + @ExcelProperty("开封后保质期是否变化") + @Dict(dicCode = "yes_or_no") + private String openDueFlag; + + @Schema(description = "开封后保质期(天)") + @ExcelProperty("开封后保质期(天)") + private Integer openDueAfter; + + @Schema(description = "是否危险品") + @ExcelProperty("是否危险品") + @Dict(dicCode = "yes_or_no") + private String hazardous; + + @Schema(description = "是否标准溶液") + @ExcelProperty("是否标准溶液") + @Dict(dicCode = "yes_or_no") + private String standardSolutionFlag; + + @Schema(description = "是否标准物质") + @ExcelProperty("是否标准物质") + @Dict(dicCode = "yes_or_no") + private String standardMaterialFlag; + + @Schema(description = "复标周期,单位:天。小于等于0-不复标") + @ExcelProperty("复标周期") + private Integer reviewDue; + + @Schema(description = "排序号") + @ExcelProperty("排序号") + private Integer sortNo; + + @Schema(description = "禁用") + @ExcelProperty("禁用") + private String cancelFlag; + + @Schema(description = "所属部门") + @ExcelProperty("所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductSaveReqVO.java new file mode 100644 index 0000000..12b9244 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/controller/vo/MaterialProductSaveReqVO.java @@ -0,0 +1,91 @@ +package com.zt.plat.module.qms.resource.material.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 物料大类新增/修改 Request VO") +@Data +public class MaterialProductSaveReqVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32133") + private Long id; + + @Schema(description = "父id", example = "6098") + private Long parentId; + + @Schema(description = "id路径") + private String idPath; + + @Schema(description = "节点类型,分类|产品", example = "2") + private String nodeType; + + @Schema(description = "名称", example = "张三") + private String name; + + @Schema(description = "其他配置") + private String customConfig; + + @Schema(description = "自定义表单") + private String customForm; + + @Schema(description = "扩展数据") + private String customData; + + @Schema(description = "标签") + private String tag; + + @Schema(description = "标签模板") + private String labelTemplateKey; + + @Schema(description = "型号") + private String modelNo; + + @Schema(description = "规格") + private String specification; + + @Schema(description = "技术参数") + private String parameter; + + @Schema(description = "制造商") + private String manufacturer; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "允许按量领取") + private String enablePartial; + + @Schema(description = "保质期(天)") + private Integer due; + + @Schema(description = "开封后保质期是否变化") + private Integer openDueFlag; + + @Schema(description = "开封后保质期(天)") + private Integer openDueAfter; + + @Schema(description = "是否危险品") + private String hazardous; + + @Schema(description = "是否标准溶液") + private String standardSolutionFlag; + + @Schema(description = "是否标准物质") + private String standardMaterialFlag; + + @Schema(description = "复标周期,单位:天。小于等于0-不复标") + private Integer reviewDue; + + @Schema(description = "排序号") + private Integer sortNo; + + @Schema(description = "禁用") + private String cancelFlag; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "备注") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java new file mode 100644 index 0000000..279150a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialInfomationDO.java @@ -0,0 +1,124 @@ +package com.zt.plat.module.qms.resource.material.dal.dataobject; + +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import com.baomidou.mybatisplus.annotation.*; +import lombok.*; + +import java.time.LocalDateTime; +/** +* 物料实例 DO +* +* @author 后台管理 +*/ +@TableName("t_mtrl_inf") +@KeySequence("t_mtrl_inf_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialInfomationDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 物料大类id + */ + @TableField("PDT_ID") + private Long productId; + /** + * 批次id + */ + @TableField("BAT_ID") + private Long batchId; + /** + * 存放位置 + */ + @TableField("LOC_ID") + private String locationId; + /** + * 编码 + */ + @TableField("CD") + private String code; + /** + * 技术参数 + */ + @TableField("PRM") + private String parameter; + /** + * 负责人id + */ + @TableField("MNGR_USER_ID") + private Long managerUserId; + /** + * 负责人 + */ + @TableField("MNGR_USER_NAME") + private String managerUserName; + /** + * 上架状态,0-未上架;1-已上架,默认0 + */ + @TableField("PUB_STS") + private String publishStatus; + /** + * 领用状态 + */ + @TableField("USG_STS") + private String usageStatus; + /** + * 开封状态 + */ + @TableField("OPN_STS") + private String openStatus; + /** + * 开封人 + */ + @TableField("OPN_USER_NAME") + private String openUserName; + /** + * 开封人id + */ + @TableField("OPN_USER_ID") + private Long openUserId; + /** + * 开封日期 + */ + @TableField("OPN_DT") + private LocalDateTime openDate; + /** + * 到期日期 + */ + @TableField("EXPR_DT") + private LocalDateTime expirationDate; + /** + * 过期状态 + */ + @TableField("EXPR_FLG") + private String expirationFlag; + /** + * 剩余量 + */ + @TableField("RMNG_VOL") + private String remainingVolume; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialProductDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialProductDO.java new file mode 100644 index 0000000..cb76421 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/dataobject/MaterialProductDO.java @@ -0,0 +1,162 @@ +package com.zt.plat.module.qms.resource.material.dal.dataobject; + +import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; +import com.baomidou.mybatisplus.annotation.*; +import lombok.*; +/** +* 物料大类 DO +* +* @author 后台管理 +*/ +@TableName("t_mtrl_pdt") +@KeySequence("t_mtrl_pdt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +/** +* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO +*/ +public class MaterialProductDO extends BusinessBaseDO { + + + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + /** + * 父id + */ + @TableField("PRN_ID") + private Long parentId; + /** + * id路径 + */ + @TableField("ID_PATH") + private String idPath; + /** + * 节点类型,分类|产品 + */ + @TableField("NDE_TP") + private String nodeType; + /** + * 名称 + */ + @TableField("NAME") + private String name; + /** + * 其他配置 + */ + @TableField("CST_CFG") + private String customConfig; + /** + * 自定义表单 + */ + @TableField("CST_FORM") + private String customForm; + /** + * 扩展数据 + */ + @TableField("CST_DAT") + private String customData; + /** + * 标签 + */ + @TableField("TAG") + private String tag; + /** + * 标签模板 + */ + @TableField("LBL_TMPL_KY") + private String labelTemplateKey; + /** + * 型号 + */ + @TableField("MDL_NO") + private String modelNo; + /** + * 规格 + */ + @TableField("SPEC") + private String specification; + /** + * 技术参数 + */ + @TableField("PRM") + private String parameter; + /** + * 制造商 + */ + @TableField("MFR") + private String manufacturer; + /** + * 单位 + */ + @TableField("UNT") + private String unit; + /** + * 允许按量领取,1-领用时输入量,按量领取;0-领用时不能输入量,整个领走 + */ + @TableField("ENB_PRTL") + private String enablePartial; + /** + * 保质期(天) + */ + @TableField("DUE") + private Integer due; + /** + * 开封后保质期是否变化 + */ + @TableField("OPN_DUE_FLG") + private String openDueFlag; + /** + * 开封后保质期(天) + */ + @TableField("OPN_DUE_AFT") + private Integer openDueAfter; + /** + * 是否危险品 + */ + @TableField("HZRD") + private String hazardous; + /** + * 是否标准溶液 + */ + @TableField("STD_SOL_FLG") + private String standardSolutionFlag; + /** + * 是否标准物质 + */ + @TableField("STD_MTRL_FLG") + private String standardMaterialFlag; + /** + * 复标周期,单位:天。小于等于0-不复标 + */ + @TableField("RVW_DUE") + private Integer reviewDue; + /** + * 排序号 + */ + @TableField("SRT_NO") + private Integer sortNo; + /** + * 禁用 + */ + @TableField("CNL_FLG") + private String cancelFlag; + /** + * 所属部门 + */ + @TableField("SYS_DEPT_CD") + private String systemDepartmentCode; + /** + * 备注 + */ + @TableField("RMK") + private String remark; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java new file mode 100644 index 0000000..5549d3c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialInfomationMapper.java @@ -0,0 +1,44 @@ +package com.zt.plat.module.qms.resource.material.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料实例 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialInfomationMapper extends BaseMapperX { + + default PageResult selectPage(MaterialInfomationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialInfomationDO::getProductId, reqVO.getProductId()) + .inIfPresent(MaterialInfomationDO::getProductId, reqVO.getProductIds()) + .eqIfPresent(MaterialInfomationDO::getBatchId, reqVO.getBatchId()) + .eqIfPresent(MaterialInfomationDO::getLocationId, reqVO.getLocationId()) + .eqIfPresent(MaterialInfomationDO::getCode, reqVO.getCode()) + .eqIfPresent(MaterialInfomationDO::getParameter, reqVO.getParameter()) + .eqIfPresent(MaterialInfomationDO::getManagerUserId, reqVO.getManagerUserId()) + .likeIfPresent(MaterialInfomationDO::getManagerUserName, reqVO.getManagerUserName()) + .eqIfPresent(MaterialInfomationDO::getPublishStatus, reqVO.getPublishStatus()) + .eqIfPresent(MaterialInfomationDO::getUsageStatus, reqVO.getUsageStatus()) + .eqIfPresent(MaterialInfomationDO::getOpenStatus, reqVO.getOpenStatus()) + .likeIfPresent(MaterialInfomationDO::getOpenUserName, reqVO.getOpenUserName()) + .eqIfPresent(MaterialInfomationDO::getOpenUserId, reqVO.getOpenUserId()) + .betweenIfPresent(MaterialInfomationDO::getOpenDate, reqVO.getOpenDate()) + .betweenIfPresent(MaterialInfomationDO::getExpirationDate, reqVO.getExpirationDate()) + .eqIfPresent(MaterialInfomationDO::getExpirationFlag, reqVO.getExpirationFlag()) + .eqIfPresent(MaterialInfomationDO::getRemainingVolume, reqVO.getRemainingVolume()) + .eqIfPresent(MaterialInfomationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialInfomationDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.java new file mode 100644 index 0000000..e4bea35 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/dal/mapper/MaterialProductMapper.java @@ -0,0 +1,51 @@ +package com.zt.plat.module.qms.resource.material.dal.mapper; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; +import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 物料大类 Mapper + * + * @author 后台管理 + */ +@Mapper +public interface MaterialProductMapper extends BaseMapperX { + + default PageResult selectPage(MaterialProductPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MaterialProductDO::getParentId, reqVO.getParentId()) + .likeIfPresent(MaterialProductDO::getIdPath, reqVO.getIdPath()) + .eqIfPresent(MaterialProductDO::getNodeType, reqVO.getNodeType()) + .likeIfPresent(MaterialProductDO::getName, reqVO.getName()) + .eqIfPresent(MaterialProductDO::getCustomConfig, reqVO.getCustomConfig()) + .eqIfPresent(MaterialProductDO::getCustomForm, reqVO.getCustomForm()) + .eqIfPresent(MaterialProductDO::getCustomData, reqVO.getCustomData()) + .eqIfPresent(MaterialProductDO::getTag, reqVO.getTag()) + .eqIfPresent(MaterialProductDO::getLabelTemplateKey, reqVO.getLabelTemplateKey()) + .eqIfPresent(MaterialProductDO::getModelNo, reqVO.getModelNo()) + .eqIfPresent(MaterialProductDO::getSpecification, reqVO.getSpecification()) + .eqIfPresent(MaterialProductDO::getParameter, reqVO.getParameter()) + .eqIfPresent(MaterialProductDO::getManufacturer, reqVO.getManufacturer()) + .eqIfPresent(MaterialProductDO::getUnit, reqVO.getUnit()) + .eqIfPresent(MaterialProductDO::getEnablePartial, reqVO.getEnablePartial()) + .eqIfPresent(MaterialProductDO::getDue, reqVO.getDue()) + .eqIfPresent(MaterialProductDO::getOpenDueFlag, reqVO.getOpenDueFlag()) + .eqIfPresent(MaterialProductDO::getOpenDueAfter, reqVO.getOpenDueAfter()) + .eqIfPresent(MaterialProductDO::getHazardous, reqVO.getHazardous()) + .eqIfPresent(MaterialProductDO::getStandardSolutionFlag, reqVO.getStandardSolutionFlag()) + .eqIfPresent(MaterialProductDO::getStandardMaterialFlag, reqVO.getStandardMaterialFlag()) + .eqIfPresent(MaterialProductDO::getReviewDue, reqVO.getReviewDue()) + .eqIfPresent(MaterialProductDO::getSortNo, reqVO.getSortNo()) + .eqIfPresent(MaterialProductDO::getCancelFlag, reqVO.getCancelFlag()) + .eqIfPresent(MaterialProductDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .eqIfPresent(MaterialProductDO::getRemark, reqVO.getRemark()) + .betweenIfPresent(MaterialProductDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MaterialProductDO::getId)); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationService.java new file mode 100644 index 0000000..b507cba --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationService.java @@ -0,0 +1,65 @@ +package com.zt.plat.module.qms.resource.material.service; + +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 物料实例 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialInfomationService { + + /** + * 创建物料实例 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialInfomationRespVO createMaterialInfomation(@Valid MaterialInfomationSaveReqVO createReqVO); + + /** + * 更新物料实例 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialInfomation(@Valid MaterialInfomationSaveReqVO updateReqVO); + + /** + * 删除物料实例 + * + * @param id 编号 + */ + void deleteMaterialInfomation(Long id); + + /** + * 批量删除物料实例 + * + * @param ids 编号 + */ + void deleteMaterialInfomationListByIds(List ids); + + /** + * 获得物料实例 + * + * @param id 编号 + * @return 物料实例 + */ + MaterialInfomationDO getMaterialInfomation(Long id); + + /** + * 获得物料实例分页 + * + * @param pageReqVO 分页查询 + * @return 物料实例分页 + */ + PageResult getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationServiceImpl.java new file mode 100644 index 0000000..4c76626 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialInfomationServiceImpl.java @@ -0,0 +1,90 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInfomationSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInfomationDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInfomationMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 物料实例 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class MaterialInfomationServiceImpl implements MaterialInfomationService { + + @Resource + private MaterialInfomationMapper materialInfomationMapper; + + @Override + public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) { + // 插入 + MaterialInfomationDO materialInfomation = BeanUtils.toBean(createReqVO, MaterialInfomationDO.class); + materialInfomationMapper.insert(materialInfomation); + // 返回 + return BeanUtils.toBean(materialInfomation, MaterialInfomationRespVO.class); + } + + @Override + public void updateMaterialInfomation(MaterialInfomationSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialInfomationExists(updateReqVO.getId()); + // 更新 + MaterialInfomationDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInfomationDO.class); + materialInfomationMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialInfomation(Long id) { + // 校验存在 + validateMaterialInfomationExists(id); + // 删除 + materialInfomationMapper.deleteById(id); + } + + @Override + public void deleteMaterialInfomationListByIds(List ids) { + // 校验存在 + validateMaterialInfomationExists(ids); + // 删除 + materialInfomationMapper.deleteByIds(ids); + } + + private void validateMaterialInfomationExists(List ids) { + List list = materialInfomationMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_INFOMATION_NOT_EXISTS); + } + } + + private void validateMaterialInfomationExists(Long id) { + if (materialInfomationMapper.selectById(id) == null) { + throw exception(MATERIAL_INFOMATION_NOT_EXISTS); + } + } + + @Override + public MaterialInfomationDO getMaterialInfomation(Long id) { + return materialInfomationMapper.selectById(id); + } + + @Override + public PageResult getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO) { + return materialInfomationMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java new file mode 100644 index 0000000..5e56951 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductService.java @@ -0,0 +1,79 @@ +package com.zt.plat.module.qms.resource.material.service; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import jakarta.validation.Valid; + +import java.util.List; + +/** + * 物料大类 Service 接口 + * + * @author 后台管理 + */ +public interface MaterialProductService { + + //保存分类 + CommonResult saveCategory(@Valid MaterialProductSaveReqVO createReqVO); + + //保存数据 + CommonResult saveData(@Valid MaterialProductSaveReqVO createReqVO); + + /*获取分类树数据*/ + List getTreeData(String nodeType); + + List listByParId(Long parId, String nodeType); + List listByIdPath(Long id, String nodeType); + + CommonResult updateAllIdPath(Long parentId, Integer level); + /** + * 创建物料大类 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + MaterialProductRespVO createMaterialProduct(@Valid MaterialProductSaveReqVO createReqVO); + + /** + * 更新物料大类 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialProduct(@Valid MaterialProductSaveReqVO updateReqVO); + + /** + * 删除物料大类 + * + * @param id 编号 + */ + void deleteMaterialProduct(Long id); + + /** + * 批量删除物料大类 + * + * @param ids 编号 + */ + void deleteMaterialProductListByIds(List ids); + + /** + * 获得物料大类 + * + * @param id 编号 + * @return 物料大类 + */ + MaterialProductDO getMaterialProduct(Long id); + + /** + * 获得物料大类分页 + * + * @param pageReqVO 分页查询 + * @return 物料大类分页 + */ + PageResult getMaterialProductPage(MaterialProductPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java new file mode 100644 index 0000000..2f156a0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/material/service/MaterialProductServiceImpl.java @@ -0,0 +1,215 @@ +package com.zt.plat.module.qms.resource.material.service; + +import cn.hutool.core.collection.CollUtil; +import com.zt.plat.framework.common.exception.ServiceException; +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.framework.common.pojo.PageResult; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.core.constant.DataTypeConstant; +import com.zt.plat.module.qms.enums.ErrorCodeConstants; +import com.zt.plat.module.qms.resource.material.controller.vo.*; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductPageReqVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductRespVO; +import com.zt.plat.module.qms.resource.material.controller.vo.MaterialProductSaveReqVO; +import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialProductDO; +import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialProductMapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*; + +/** + * 物料大类 Service 实现类 + * + * @author 后台管理 + */ +@Service +@Validated +public class MaterialProductServiceImpl implements MaterialProductService { + private int id_path_update_level_limit = 7; + + @Resource + private MaterialProductMapper materialProductMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public CommonResult saveCategory(MaterialProductSaveReqVO entity) { + if(entity.getParentId() == null || entity.getParentId() == 0L) + entity.setParentId(0L); + Long parentId = entity.getParentId(); + List checkList = listByParId(parentId, DataTypeConstant.DATA_TYPE_CATEGORY); + boolean duplicate = false; + MaterialProductDO duplicateEntity = checkList.stream().filter(e->e.getName().equals(entity.getName())).findFirst().orElse(null); + if(duplicateEntity != null && !duplicateEntity.getId().equals(entity.getId())) + duplicate = true; + if(duplicate) + throw exception(ErrorCodeConstants.DICTIONARY_BUSINESS_CLASSIFY_DUPLICATE); + entity.setNodeType(DataTypeConstant.DATA_TYPE_CATEGORY); + Long id = entity.getId(); + MaterialProductDO dic = BeanUtils.toBean(entity, MaterialProductDO.class); + if(ObjectUtils.isEmpty(id)){ + materialProductMapper.insert(dic); + id = dic.getId(); + } + MaterialProductDO backData = this.getMaterialProduct(id); + Long parentId_ = backData.getParentId(); + //检查parId,避免父节点设置为本节点的后代节点 + if(parentId_.equals(id)) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + String idPath = getIdPath(dic); + int curIdIndex = idPath.indexOf("/" + id.toString() + "/"); + int parIdIndex = idPath.indexOf("/" + parentId.toString() + "/"); + if(curIdIndex <= parIdIndex) + throw new ServiceException(ErrorCodeConstants.DATA_COLLECTION_CLASSIFY_PARENT_ERROR); + dic.setIdPath(idPath); + + //更新后代节点路径 + updateAllIdPath(id, 1); + materialProductMapper.updateById(dic); + return CommonResult.success(BeanUtils.toBean(dic, MaterialProductRespVO.class)); + } + + @Override + public CommonResult saveData(MaterialProductSaveReqVO createReqVO) { + Long id = createReqVO.getId(); + MaterialProductDO entity = BeanUtils.toBean(createReqVO, MaterialProductDO.class); + entity.setNodeType(DataTypeConstant.DATA_TYPE_DATA); + Long parentId = createReqVO.getParentId(); + if(id == null){ + materialProductMapper.insert(entity); + }else{ + materialProductMapper.updateById(entity); + } + if(parentId != null && parentId != 0L){ + MaterialProductDO parEntity = this.getMaterialProduct(parentId); + String parPath = parEntity.getIdPath(); + entity.setIdPath(parPath + "/" + entity.getId() + "/"); + materialProductMapper.updateById(entity); + } + MaterialProductRespVO vo = BeanUtils.toBean(entity, MaterialProductRespVO.class); + return CommonResult.success( vo); + } + + @Override + public List listByParId(Long parId, String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(MaterialProductDO::getParentId, parId); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(MaterialProductDO::getNodeType, nodeType); + query.orderByAsc(MaterialProductDO::getSortNo); + return materialProductMapper.selectList(query); + } + + @Override + public List listByIdPath(Long id, String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.like(MaterialProductDO::getIdPath, id); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(MaterialProductDO::getNodeType, nodeType); + query.orderByAsc(MaterialProductDO::getSortNo); + return materialProductMapper.selectList(query); + } + + @Override + public CommonResult updateAllIdPath(Long parentId, Integer level) { + if(level > id_path_update_level_limit) + return CommonResult.success("更新完成(超出层数限制:"+id_path_update_level_limit+")"); + List list = listByParId(parentId, ""); + MaterialProductDO parEntity = this.getMaterialProduct(parentId); + if(list.isEmpty()) + return CommonResult.success(""); + String parIdPath = "/0/"; + if(parEntity != null) + parIdPath = parEntity.getIdPath(); + for(MaterialProductDO entity : list){ + entity.setIdPath(parIdPath + "/" + entity.getId() + "/"); + materialProductMapper.updateById( entity); + updateAllIdPath(entity.getId(),level+1); + } + return CommonResult.success(""); + } + + @Override + public List getTreeData(String nodeType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if(!ObjectUtils.isEmpty(nodeType)) + query.eq(MaterialProductDO::getNodeType, nodeType); + query.orderByAsc(MaterialProductDO::getSortNo); + return materialProductMapper.selectList(query); + } + + @Override + public MaterialProductRespVO createMaterialProduct(MaterialProductSaveReqVO createReqVO) { + // 插入 + MaterialProductDO materialProduct = BeanUtils.toBean(createReqVO, MaterialProductDO.class); + materialProductMapper.insert(materialProduct); + // 返回 + return BeanUtils.toBean(materialProduct, MaterialProductRespVO.class); + } + + @Override + public void updateMaterialProduct(MaterialProductSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialProductExists(updateReqVO.getId()); + // 更新 + MaterialProductDO updateObj = BeanUtils.toBean(updateReqVO, MaterialProductDO.class); + materialProductMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialProduct(Long id) { + // 校验存在 + validateMaterialProductExists(id); + // 删除 + materialProductMapper.deleteById(id); + } + + @Override + public void deleteMaterialProductListByIds(List ids) { + // 校验存在 + validateMaterialProductExists(ids); + // 删除 + materialProductMapper.deleteByIds(ids); + } + + private void validateMaterialProductExists(List ids) { + List list = materialProductMapper.selectByIds(ids); + if (CollUtil.isEmpty(list) || list.size() != ids.size()) { + throw exception(MATERIAL_PRODUCT_NOT_EXISTS); + } + } + + private void validateMaterialProductExists(Long id) { + if (materialProductMapper.selectById(id) == null) { + throw exception(MATERIAL_PRODUCT_NOT_EXISTS); + } + } + + @Override + public MaterialProductDO getMaterialProduct(Long id) { + return materialProductMapper.selectById(id); + } + + @Override + public PageResult getMaterialProductPage(MaterialProductPageReqVO pageReqVO) { + return materialProductMapper.selectPage(pageReqVO); + } + + private String getIdPath(MaterialProductDO entity){ + String parIdPath = ""; + if(ObjectUtils.isEmpty(entity.getParentId()) || 0L == entity.getParentId()) + parIdPath = "/0/"; + MaterialProductDO parEntity = this.getMaterialProduct(entity.getParentId()); + if(parEntity != null){ + parIdPath = parEntity.getIdPath(); + } + return parIdPath + entity.getId() + "/"; + } +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java new file mode 100644 index 0000000..9366837 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/XRFDataController.java @@ -0,0 +1,41 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.admin; + +import java.util.List; + +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.zt.plat.framework.common.pojo.CommonResult; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; +import com.zt.plat.module.qms.thirdpartyapi.service.XRFDataService; + +import cn.hutool.core.collection.CollUtil; +import jakarta.annotation.Resource; + +@RestController +@RequestMapping("/qms/thirdpartyapi/xrf-data") +public class XRFDataController { + + @Resource + private XRFDataService xrfDataService; + + @GetMapping("/xrf-line-list") + public CommonResult getXrfLineList(@RequestParam("deviceNo") String deviceNo) { + List list = xrfDataService.getXrfLineList(deviceNo); + return CommonResult.success(list); + } + + @PostMapping("/submit-xrf-data") + public CommonResult submitXrfData(@RequestBody List reqList) { + if (CollUtil.isEmpty(reqList)) { + return CommonResult.error(1_032_001_000, "请求参数不允许为空"); + } + int count = xrfDataService.submitXrfData(reqList); + return CommonResult.success(count); + } + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/ConfigXRFLineCustomRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/ConfigXRFLineCustomRespVO.java new file mode 100644 index 0000000..6502ebb --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/ConfigXRFLineCustomRespVO.java @@ -0,0 +1,67 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigXRFLineCustomRespVO implements Serializable { + + private static final long serialVersionUID = 4827957658423219091L; + + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10711") + private Long id; + + @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED) + private String deviceNo; + + @Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + private String lineName; + + @Schema(description = "是否启用,0、未启用;1、启用;") + private Integer isUse; + + @Schema(description = "连接字符串") + private String connectString; + + @Schema(description = "数据源类型,(1:rdb,2:mdb)", example = "1") + private Integer dataSourceType; + + @Schema(description = "末次同步数据时间") + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime lastSynchronousDataTime; + + @Schema(description = "末次检查数据时间") + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime lastCheckDataTime; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + @Schema(description = "备注") + private String remark; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleProjectReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleProjectReqVO.java new file mode 100644 index 0000000..387b6b0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleProjectReqVO.java @@ -0,0 +1,36 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class XRFDeviceSampleProjectReqVO implements Serializable { + + private static final long serialVersionUID = 6853465669006150205L; + + /** + * 检测项目名称 + */ + @Schema(description = "检测项目名称") + private String xrfProjectName; + + /** + * 检测项目单位 + */ + @Schema(description = "检测项目单位") + private String xrfProjectUnit; + + /** + * 检测项目值 + */ + @Schema(description = "检测项目值") + private String xrfProjectValue; + + /** + * 小数位数 + */ + @Schema(description = "小数位数") + private Integer valueDecimals; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleReqVO.java new file mode 100644 index 0000000..2bafdc5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/vo/XRFDeviceSampleReqVO.java @@ -0,0 +1,75 @@ +package com.zt.plat.module.qms.thirdpartyapi.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class XRFDeviceSampleReqVO implements Serializable { + + private static final long serialVersionUID = 3173676626377747618L; + + /** + * 设备编号 + */ + @Schema(description = "设备编号") + private String deviceNo; + + /** + * 分析线 + */ + @Schema(description = "分析线") + private String lineName; + + /** + * 样品id + */ + @Schema(description = "样品id") + private String sampleId; + + /** + * 样品编号 + */ + @Schema(description = "样品编号") + private String sampleCode; + + /** + * 样品时间 + */ + @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求) + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "样品时间") + private LocalDateTime sampleTime; + + /** + * 分析人 + */ + @Schema(description = "分析人") + private String assayOper; + + /** + * 分析项目 + */ + @Schema(description = "分析项目") + private List sampleProjects; + + /** + * 是否为检查上传 + */ + @Schema(description = "是否为检查上传") + private Boolean isCheck; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataService.java new file mode 100644 index 0000000..bb56bf5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataService.java @@ -0,0 +1,15 @@ +package com.zt.plat.module.qms.thirdpartyapi.service; + +import java.util.List; + +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; + +public interface XRFDataService { + + List getXrfLineList(String deviceNo); + + int submitXrfData(List reqList); + + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java new file mode 100644 index 0000000..ebe2461 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/XRFDataServiceImpl.java @@ -0,0 +1,254 @@ +package com.zt.plat.module.qms.thirdpartyapi.service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.qms.business.bus.controller.vo.*; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFConversionRateMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFLineMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFProjectMapper; +import com.zt.plat.module.qms.enums.QmsCommonConstant; +import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*; + +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Service +public class XRFDataServiceImpl implements XRFDataService { + + @Resource + private ConfigXRFLineMapper configXRFLineMapper; + + @Resource + private ConfigXRFProjectMapper configXRFProjectMapper; + + @Resource + private ConfigXRFConversionRateMapper configXRFConversionRateMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + + @Resource + private BusinessXRFDataMapper businessXRFDataMapper; + + @Resource + private BusinessAssayTaskDataMapper businessAssayTaskDataMapper; + + @Resource + private BusinessAssayProjectDataMapper businessAssayProjectDataMapper; + + @Override + public List getXrfLineList(String deviceNo) { + List list = configXRFLineMapper.selectByDeviceNo(deviceNo); + return BeanUtils.toBean(list, ConfigXRFLineCustomRespVO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int submitXrfData(List reqList) { + Map> reqLineMap = reqList.stream().collect(Collectors.groupingBy(XRFDeviceSampleReqVO::getLineName)); + for (Map.Entry> entry : reqLineMap.entrySet()) { + String lineName = entry.getKey(); + List xrfDeviceSampleList = entry.getValue(); + XRFDeviceSampleReqVO xrfDeviceSampleFirst = xrfDeviceSampleList.get(0); + + //获取最大时间 + LocalDateTime maxSampleTime = xrfDeviceSampleList.stream().max(Comparator.comparing(XRFDeviceSampleReqVO::getSampleTime)).map(XRFDeviceSampleReqVO::getSampleTime).get(); + + //获取荧光样品id列表 + List sampleIdList = xrfDeviceSampleList.stream().map(XRFDeviceSampleReqVO::getSampleId).collect(Collectors.toList()); + + //查询数据库是否已保存了荧光数据 + BusinessXRFDataReqVO existXRFDataSearch = new BusinessXRFDataReqVO(); + existXRFDataSearch.setDeviceNo(xrfDeviceSampleFirst.getDeviceNo()); + existXRFDataSearch.setLineName(lineName); + existXRFDataSearch.setXRFSampleIdList(sampleIdList); + List existBusYgDataList = businessXRFDataMapper.selectList(existXRFDataSearch); + //已存在数据库中的样品id + List existSampleIdList = new ArrayList<>(); + for (BusinessXRFDataDO qmsBusYgData : existBusYgDataList) { + existSampleIdList.add(qmsBusYgData.getXRFSampleId()); + } + //根据设备编号查询荧光元素配置 + List conYgElementList = configXRFProjectMapper.selectByDeviceNo(xrfDeviceSampleFirst.getDeviceNo()); + + List businessAssayTaskDataDOList = new ArrayList<>(); + List busElementValueList = new ArrayList<>(); + List busYgDataList = new ArrayList<>(); + BusinessXRFDataDO busYgData = null; + for (XRFDeviceSampleReqVO ygDeviceSample : xrfDeviceSampleList) { + if (existSampleIdList.contains(ygDeviceSample.getSampleId())) { + continue; + } + //分析元素 + List sampleElements = ygDeviceSample.getSampleProjects(); + if (sampleElements == null) { + log.info("分析元素为空!", JSON.toJSONString(ygDeviceSample)); + continue; + } + busYgData = new BusinessXRFDataDO(); + busYgData.setDeviceNo(ygDeviceSample.getDeviceNo()); + busYgData.setLineName(ygDeviceSample.getLineName()); + busYgData.setXRFSampleId(ygDeviceSample.getSampleId()); + busYgData.setSampleCode(ygDeviceSample.getSampleCode()); + busYgData.setSampleTime(ygDeviceSample.getSampleTime()); + busYgData.setAssayOperator(ygDeviceSample.getAssayOper()); + busYgData.setIsCheckCreate(ygDeviceSample.getIsCheck() ? 1 : 0); + + JSONObject assayDataJson = new JSONObject(); + String assayData = busYgData.getAssayData(); + if (StringUtils.isNotBlank(assayData)) { + assayDataJson = JSON.parseObject(assayData); + } + + + //处理匹配 + List tempBusElementValueList = new ArrayList<>(); + BusinessAssayTaskDataExtendRespVO businessAssayTaskData = businessAssayTaskDataMapper.selectBySampleCode(ygDeviceSample.getSampleCode()); + if (businessAssayTaskData != null) { + List busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId()); + tempBusElementValueList.addAll(busElementValues); + } + + //分析元素 + for (XRFDeviceSampleProjectReqVO ygDeviceSampleElement : sampleElements) { + + //如果设备上来的元素值为空,则跳过继续 + if (ygDeviceSampleElement.getXrfProjectValue() == null) { + continue; + } + + //查询是否有特殊转换率 +// QmsConYgConverRate conYgConverRate = conYgConverRateService.getOne(Wrappers.query().lambda().eq(QmsConYgConverRate::getDeviceNo, ygDeviceSample.getDeviceNo()) +// .eq(QmsConYgConverRate::getLineName, ygDeviceSample.getLineName()).eq(QmsConYgConverRate::getElementName, ygDeviceSampleElement.getElementName())); + ConfigXRFConversionRateDO conYgConverRate = configXRFConversionRateMapper.selectBy(ygDeviceSample.getDeviceNo(), ygDeviceSample.getLineName(), ygDeviceSampleElement.getXrfProjectName()); + + ConfigXRFProjectDO conYgElement = null; + if(conYgConverRate != null && conYgConverRate.getConversionRate() != null) { + conYgElement = conYgElementList.stream().filter(f -> f.getXRFProjectName().equals(ygDeviceSampleElement.getXrfProjectName()) && f.getConversionRate().equals(conYgConverRate.getConversionRate())).findFirst().orElse(null); + } else { + conYgElement = conYgElementList.stream().filter(f -> f.getXRFProjectName().equals(ygDeviceSampleElement.getXrfProjectName()) && (StringUtils.isBlank(f.getXRFProjectUnit()) || StringUtils.isBlank(ygDeviceSampleElement.getXrfProjectUnit()) || f.getXRFProjectUnit().equals(ygDeviceSampleElement.getXrfProjectUnit()))).findFirst().orElse(null); + } + if(conYgElement != null) { + //数据转换 + BigDecimal elementValue = BigDecimal.ZERO; + Integer conYgElementDataType = 0; + if(conYgConverRate != null && conYgConverRate.getConversionRate() != null) { + BigDecimal convertRate = new BigDecimal(conYgConverRate.getConversionRate().toString()); + elementValue = new BigDecimal(ygDeviceSampleElement.getXrfProjectValue()).multiply(convertRate); + } else { + BigDecimal convertRate = new BigDecimal(conYgElement.getConversionRate().toString()); + elementValue = new BigDecimal(ygDeviceSampleElement.getXrfProjectValue()).multiply(convertRate); + } + if(elementValue.compareTo(BigDecimal.ZERO) < 0) { + elementValue = BigDecimal.ZERO; + } + if(conYgElement.getDataType() != null && "decimal".equals(conYgElement.getDataType())) { + conYgElementDataType = conYgElement.getDecimalPosition(); + } + Long elementId = conYgElement.getDictionaryProjectId(); + BusinessAssayProjectDataExtendRespVO busElementValue = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).findFirst().orElse(null); + if (busElementValue != null) { + //化验数据小数精度四舍六入五单双 + if("decimal".equals(busElementValue.getDataType())) { + busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); + } else { + busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); + } + busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue()); + busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class)); + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); + reportFieldValueData.setFieldName(conYgElement.getSaveColumn()); + reportFieldValueData.setFieldValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); + reportFieldValueData.setDecimalPosition(ygDeviceSampleElement.getValueDecimals()); + reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setUnit(ygDeviceSampleElement.getXrfProjectUnit()); + assayDataJson.put(conYgElement.getSaveColumn(), reportFieldValueData); + +// if(conYgElementDataType != null && conYgElementDataType.intValue() > -1) { +// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue.setScale(conYgElementDataType, BigDecimal.ROUND_HALF_EVEN).toPlainString());//数据格式化-四舍六入五单双 +// } else { +// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue); +// } + } + } + //循环元素修改流程节点 + for (BusinessAssayProjectDataExtendRespVO busElementValue : tempBusElementValueList) { + boolean match = busElementValueList.stream().anyMatch(m -> m.getId().equals(busElementValue.getId())); + if (!match) {//已经添加过的,不再添加 + busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class)); + } + } + + //设置分析数据 + busYgData.setAssayData(assayDataJson.toJSONString()); + + if (businessAssayTaskData != null) { + busYgData.setIsMatched(QmsCommonConstant.YES); + busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId()); + busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId()); + busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId()); + busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId()); + businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class)); + } + + busYgDataList.add(busYgData); + } + //查询荧光分析线配置 + ConfigXRFLineDO conYgLine = configXRFLineMapper.selectByDeviceNoAndLineName(xrfDeviceSampleFirst.getDeviceNo(), lineName); + if (xrfDeviceSampleFirst.getIsCheck()) { + conYgLine.setLastCheckDataTime(maxSampleTime); + } else { + conYgLine.setLastSynchronousDataTime(maxSampleTime); + } + //更新配置时间 + configXRFLineMapper.updateById(conYgLine); + if (busYgDataList.size() > 0) { + + //保存荧光数据 + businessXRFDataMapper.insertBatch(busYgDataList); + + //更新分样子样 +// if(businessAssayTaskDataDOs.size() > 0) { +// busSubCsampleService.updateBatchById(businessAssayTaskDataDOs); +// } + + //更新分析结果 + if (busElementValueList.size() > 0) { + businessAssayProjectDataMapper.updateBatch(busElementValueList); + } + } + } + + + return reqList.size(); + } + + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml new file mode 100644 index 0000000..c29e66c --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml index 10fa3de..3f99302 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.xml @@ -9,7 +9,7 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> - SELECT tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId, tcam.NAME AS configAssayMethodName, @@ -19,12 +19,74 @@ LEFT JOIN T_CFG_ASY_MTHD tcam ON tbatd.CFG_ASY_MTHD_ID = tcam.ID WHERE - tbatd.IS_TSKD = 0 + tbatd.IS_ASN_TSKD = 0 AND tbatd.IS_RPOD = 0 AND tbatd.DELETED = 0 + + AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId} + + + AND tbatd.SMP_FLW_NDE_KY = #{reqVO.sampleFlowNodeKey} + + + AND tbatd.SMP_FLW_NDE_TM #{reqVO.sampleFlowNodeTime[0]} and #{reqVO.sampleFlowNodeTime[1]} + GROUP BY tbatd.CFG_ASY_MTHD_ID, tcam.NAME + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.xml index bc26f6a..04e9410 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDetailMapper.xml @@ -9,4 +9,10 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + + DELETE FROM T_BSN_ASY_TSK_DTL t WHERE t.ID IN + + #{item} + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.xml new file mode 100644 index 0000000..9d24433 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.xml new file mode 100644 index 0000000..17c3b3e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCCoefficientParameterDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.xml new file mode 100644 index 0000000..aefe62f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.xml new file mode 100644 index 0000000..4c2c714 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.xml new file mode 100644 index 0000000..ed46fff --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementParameterDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.xml new file mode 100644 index 0000000..094b251 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCManagementProjectDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.xml new file mode 100644 index 0000000..fc28a5b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCParameterDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.xml new file mode 100644 index 0000000..774ba6f --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQCProjectDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.xml new file mode 100644 index 0000000..77eca10 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessQualityControlSampleProjectMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.xml new file mode 100644 index 0000000..30131be --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.xml new file mode 100644 index 0000000..43d28b5 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleDispatchMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.xml index 5735b57..3961baa 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSampleEntrustRegistrationMapper.xml @@ -9,4 +9,81 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.xml new file mode 100644 index 0000000..b1ab992 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.xml new file mode 100644 index 0000000..d11cf77 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessStandardSampleProjectMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml new file mode 100644 index 0000000..fe113bc --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubParentSampleAssessmentMapper.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.xml new file mode 100644 index 0000000..f99c39a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAnalysisGroupMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.xml new file mode 100644 index 0000000..e7f41de --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleParentRecheckMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml new file mode 100644 index 0000000..cf9930b --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessXRFDataMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.xml index 669888b..4e290a0 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.xml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/business/config/dal/mapper/BaseSampleMapper.xml @@ -10,7 +10,7 @@ --> + select + t.id as id, + t.CFG_RPT_TP_ID as configReportTypeId, + t.NAME as name, + t.FLW_KY as flowKey, + t.RPT_KY as reportKey, + t.CD_RUL as codeRule, + t.DOC_TP as documentType, + t.PERM as permission, + t.SMP_CNT as sampleCount, + t.CST_CFG as customConfig, + t.SYS_DEPT_CD as systemDepartmentCode, + t.RMK as remark, + t.VER as version, + t.SRT_NO as sortNo, + t.CRNT_FLG as currentFlag, + t.MAIN_ID as mainId, + t.PG_CPNT as pageComponent, + t.PG_CPNT_MOB as pageComponentMobile + from T_RPT_DOC_TP t + + + and t.CFG_RPT_TP_ID = #{param.configReportTypeId} + + + and t.NAME like concat('%',#{param.name},'%') + + + and t.MAIN_ID = #{param.mainId} + + + and t.DOC_TP = #{param.documentType} + + + and t.CRNT_FLG = #{param.currentFlag} + + + and ( + + exists( + select 1 + from T_CFG_PERM p + where t.MAIN_ID = p.SRC_ID + and p.SRC_TP = #{param.srcPermissionType} + and p.TGT_ID in ( + + #{item} + + ) + and p.TGT_TP = 'role' + and p.DELETED = 0 + ) + or + + not exists( + select 1 from T_CFG_PERM p where t.MAIN_ID = p.SRC_ID + and p.SRC_TP = #{param.srcPermissionType} + and p.DELETED = 0 + ) + ) + + and t.DELETED = 0 + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.xml new file mode 100644 index 0000000..3fff6b0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/common/data/dal/mapper/DataTemplateMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/manage/deleteme b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/manage/deleteme new file mode 100644 index 0000000..e69de29 diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/office/deleteme new file mode 100644 index 0000000..e69de29 diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml new file mode 100644 index 0000000..2453564 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceInfomationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml new file mode 100644 index 0000000..e61127e --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/device/data/dal/mapper/DeviceProductMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml new file mode 100644 index 0000000..e44bae0 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialInfomationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml new file mode 100644 index 0000000..46e9116 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/com/zt/plat/module/qms/resource/material/data/dal/mapper/MaterialProductMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/application-dev.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml similarity index 100% rename from zt-module-qms/zt-module-qms-server/src/main/resources/application-dev.yml rename to zt-module-qms/zt-module-qms-server/src/main/resources/删/application-dev.yml diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/application-local.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local.yml similarity index 50% rename from zt-module-qms/zt-module-qms-server/src/main/resources/application-local.yml rename to zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local.yml index 033b8fb..1e85e44 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/resources/application-local.yml +++ b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application-local.yml @@ -56,6 +56,12 @@ spring: database: 0 # 数据库索引 # password: 123456 # 密码,建议生产环境开启 +--- #################### MQ 消息队列相关配置 #################### + +# rocketmq 配置项,对应 RocketMQProperties 配置类 +rocketmq: + name-server: 172.16.46.63:30876 # RocketMQ Namesrv + xxl: job: admin: @@ -95,3 +101,86 @@ zt: access-log: # 访问日志的配置项 enable: true +--- #################### liteflow相关配置 #################### +liteflow: + #规则文件路径 + rule-source: el_xml:com.zt.plat.module.qms.core.liteflow.parser.QmsXmlFlowELParser + #-----------------以下非必须----------------- + #liteflow是否开启,默认为true + enable: true + #liteflow的banner打印是否开启,默认为true + print-banner: true + #上下文的初始数量槽,默认值为1024,这个值不用刻意配置,这个值会自动扩容 + slot-size: 1024 + #FlowExecutor的execute2Future的线程数,默认为64 + main-executor-works: 64 + #FlowExecutor的execute2Future的自定义线程池Builder,LiteFlow提供了默认的Builder + main-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder + #自定义请求ID的生成类,LiteFlow提供了默认的生成类 + request-id-generator-class: com.yomahub.liteflow.flow.id.DefaultRequestIdGenerator + #全局异步节点线程池大小,默认为64 + global-thread-pool-size: 64 + #全局异步节点线程池队列大小,默认为512 + global-thread-pool-queue-size: 512 + #全局异步节点线程池自定义Builder,LiteFlow提供了默认的线程池Builder + global-thread-pool-executor-class: com.yomahub.liteflow.thread.LiteFlowDefaultGlobalExecutorBuilder + #异步线程最长的等待时间(只用于when),默认值为15000 + when-max-wait-time: 15000 + #异步线程最长的等待时间(只用于when),默认值为MILLISECONDS,毫秒 + when-max-wait-time-unit: MILLISECONDS + #每个WHEN是否用单独的线程池 + when-thread-pool-isolate: false + #设置解析模式,一共有三种模式,PARSE_ALL_ON_START | PARSE_ALL_ON_FIRST_EXEC | PARSE_ONE_ON_FIRST_EXEC + parse-mode: PARSE_ONE_ON_FIRST_EXEC + #全局重试次数,默认为0 + retry-count: 0 + #是否支持不同类型的加载方式混用,默认为false + support-multiple-type: false + #全局默认节点执行器 + node-executor-class: com.yomahub.liteflow.flow.executor.DefaultNodeExecutor + #是否打印执行中过程中的日志,默认为true + print-execution-log: true + #是否开启本地文件监听,默认为false + enable-monitor-file: false + #是否开启快速解析模式,默认为false + fast-load: false + #是否开启Node节点实例ID持久化,默认为false + enable-node-instance-id: false + #是否开启虚拟线程(只在JDK21+环境有效),默认为true + enable-virtual-thread: true + #简易监控配置选项 + monitor: + #监控是否开启,默认不开启 + enable-log: false + #监控队列存储大小,默认值为200 + queue-limit: 200 + #监控一开始延迟多少执行,默认值为300000毫秒,也就是5分钟 + delay: 300000 + #监控日志打印每过多少时间执行一次,默认值为300000毫秒,也就是5分钟 + period: 300000 + +zzjc: + druid: + sql-log: true + snowflake: + data-center-id: 30 + tio: + server: + # port + port: 8320 + # 心跳时间 + heartbeat-timeout: 20000 + websocket: + # enable websocket default false + enable: true + # websocket port + port: 8330 + # 集群配置 默认关闭,集群开启需要redis + cluster: + enabled: true + group: true + redis: + mode: single + ip: 172.16.46.63 # 地址 + port: 30379 # 端口 + database: 0 # 数据库索引 \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/resources/application.yml b/zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml similarity index 100% rename from zt-module-qms/zt-module-qms-server/src/main/resources/application.yml rename to zt-module-qms/zt-module-qms-server/src/main/resources/删/application.yml